[CMake] set “Whole Program Optimization”to Yes in VS 2005

Tyler Roscoe tyler at cryptio.net
Tue Feb 9 23:17:04 EST 2010


On Wed, Feb 10, 2010 at 10:51:28AM +0800, xiada74 at sina.com wrote:
> SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
>  
> The corresponding statement in the .vcproj file generated by CMake is:
>  
> AdditionalOptions=" /Zm1000 /GL"
>  
> When I open the property pages in VS 2005,I can see /GL on the page on command line, but the item of“Whole Program Optimization”on the page of Optimization is still No.
>  
> Why does not CMake generate WholeProgramOptimization="1" in the .vcproj file?

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?

tyler


More information about the CMake mailing list