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
This commit is contained in:
Brad King 2017-09-01 14:26:01 +00:00 committed by Kitware Robot
commit b568a18997
3 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -10,3 +10,4 @@ run_cmake(SubDirTarget)
run_cmake(SharedDepNotTarget)
run_cmake(StaticPrivateDepNotExported)
run_cmake(StaticPrivateDepNotTarget)
run_cmake(UNKNOWN-IMPORTED-GLOBAL)

View File

@ -0,0 +1,4 @@
enable_language(C)
add_library(UnknownImportedGlobal UNKNOWN IMPORTED GLOBAL)
add_library(mylib empty.c)
target_link_libraries(mylib UnknownImportedGlobal)