Hi Stefan,
On 12.02.2018 19:20, Stefan wrote:
How can one set a special preprocessor #define for a .cc file without touching the code?
Is there a possibility to set the #define in the .mk-file?
you can use the -D command-line argument for the compiler, which you can pass via the 'CC_OPT' variable, e.g.:
CC_OPT += -DHAVE_NICE_FEATURE=1
This passes the argument for all compilation units of the target.mk file. If you want to apply it to a single compilation unit only, you may specify the file name (without extension) as follows:
CC_OPT_single_file += -Dprivate=public
Here, the dangerous define is only used when compiling 'single_file.cc'.
To take a close look at the compiler arguments, you may add VERBOSE= when invoking make.
Cheers Norman