我收到了2个关于在Cmake中set“Whole_Program_Optimization”to Yes in VS 2005的邮件:
Not sure, probably an omission. "/GL" appears to be supported in
cmVS10CLFlagTable.h but not cmLocalVisualStudio7Generator.
Here's a patch
http://public.kitware.com/Bug/view.php?id=10263
P.S.
If it's not clear, CMake not supporting the WholeProgramOptimization
XML tag only affects what the Visual Studio GUI looks like and doesn't
affect the compiling of the code since the /GL shows up in the
additional options line and thus gets added to the command line when
the compiler is run.
--
Philip Lowman
-----------------------------------------------------------------
I've seen a similar case where the CMake-generated .vcproj "looked"
wrong in the IDE but the compiler was actually using the appropriate
setting (the /DEBUG flag iirc).
It may be that Visual Studio is actually compiling the code with "Whole Program
Optimization". Can you check that somehow?