U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
Conditional compilation
https://www.ultimatepp.org/forums/index.php?t=rview&goto=50662&th=10511#msg_50662
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
]]>Giorgio2018-11-30T13:23:25-00:00Re: Conditional compilation
https://www.ultimatepp.org/forums/index.php?t=rview&goto=50663&th=10511#msg_50663
Giorgio wrote on Fri, 30 November 2018 14:23
Hi 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.]]>mirek2018-12-01T07:50:24-00:00Re: Conditional compilation
https://www.ultimatepp.org/forums/index.php?t=rview&goto=50676&th=10511#msg_50676
Giorgio2018-12-03T10:04:21-00:00