-D pass-through to compilation tools

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • -D pass-through to compilation tools

      Referring to this thread from Feb 2018:

      [SOLVED] EMBuild -D option

      ...can I ask if it is still the case that there is no way to pass in #defines from the outside world into Segger Embedded Studio? I don't mean change ones that SES knows about, I mean just pass in the random stuff I need to get into my code. Not being able to do this is a real barrier to automation and to writing/maintaining cross-platform code. I have to deal with building/testing my code under many different SDKs at the same time and the last thing I want to have to do is tell each IDE about ever little thing when it matters not a jot: my code deals with the consequences and only my code cares, it really should be transparent to the IDE.

      Please tell me there's a way to do this. Make can obviously do it and even CMake is able to do it with a little persuasion. If there's really no way to do this then, unfortunately, SES is not a viable option for me.

      Rob
    • FYI, I've found a workaround for this. In my common pre-processor definitions I have added 10 generic entries with dummy default values as follows:

      $(EXTRA0:__dummy0)
      $(EXTRA1:__dummy1)
      $(EXTRA2:__dummy2)
      ..
      .

      I can then launch SES from the command line and supply the actual values for each one as parameters, e.g.:

      "C:\Program Files\Segger\SEGGER Embedded Studio for ARM 4.50\bin\emstudio" -D EXTRA0="MY_CONDITIONAL=1"


      Not elegant but it works.