[CMake] Cmake: VS2013: General -> Whole Program Optimization (/LTCG)

Sachin Gaikwad sachin.kernel at gmail.com
Fri May 8 08:54:41 EDT 2015


Hi all,

I am using:
 - cmake-3.0.2
 - Visual Studio 2013 (Update 4)

I get this log message in build logs when I build any target in my Visual
Studio solution:

"MSIL .netmodule or module compiled with /GL found; restarting link with
/LTCG; add /LTCG to the link command line to improve linker performance"

I read online on this and found this Microsoft link (
https://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx) which suggests that
I should set "Whole Program Optimization" under "General" properties to
"Use Link Time Code Generation" (/LTCG).

I am not able to figure out which cmake variables I should set this in? I
tried setting this flag in following variables, but it did not work.

CMAKE_EXE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS

Thanks,
Sachin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150508/a41091ef/attachment.html>


More information about the CMake mailing list