I have some conditional compilation flags across multiple source files, which looks as following :
#ifdef FLAG1
code ...
#endif
I have these flags enabled in the Makefile, based on some conditions. Clion grays out the blocks of code that are within the flags and doesn't perform any syntax analysis on them. Is there a way to enable some flags directly in Clion?
To add a preprocessor
add_definitions(-DFOO -DBAR ...)
See this link for CMake's documentation.
To make things work correctly, make sure that:
make USE_THIS=1 DEBUG=1, type USE_THIS=1 DEBUG=1 into this field and reload Makefile project.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With