c++ - Passing preprocessor variable to nmake build environment -
i having issues building driver using nmake on win7 x64 build environment. defining preprocessor variable , passing on command line using -
build /nmake "user_c_flags=/dmyversion=3" and build log -
... /dmyversion=3 /typedil- /wd4603 /wd4627 .... so, see variable part of compiler options. in header fie, do
#define otherversion 10 #ifdef myversion #undef otherversion #define otherversion myversion #endif #define fileversion otherversion the problem fileversion being 10 irrespective of myversion define passed , exist in environment. test, going on, did -
#ifdef myversion #error myversion present in environment. #endif i see statement being printed. why otherversion 10 despite preprocessor directive present in environment ? why not taking value 3 passed via command line options?
i'm not sure, if works you, people did try achieve quite same using msbuild. had adapt project-file pipe definitions "into" build-process. have @ msbuild.exe not accepting either /p:defineconstants nor /p:preprocessordefinitions
Comments
Post a Comment