No subject


Thu Aug 21 14:30:17 EDT 2008


unknown option '/LTGC'" i could guess that the flags have slightly
changed:
It seems the compiler (cl.exe) now needs the /GL option to enable
whole program optimization,
and the linkers (lib.exe & link.exe) now need the /LTCG option to enable
it.

On Fri, Oct 10, 2008 at 19:44, Luke Kucalaba <lkucalaba at dsci.com> wrote:
> I posted an issue on the mantis bug tracker a while ago regarding
supporting the /LTCG option for the MSVC71 generator.  The issue history
indicates this problem is fixed, but with CMake 2.6.2 the correct flags
are still not being generated for the MSVC71 project files and nmake
makefiles.  Fortunately, the MSVC compiler/linker is smart enough to
realize this and restarts the link using /LTCG.  The only bad thing
about this is it extends the time required to link because it has to
restart the link again.

>
> Some details are provided below.  Thanks in advance!
> Luke
>
> -----------------------
> NMake output:
> -----------------------
> Linking CXX static library ..\build\MT-DLL\Util-SL.lib
> XMLWriter.cpp.obj : warning LNK4218: non-native module found;
restarting link with /LTCG
>
> -----------------------
> MSVC71 output:
> -----------------------
> Timer.obj : warning LNK4218: non-native module found; restarting link
with /LTCG
>
> -----------------------------
> Here's the original issue:
> -----------------------------
>
> Summary 0006794: Visual Studio compiler 'WholeProgramOptimization'
(/LTCG)
>
> Description
>
> Hi,
>
> The cl.exe compiler option /LTCG (i.e. "WholeProgramOptimization")
does not seem to be generated correctly into the Visual Studio project
file. This error occurs in Visual Studio .NET 2003 (v7.1), and probably
occurs in later versions as well.
>
> The /LTCG is a whole configuration setting, which should be added to
the "Configuration" xml tag in the vcproj file as in the following
example:
>
>   <Configuration
>     Name=3D"Release|Win32"
>     OutputDirectory=3D"Release"
>     . . .
>     WholeProgramOptimization=3D"TRUE">
>
> This should be an easy fix. Please feel free to contact me with any
questions you may have.
>
> Thanks!
> Luke
>
> (0013076)
> bill.hoffman (manager)
> 2008-08-19 15:09
> Committer: Bill Hoffman <bill.hoffman at kitware.com>
> /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v <--
cmGlobalVisualStudio7Generator.cxx
> new revision: 1.101; previous revision: 1.100
>
> BTW, this flag is not supported in VS8 and greater:
> cl : Command line warning D9002 : ignoring unknown option '/LTGC'
>
> Issue History
> Date Modified Username Field Change
> 2008-04-11 15:49 lkucalaba New Issue
> 2008-08-19 15:09 bill.hoffman Status new =3D> closed
> 2008-08-19 15:09 bill.hoffman Note Added: 0013076
> 2008-08-19 15:09 bill.hoffman Resolution open =3D> fixed
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list