Detect DEBUG configuration

Sysprogs forums Forums VisualGDB Detect DEBUG configuration

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34978
    x_ruslan
    Participant

    I have 3 subprojects in my project, 2 ESP and one СMake embedded with three targets.
    When I select the DEBUG configuration, the macro does not work for me:

    #ifdef DEBUG
    #define LOG_INIT() {_log_init();} //Not selected block (Why?)
    #define LOG(format, … ) {_log(format, ##__VA_ARGS__);}
    #else
    #define LOG(format, … ) {;} //Selected this block
    #define LOG_INIT() {;}
    #endif

    What am I doing wrong?

    #34983
    support
    Keymaster

    Hi,

    Please let us know the email address associated with your license key so that we could link it to your forum account.

    #34987
    x_ruslan
    Participant

    I changed address in my profile to my license email.

    #34997
    support
    Keymaster

    Hi,

    Thanks for confirming your license. The ESP32 builds are managed by the ESP-IDF build scripts, that indeed do not define separate debug/release macros on the C/C++ level.

    You can work around it by adding the following line to the top-level CMakeLists.txt file of your project, before the first include() statement:

    add_compile_definitions(${CMAKE_BUILD_TYPE})
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.