ESP32-IDF – setting #define on a per config basis

Sysprogs forums Forums VisualGDB ESP32-IDF – setting #define on a per config basis

This topic contains 2 replies, has 2 voices, and was last updated by  support 1 week, 2 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26133

    dedvalson
    Participant

    Hi,

    This seems really basic, but I don’t see an answer to it. I need to define multiple configurations in the Visual Studio configuration manager and have those reflected as defines in the c++ pre-processor.

    I can make the defines work by putting something like:

    CPPFLAGS += -DCONTROL2

    in the makefile but I need these to be defined per configuration.

    Am I missing something obvious?

    Don

    #26134

    dedvalson
    Participant

    It would also be really cool if IntelliSense could see these defines.

    #26147

    support
    Keymaster

    Hi,

    The easiest way to achieve this would be to use the CMake-based projects and add the following constructs to the CMakeLists.txt files:

    and then simply add ${CONFIG_SPECIFIC_MACROS} to the regular list of preprocessor macros via VS Project Properties. This will affect both build and IntelliSense.

    If it doesn’t work, please let us know and we will help you configure everything.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.