This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Output names/paths depends from compiler switches



Hi,

I have one project where I can set compiler switches for different versions.

e.g.

#define Version1

#define Version2 

...

It is possible to set the output path and names depends from this switches ?

So that the output path is "Version1" and the Hex-TXT file is "Version1.txt"

Thanks for your help

  • What compiler are you using?

    With the C2000 compiler, you can specify the output file name for a specific configuration (i.e. Release, Debug and etc.) in Project Properties->Build->C2000 Linker->Basic Options. You can also specify the complete path to that file.

    The same can be done for the Hex file at Project Properties->C2000 Hex Utility->General Options.

    Stephen
  • Maybe it would be best to set up different build configuration for each version and put the defines (Version1, Version2) in Project Properties->C2000 Compiler->Advanced Options->Predefined Symbols.

    Stephen
  • I use Code Composer Studio 6.1
    Is there no #pragma or #define value that I can set ?
  • What are the reasons my suggestions won't work?
    Stephen
  • The Output path and name are defined by the project properties, which are set in CCS. There aren't going to be any pragmas or defines that set those.

    Why are you against setting up separate build configurations for each version? I believe build configurations are the best way to go. Also, using CCS exclude feature (i.e. right click on file and select "Exclude from build"), you can exclude files from a specific build configuration.

    Stephen
  • If you are concerned about CCS messing something up when you create a new build configuration, you could use winmerge or some other file comparison program to compare the build output between the previous version and the current version.  That would should show you whether or not any compiler or linker options have changed.

    Also, there is the issue with the project file growing larger. If that is an issue, you could archive the current project and then delete all but last few versions.

    Are you using version control (mercurial, svn or etc.)?

    Stephen

  • Also, you might not need a new configuration for every version. For example, when you begin a new code project, you will have a lot of test versions until you get to the first release.  You probably won't need a new configuration until your first release.   Also, you probably won't need a new configuration for test versions that go in between releases.  If none of the options changed, you can just use a common configuration for test versions.  However, you should still need to commit the test versions to version control. 

    If one or more of my post help you, please select "Verify Answer" to one or more of those post.

    Stephen

  • Thank you Stephen.

    My hope was, that I can use a #define or #pragma .

    That would easy to use. But I will think about the configurations. So I make a configuration for each variant.

    Best regards