summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-01 14:26:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-01 14:26:08 (GMT)
commitb568a18997ebb9d54a64cf86fa6443be3dd3bf7e (patch)
treeb94f0b34c56974c3853560e06233b8419c204ad6
parentbd777178006c643bcab4bcbb1c5432f9306568ec (diff)
parenta47a853376184031051ed744ed4718a69876002d (diff)
downloadCMake-b568a18997ebb9d54a64cf86fa6443be3dd3bf7e.zip
CMake-b568a18997ebb9d54a64cf86fa6443be3dd3bf7e.tar.gz
CMake-b568a18997ebb9d54a64cf86fa6443be3dd3bf7e.tar.bz2
Merge topic 'tll-global-unknown-lib'
a47a8533 target_link_libraries: Allow linking to UNKNOWN IMPORTED GLOBAL libs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1220
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx1
-rw-r--r--Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_link_libraries/UNKNOWN-IMPORTED-GLOBAL.cmake4
3 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index bfae53c..d146640 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -366,6 +366,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (tgt && (tgt->GetType() != cmStateEnums::STATIC_LIBRARY) &&
(tgt->GetType() != cmStateEnums::SHARED_LIBRARY) &&
+ (tgt->GetType() != cmStateEnums::UNKNOWN_LIBRARY) &&
(tgt->GetType() != cmStateEnums::INTERFACE_LIBRARY) &&
!tgt->IsExecutableWithExports()) {
std::ostringstream e;
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index 1466fbf..b1c9435 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -10,3 +10,4 @@ run_cmake(SubDirTarget)
run_cmake(SharedDepNotTarget)
run_cmake(StaticPrivateDepNotExported)
run_cmake(StaticPrivateDepNotTarget)
+run_cmake(UNKNOWN-IMPORTED-GLOBAL)
diff --git a/Tests/RunCMake/target_link_libraries/UNKNOWN-IMPORTED-GLOBAL.cmake b/Tests/RunCMake/target_link_libraries/UNKNOWN-IMPORTED-GLOBAL.cmake
new file mode 100644
index 0000000..f52fa30
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/UNKNOWN-IMPORTED-GLOBAL.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+add_library(UnknownImportedGlobal UNKNOWN IMPORTED GLOBAL)
+add_library(mylib empty.c)
+target_link_libraries(mylib UnknownImportedGlobal)