[CMake] MSVC71 WholeProgramOptimization flags (/LTCG and /GL)

Luke Kucalaba lkucalaba at dsci.com
Thu Dec 4 18:51:02 EST 2008


Hi,

 

I would like to reopen issue #0006794 dealing with this linker warning
that is still present for MSVC 7.1 static library builds:

 

Linking CXX static library ..\build\MT-DLL\Util-SL.lib

XMLWriter.cpp.obj : warning LNK4218: non-native module found; restarting

 

I did some more investigation of this problem, and I think I've nailed
it down now. I thought it was the missing WholeProgramOptimization
element that was causing the warning, when in fact it is the missing
"/LTCG" flag that should be in the Librarian additional command-line
options. I realize that for a static library project the linker flags
are not included in the generated project file, but this should be an
exception case to that rule. As a general rule of thumb, if the /GL
compiler flag is passed to a static library project, then the /LTCG flag
should be passed to the Librarian AdditionalOptions line.

 

            <Tool

                Name="VCLibrarianTool"

                AdditionalOptions="/LTCG">

 

Thank you for your time and effort. I appreciate the hard work that you
have all done to make and keep CMake a high-quality software product.

 

Sincerely,

Luke

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081204/88202508/attachment.htm>


More information about the CMake mailing list