cmComputeLinkInformation: Lookup a target only if we have one
The change in commit27252b24
(cmComputeLinkInformation: Simplify generator object access, 2015-08-02) broke the conditional use of a target introduced in commit41abdc17
(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.
This commit is contained in:
parent
29886ce764
commit
9b449e9c5d
|
@ -760,7 +760,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(tgt);
|
cmGeneratorTarget *gtgt = 0;
|
||||||
|
|
||||||
// Get a full path to the dependent shared library.
|
// Get a full path to the dependent shared library.
|
||||||
// Add it to the runtime path computation so that the target being
|
// Add it to the runtime path computation so that the target being
|
||||||
|
|
|
@ -7,3 +7,4 @@ run_cmake(CMP0023-NEW-2)
|
||||||
run_cmake(MixedSignature)
|
run_cmake(MixedSignature)
|
||||||
run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses)
|
run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses)
|
||||||
run_cmake(SubDirTarget)
|
run_cmake(SubDirTarget)
|
||||||
|
run_cmake(SharedDepNotTarget)
|
||||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue