View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0013211 | CMake | CMake | public | 2012-05-10 21:36 | 2012-10-01 13:22 | ||||
Reporter | thanil | ||||||||
Assigned To | |||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | Apple Mac | OS | Mac OS X | OS Version | 10.7.3 | ||||
Product Version | CMake 2.8.8 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0013211: CMake should not link shared libraries recursively | ||||||||
Description | If target A depends on a shared library B and B depends on a shared library C, then CMake will create linker directives to link A to both B and C, when it should only link A to B. This creates unnecessary dependencies in the case of shared libraries. | ||||||||
Steps To Reproduce | Attached file contains example CMake project with an executable A and two shared libraries B and C. Once cmake has been run from directory xxx xxx/CMakeFiles/a.dir/link.txt contains the following line: /usr/bin/gcc -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/a.dir/a.c.o -o a b/liblibb.dylib b/c/liblibc.dylib which shows that A will be linked to C when there is no reason to do so since these are shared libraries. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | cmake_link_bug.tar.gz [^] (1,399 bytes) 2012-05-10 21:36 | ||||||||
Relationships | |
Relationships |
Notes | |
(0029466) Mathieu Malaterre (developer) 2012-05-11 02:42 |
When all else failed, read the instructions: $ cmake --help-property LINK_INTERFACE_LIBRARIES cmake version 2.8.7 LINK_INTERFACE_LIBRARIES List public interface libraries for a shared library or executable. By default linking to a shared library target transitively links to targets with which the library itself was linked. For an executable with exports (see the ENABLE_EXPORTS property) no default transitive link dependencies are used. This property replaces the default transitive link dependencies with an explicit list. When the target is linked into another target the libraries listed (and recursively their link interface libraries) will be provided to the other target also. If the list is empty then no transitive link dependencies will be incorporated when this target is linked into another target even if the default set is non-empty. This property is initialized by the value of the variable CMAKE_LINK_INTERFACE_LIBRARIES if it is set when a target is created. This property is ignored for STATIC libraries. |
(0031126) David Cole (manager) 2012-10-01 13:22 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2012-05-10 21:36 | thanil | New Issue | |
2012-05-10 21:36 | thanil | File Added: cmake_link_bug.tar.gz | |
2012-05-11 02:42 | Mathieu Malaterre | Note Added: 0029466 | |
2012-05-11 07:53 | Brad King | Status | new => resolved |
2012-05-11 07:53 | Brad King | Resolution | open => no change required |
2012-10-01 13:22 | David Cole | Note Added: 0031126 | |
2012-10-01 13:22 | David Cole | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |