MantisBT - CMake
View Issue Details
0014044CMakeCMakepublic2013-03-27 08:502013-10-07 10:04
Matthias Maier 
 
normalmajoralways
closednot fixable 
Max OSX 10.7
CMake 2.8.10.2 
 
0014044: The Xcode generator produces an invalid target that will not get linked if it consists only of objects from object libraries
Example code snippet:

  ADD_LIBRARY(foo OBJECT
    foo.cc
    )
  ADD_LIBRARY(bar SHARED
    $<TARGET_OBJECTS:foo>
    )

"$ xcodebuild -target bar" will compile foo.obj but libbar.dylib doesn't get linked.

As a workaround,

  ADD_LIBRARY(foo OBJECT
    foo.cc
    )
  ADD_LIBRARY(bar SHARED
    dummy.cc
    $<TARGET_OBJECTS:foo>
    )

does work as expected (links dummy.obj and foo.obj to a libbar.dylib).
No tags attached.
Issue History
2013-03-27 08:50Matthias MaierNew Issue
2013-03-27 09:11Brad KingNote Added: 0032707
2013-03-27 09:11Brad KingStatusnew => resolved
2013-03-27 09:11Brad KingResolutionopen => not fixable
2013-10-07 10:04Robert MaynardNote Added: 0034018
2013-10-07 10:04Robert MaynardStatusresolved => closed

Notes
(0032707)
Brad King   
2013-03-27 09:11   
This is a known limitation of Xcode. Documentation was added for this limit a few months ago:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51988a4f [^]
(0034018)
Robert Maynard   
2013-10-07 10:04   
Closing resolved issues that have not been updated in more than 4 months.