View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012295CMakeCMakepublic2011-06-21 18:112014-05-23 16:49
ReporterBen Medina 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSWindowsOS Version7
Product VersionCMake 2.8.4 
Target VersionFixed in Version 
Summary0012295: LINK_FLAGS_RELEASE has no effect on static libraries for MSVC generators
DescriptionSetting the LINK_FLAGS_RELEASE target property does not effect the output from the MSVC generators for static libraries.
Steps To Reproduce1. Use CMake to generate project files for the attached project. I've tried the Visual Studio 2008 and 2010 generators.
2. Build the project in release mode. The following warning will be generated for the static library, but not the shared library:
   a.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Additional InformationThe cmake code attempts to add /LTCG to the LINK_FLAGS_RELEASE for both libraries. It does get added to the shared library, but not the static library. You can verify this in the Visual Studio GUI by going to project properties for the static library, and checking Configuration Properties>Librarian>General. The last entry is Link Time Code Generation, which is expected to be set to "Yes (/LTCG)".
Tagsc++, msvc
Attached Fileszip file icon link_test.zip [^] (663 bytes) 2011-06-21 18:11

 Relationships

  Notes
(0026944)
Brad King (manager)
2011-06-21 18:16

Static libraries are not generated by a linker. Use STATIC_LIBRARY_FLAGS to pass flags to the librarian:

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:STATIC_LIBRARY_FLAGS [^]
(0027780)
David Cole (manager)
2011-11-11 10:45

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-06-21 18:11 Ben Medina New Issue
2011-06-21 18:11 Ben Medina File Added: link_test.zip
2011-06-21 18:16 Brad King Note Added: 0026944
2011-06-21 18:16 Brad King Status new => resolved
2011-06-21 18:16 Brad King Resolution open => no change required
2011-06-21 18:16 Brad King Assigned To => Brad King
2011-11-11 10:45 David Cole Note Added: 0027780
2011-11-11 10:45 David Cole Status resolved => closed
2014-05-23 16:48 Saad Tag Attached: c++
2014-05-23 16:49 Saad Tag Attached: msvc


Copyright © 2000 - 2018 MantisBT Team