View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0013876 | CMake | CMake | public | 2013-01-24 14:50 | 2013-06-03 09:05 | ||||
Reporter | Chris Harris | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | x86_64 | OS | Ubuntu | OS Version | 12.10 | ||||
Product Version | CMake 2.8.10.2 | ||||||||
Target Version | CMake 2.8.11 | Fixed in Version | CMake 2.8.11 | ||||||
Summary | 0013876: target_link_libraries does not clearly document that LINK_* signatures privatize old signatures | ||||||||
Description | Given the following CMake code: target_link_libraries(AvogadroIO AvogadroCore) target_link_libraries(AvogadroIO LINK_PRIVATE hdf5) The LINK_PRIVATE is also applied to AvogadroCore. The workaround is to add LINK_PUBLIC: target_link_libraries(AvogadroIO LINK_PUBLIC AvogadroCore) target_link_libraries(AvogadroIO LINK_PRIVATE hdf5) | ||||||||
Steps To Reproduce | The following dashboard entry demonstrates this failure: http://cdash.openchemistry.org/viewBuildError.php?buildid=5638 [^] | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0032154) Brad King (manager) 2013-01-24 15:26 |
This is expected. Any use of LINK_PRIVATE or LINK_PUBLIC means that LINK_INTERFACE_LIBRARIES will be populated. Once this happens then any libraries not in the link interface will not be public anymore. It is only for historical reasons that having no explicit link interface means that everything is public by default. |
(0032155) Brad King (manager) 2013-01-24 15:27 |
The LINK_* options are meant to allow everything in one command: target_link_libraries(AvogadroIO LINK_PUBLIC AvogadroCore LINK_PRIVATE hdf5) |
(0032156) Marcus D. Hanwell (developer) 2013-01-24 15:30 |
It would be helpful to make this clearer in the documentation (it wasn't clear to me when we read it). I didn't expect a second call to make previous libraries private, and assumed any calls made without such arguments would have maintained the previous behavior, i.e. being equivalent to calling with LINK_PUBLIC. |
(0032160) Brad King (manager) 2013-01-24 15:48 edited on: 2013-01-24 15:48 |
Multiple signatures set the link interface so it makes more sense IMO to document in the old signature that the others may make its libraries private. How about this patch?diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h index 34fe54c..3da3950 100644 --- a/Source/cmTargetLinkLibrariesCommand.h +++ b/Source/cmTargetLinkLibrariesCommand.h @@ -93,7 +93,9 @@ public: "linked to this target will appear on the link line for the other " "target too. " "See the LINK_INTERFACE_LIBRARIES target property to override the " - "set of transitive link dependencies for a target." + "set of transitive link dependencies for a target. " + "Calls to other signatures of this command may set the property " + "making any libraries linked exclusively by this signature private." "\n" " target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n" " [[debug|optimized|general] <lib>] ...)\n" |
(0032161) Marcus D. Hanwell (developer) 2013-01-24 16:22 |
I think that is better, I still feel like this is a very surprising result (a subsequent call, possibly in a function/macro, changes the behavior of existing unchanged calls). I will remember to be careful with it, I am surprised that the standard call with no arguments is not equivalent to calling with LINK_PUBLIC (which was the previous default to the best of my understanding). I guess you are saying it is equivalent to silently inserting LINK_PRIVATE once any of the new forms of target_link_libraries are called. |
(0032162) Brad King (manager) 2013-01-24 16:48 |
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f032fb90 [^] |
(0033192) Robert Maynard (manager) 2013-06-03 09:05 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2013-01-24 14:50 | Chris Harris | New Issue | |
2013-01-24 15:26 | Brad King | Note Added: 0032154 | |
2013-01-24 15:27 | Brad King | Note Added: 0032155 | |
2013-01-24 15:30 | Marcus D. Hanwell | Note Added: 0032156 | |
2013-01-24 15:48 | Brad King | Note Added: 0032160 | |
2013-01-24 15:48 | Brad King | Note Edited: 0032160 | |
2013-01-24 16:22 | Marcus D. Hanwell | Note Added: 0032161 | |
2013-01-24 16:48 | Brad King | Note Added: 0032162 | |
2013-01-24 16:48 | Brad King | Assigned To | => Brad King |
2013-01-24 16:48 | Brad King | Status | new => resolved |
2013-01-24 16:48 | Brad King | Resolution | open => fixed |
2013-01-24 16:48 | Brad King | Fixed in Version | => CMake 2.8.11 |
2013-01-24 16:48 | Brad King | Target Version | => CMake 2.8.11 |
2013-01-24 16:48 | Brad King | Summary | Use of LINK_PRIVATE in target_link_libraries(...) cause all libaries to be linked private => target_link_libraries does not clearly document that LINK_* signatures privatize old signatures |
2013-06-03 09:05 | Robert Maynard | Note Added: 0033192 | |
2013-06-03 09:05 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |