In the code below, constantset_a.h and constantset_b.h define the same set of global constants but sets the constants with different values. Compiled myprogram.exe is to behave differently depending on the global constant values they were compiled with.
My question is, is there any way that I can use MSBUILD to set CONSTANTSET_A and build, and then set CONSTANTSET_B and then build again, and for the compiled binaries to have different names? I need this to be done in a single compile pass (i.e. compiling two different binaries with one build /c /z command), since my codes will be compiled along with other people's codes in the team-wide automated build process.
So probably in the "sources" build configuration file, I could do
? I know this is wrong, but I just put it there so that you would have a better idea as to what I want to achieve.Code:... TARGETNAME=MyProgramA;MyProgramB C_DEFINES=-DCONSTANTSET_A -DCONSTANTSET_B ...
Code:// myprogram.h #if defined CONSTANTSET_A #include <constantset_a.h> #elif defined CONSTANTSET_B #include <constantset_b.h> #endif ...