My problem:
I have created a C project in Visual Studio 2010 and defined a conditional compilation constant namedQWERTY
. My C source code executes #ifdef QWERTY
in order to see if it's defined or not.
When I ad开发者_StackOverflow中文版d /DQWERTY
into the command line additional options of my C project in the IDE, then the constant is correctly detected after compilation, just as expected.
So, my questions is: how can I define that constant from the command line using MSBuild?
Just for clarity reasons, I'm running this command:
MSBuild myproj.sln
Please don't propose to use the switch /p:DefineConstants
; I've created a C project, not a C# project, and that switch is useless for C/C++ projects.
As you've probably already understood, I'm feeling more and more desperate about this trivial problem. Please enlighten me and show me that there is a simple solution around the corner that I've missed of pure stupidity.
精彩评论