summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_link_libraries/SharedDepNotTarget.cmake10
3 files changed, 12 insertions, 1 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index c16472e..32f5d68 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -760,7 +760,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
return;
}
- cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(tgt);
+ cmGeneratorTarget *gtgt = 0;
// Get a full path to the dependent shared library.
// Add it to the runtime path computation so that the target being
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)