MantisBT - CMake
View Issue Details
0010554CMakeCMakepublic2010-04-14 13:582016-06-10 14:31
Jean Sreng 
Kitware Robot 
normalminoralways
closedmoved 
CMake-2-8 
 
0010554: CMAKE_MODULE_LINKER_FLAGS_DEBUG has no effect in Visual Studio 2008 generator
Attempting to locally modify the library link options using

 SET ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:x64" )
 SET ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /machine:x64" )

ADD_LIBRARY(Hello hello.cxx)

Does not generate the line "AdditionalOptions" in the .vcproj . This line is however generated for executables (add_executable and CMAKE_EXE_LINKER_FLAGS)

The expected behavior in this case would be to add "AdditionalOptions" = "/machine:x64" (or whatever is in CMAKE_MODULE_LINKER_FLAGS) in the section
<Tool Name="VCLibrarianTool" ...> of the .vcproj

(This also applies for LINK_FLAGS of SET_TARGET_PROPERTIES)

I think this issue is related to bug 0000613.

As weird as it may sound, MS Visual C++ can need some options to be passed to its "library" tool (lib.exe) when generating libs.

No tags attached.
related to 0000629closed Bill Hoffman SET_TARGET_PROPERTIES( LINK_FLAGS) doesn't work on libraries 
related to 0000613closed Bill Hoffman Can't change linker flags on MSVC 
Issue History
2010-04-14 13:58Jean SrengNew Issue
2010-04-15 07:45Jean SrengNote Added: 0020193
2011-01-17 15:34David ColeRelationship addedrelated to 0000629
2011-01-17 15:34David ColeRelationship addedrelated to 0000613
2011-01-17 15:36David ColeNote Added: 0024803
2011-01-17 15:36David ColeAssigned To => David Cole
2011-01-17 15:36David ColeStatusnew => assigned
2012-08-13 15:16David ColeStatusassigned => backlog
2012-08-13 15:16David ColeNote Added: 0030613
2012-08-13 15:17David ColeAssigned ToDavid Cole =>
2016-06-10 14:27Kitware RobotNote Added: 0041685
2016-06-10 14:27Kitware RobotStatusbacklog => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:27Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0020193)
Jean Sreng   
2010-04-15 07:45   
Found a workaround:

set_target_properties(${name} PROPERTIES STATIC_LIBRARY_FLAGS "${CMAKE_XXX_LINKER_FLAGS}") did the trick.

However, I'm not sure if the behavior described in the previous message should or should not be implemented nevertheless...
(0024803)
David Cole   
2011-01-17 15:36   
Are you sure you're testing with a SHARED library?

By default, CMake will be using a static library for add_library, so there's nothing to "link" with CMAKE_SHARED_LINKER_FLAGS or CMAKE_MODULE_LINKER_FLAGS...

What happens if you do the following (add the "SHARED" flag)?
  SET ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:x64" )
  SET ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /machine:x64" )
  ADD_LIBRARY(Hello SHARED hello.cxx)
(0030613)
David Cole   
2012-08-13 15:16   
Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041685)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.