diff options
author | Brad King <brad.king@kitware.com> | 2015-08-13 13:56:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-08-13 14:24:10 (GMT) |
commit | 9b449e9c5d79465a807c052c6707e83a1df9efbc (patch) | |
tree | 94f3ded0b7891ab9bb2e3cc928cb876394578cfe /Tests/RunCMake/target_link_libraries | |
parent | 29886ce76482a8c857841015b58d1e91a9ee5c8e (diff) | |
download | CMake-9b449e9c5d79465a807c052c6707e83a1df9efbc.zip CMake-9b449e9c5d79465a807c052c6707e83a1df9efbc.tar.gz CMake-9b449e9c5d79465a807c052c6707e83a1df9efbc.tar.bz2 |
cmComputeLinkInformation: Lookup a target only if we have one
The change in commit 27252b24 (cmComputeLinkInformation: Simplify
generator object access, 2015-08-02) broke the conditional use of a
target introduced in commit 41abdc17 (cmGeneratorTarget: Move GetSOName
from cmTarget, 2015-08-04). Restore the conditional lookup. Add a test
case that hacks platform information variables to trigger this code
everywhere.
Diffstat (limited to 'Tests/RunCMake/target_link_libraries')
-rw-r--r-- | Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/target_link_libraries/SharedDepNotTarget.cmake | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake index 533c6a1..8307607 100644 --- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake @@ -7,3 +7,4 @@ run_cmake(CMP0023-NEW-2) run_cmake(MixedSignature) run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses) run_cmake(SubDirTarget) +run_cmake(SharedDepNotTarget) diff --git a/Tests/RunCMake/target_link_libraries/SharedDepNotTarget.cmake b/Tests/RunCMake/target_link_libraries/SharedDepNotTarget.cmake new file mode 100644 index 0000000..bab537e --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/SharedDepNotTarget.cmake @@ -0,0 +1,10 @@ +enable_language(C) +set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1) +set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") +add_library(imported SHARED IMPORTED) +set_target_properties(imported PROPERTIES + IMPORTED_LOCATION "imported" + IMPORTED_LINK_DEPENDENT_LIBRARIES "/path/to/libSharedDep.so" + ) +add_executable(empty empty.c) +target_link_libraries(empty imported) |