[SOLVED] Version Marco Expansion Building from GUI and embuild

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

  • [SOLVED] Version Marco Expansion Building from GUI and embuild

    I am trying to get this forum.segger.com/index.php/Thr…Build-Option-D-Questions/ working and have found a working solution yet.

    What I'm trying to do is be able to build via the GUI and have a default version string 0.0.0 be used in the build. Then when I run my CI/CD scripts with embuild I want to have a version defined via my build scripts injected into embuild. I can successfully get the version into my application when building from the embuild but I'm having trouble getting the default version to work from the GUI. If have tried using Project Marcos and #ifdef's but that doesn't seem to work. Can you please tell me how to accomplish this?

    Thanks,
  • Hello,

    Thank you for your inquiry.
    Could you provide more information on what is not working? Could you provide a small example project that shows that behaviour?

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Nino,

    For example I have defined a APP_VER=$(EXT_VER) as a preprocessor macro. Running emBuild on the command line with -D EXT_VER="0.7.0" works fine and sets the static const char* VERSION_STR = APP_VER; t . What I want to do is also build from the GUI and when building from the GUI have APP_VER default to "0.0.0". I can't build from the GUI because when I compile the file that has static const char* VERSION_STR = APP_VER; t in it I get the following warnings and errors

    Source Code

    1. implicit declaration of function '$' [-Wimplicit-function-declaration]
    2. in expansion of macro 'APP_VER'
    3. 'EXT_VER' undeclared here (not in a function); did you mean 'APP_VER'?
  • Hi,
    The Embedded Studio Macro expansion supports defaults.
    For example you could set your preprocessor macro like this: APP_VER=$(APP_VER:0.0.0)

    Does this answer your question?

    Best regards,
    Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.
  • Hello Darren,

    Good to hear that you are up and running again.
    You can find documentation about this here:
    studio.segger.com/ide_project_macros.htm

    We will consider this case as closed now.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.