View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001258CMakepublic2004-10-15 18:202005-02-10 08:03
Reporterkireputsje 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001258: Compiler flags are not correctly handled for vs.net
DescriptionThe vs.net generator handles only the -D flags correctly. Other flags will cause strange errors.
The URL points to start of the thread about this problem.

Errors:
\dev\cmake\test.cpp(2) : error C2124: divide or mod by zero
\dev\cmake\test.cpp(2) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
\dev\cmake\test.cpp(2) : warning C4067: unexpected tokens following preprocessor directive - expected a newline

Test program:

-------- CMakeLists.txt --------
PROJECT( test )
ADD_DEFINITIONS( -DSOME_DEFINE=1 )
ADD_DEFINITIONS( /Yu"test.h" )
ADD_EXECUTABLE( test test.cpp )
-------- end --------

-------- test.cpp --------
int main(void) {
#if SOME_DEFINE
   return 0;
#else
   return 1;
#endif
}
-------- end --------
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0001617)
kireputsje (reporter)
2004-10-15 18:31

Some more text from the original mail:

When compiling a project which always seemed to work under VC6, We ran into a problem when using VS.NET 2003.

I tracked this down to the following define:
#if SOME_DEFINE

Which is expanded to something like:
#if 1/Yu"test.h"

When examining the test.vcproj.cmake, I noticed:
SOME_DEFINE=1 /Yu"test.h",

Seems like ADD_DEFINITIONS only allows -D options?
(0002050)
Bill Hoffman (manager)
2005-02-10 08:03

fixed in cvs

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team