Adding Pre-Processor Defines Before Compiling Components

Sysprogs forums Forums VisualGDB Adding Pre-Processor Defines Before Compiling Components

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25877
    JN
    Participant

    Hi,

    Using VGDB with the esp32 toolchain. I have a few components that are shared across other platforms. I’d like to add pre-processor defines to mask certain parts of the code that are not applicable.

    I added the component_compile_definitions(DEFINE_NAME) after calling register_component() in the cmakelists.txt of the respective component. But this doesn’t seem to apply. I’ve also tried including this in the CMAKE project settings(under Project Properties) as ‘Extra CMake configuration variables” but was unsuccessful.

    Is there a specific place that I should be putting this at?

     

    #25903
    support
    Keymaster

    Hi,

    Normally component_compile_definitions() in the component’s file should work, so most likely the problem you are experiencing is caused by something else (e.g. source is used by a different component, or one of the CMakeLists files was overridden).

    If you are not sure, please try reproducing the problem on a freshly created LEDBlink project. If it can be reproduced there, please try re-downloading the toolchain from scratch. If it still doesn’t work as expected, please check if the problem reoccurs when building the project outside VisualGDB and try submitting a bugreport to Espressif.

    You can also use VisualGDB’s CMake debugger to step into the the component_compile_definitions() statement and check whether it works.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.