Home » Community » Newbie corner » Conditional compilation
Re: Conditional compilation [message #50663 is a reply to message #50662] |
Sat, 01 December 2018 08:50 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Giorgio wrote on Fri, 30 November 2018 14:23Hi there,
I have a project consisting in several packages. Not all the packages should be built each time, because I would like to customize the executable for each user excluding or including some packages. This should be done using an include file in which I define some "variable" specifying if the package has to be compiled. I have tried to use the package organizer, but I do not understand completely how it works. For instance, in the include file i defined a variable: #define COMPILEMODULEA and then in the package organizer, in the when column, I put COMPILEMODULEA. My understanding in fact was that if the variable in the when column is defined, the package is included, but this is clearly not the case, as that is not working. What should I put in the when column of the package organizer?
Thanks,
gio
Almost correct, but you do not define it with #define. Those variables are set in "main configuration" and the term is in fact 'FLAG' (not variable). Note that some flags are also added by builders (like WIN32 etc...).
You can create package organizer "when" conditions based on flags and it is really meant for you usecase.
Additionally, all flags (both those specified in main package and those added by build process) are reflected as #define flagXXX (via commandline). So you can additionally test these in the code.
|
|
|
Goto Forum:
Current Time: Sat May 04 16:07:12 CEST 2024
Total time taken to generate the page: 0.02803 seconds
|