View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015338CMakeCMakepublic2015-01-06 10:232015-06-01 08:38
ReporterMatthias Maier 
Assigned ToStephen Kelly 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 3.1 
Target VersionCMake 3.1.1Fixed in VersionCMake 3.1.1 
Summary0015338: Querying for (deprecated) LOCATION property prevents expansion of TARGET_OBJECTS generator expression
DescriptionConsider the following minimal project:

foo.cc
    int main () {}

CMakeLists.txt$<TARGET_OBJECTS:foo>
    add_library(foo OBJECT foo.cc)
    add_executable(bar $<TARGET_OBJECTS:foo>)
    get_target_property(location bar LOCATION)

Starting with CMake 3.1 above example fails with an error message ("CMake Error: CMake can not determine linker language for target: bar") because the generator expression "$<TARGET_OBJECTS:foo>" does not get expanded and thus the final link line is empty.

Not querying for the LOCATION property fixes this.
This bug is not present in CMake 3.0.* or 2.8.*.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0037663)
Stephen Kelly (developer)
2015-01-11 13:17

I bisected this to commit v3.1.0-rc1~297^2~5 (cmTarget: Drop 'head' argument from GetSourceFiles, 2014-07-10), but I don't have a fix yet.

The relevant difference before and after that patch is the value of the this->LinkImplementationLanguageIsContextDependent in cmTarget::GetSourceFiles.
(0037674)
Stephen Kelly (developer)
2015-01-12 20:09

Fixed with

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=990175e4 [^]
 cmTarget: Compute link language of OBJECT_TARGETS with CMP0026 OLD (0015338)
(0037679)
Brad King (manager)
2015-01-13 16:07

Revised commit:

 cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23f3798c [^]
(0038836)
Robert Maynard (manager)
2015-06-01 08:38

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

 Issue History
Date Modified Username Field Change
2015-01-06 10:23 Matthias Maier New Issue
2015-01-08 12:42 Brad King Assigned To => Stephen Kelly
2015-01-08 12:42 Brad King Status new => assigned
2015-01-11 13:17 Stephen Kelly Note Added: 0037663
2015-01-12 20:09 Stephen Kelly Note Added: 0037674
2015-01-12 20:09 Stephen Kelly Status assigned => resolved
2015-01-12 20:09 Stephen Kelly Fixed in Version => CMake 3.1.1
2015-01-12 20:09 Stephen Kelly Resolution open => fixed
2015-01-13 16:07 Brad King Note Added: 0037679
2015-01-13 16:07 Brad King Target Version => CMake 3.1.1
2015-06-01 08:38 Robert Maynard Note Added: 0038836
2015-06-01 08:38 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team