atilaneves / cmake-ide

Use Emacs as a C/C++ IDE
BSD 3-Clause "New" or "Revised" License
716 stars 92 forks source link

How to highlight conditional macros #216

Closed jack2gs closed 1 year ago

jack2gs commented 1 year ago

Hi team,

Thanks for your effort on this great package! It's really helpful! I was wondering how to support highlight conditional macros, for example, it has macros like this:

#if defined A
std::cout<<"A"<<std::endl;
#else 
std::cout<<"Not A"<<std::endl;
#endif

if A is defined in cmake, then std::cout<<"Not A"<<std::endl; will be grayed out. Otherwise std::cout<<"A"<<std::endl; will be grayed out. What I need to do to make this work?

Thanks, Jack

jack2gs commented 1 year ago

sorry, sorted. The macro was not defined as expected in cmake.