summaryrefslogtreecommitdiffstats
path: root/Source/cmAddLibraryCommand.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-03-26 12:25:00 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2019-03-26 19:54:48 (GMT)
commit6d5872a3969b75686ee7d67449581ab723559bf5 (patch)
treea60baab406470a3828d54a2d07a4cb56f52374ef /Source/cmAddLibraryCommand.cxx
parent9fbad8b40be8e915f84f51842d88e97b0c949b2b (diff)
downloadCMake-6d5872a3969b75686ee7d67449581ab723559bf5.zip
CMake-6d5872a3969b75686ee7d67449581ab723559bf5.tar.gz
CMake-6d5872a3969b75686ee7d67449581ab723559bf5.tar.bz2
add_library: Now support aliasing unknown import targets
Fixes #18327
Diffstat (limited to 'Source/cmAddLibraryCommand.cxx')
-rw-r--r--Source/cmAddLibraryCommand.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 5149333..adf4464 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -222,7 +222,9 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
aliasedType != cmStateEnums::STATIC_LIBRARY &&
aliasedType != cmStateEnums::MODULE_LIBRARY &&
aliasedType != cmStateEnums::OBJECT_LIBRARY &&
- aliasedType != cmStateEnums::INTERFACE_LIBRARY) {
+ aliasedType != cmStateEnums::INTERFACE_LIBRARY &&
+ !(aliasedType == cmStateEnums::UNKNOWN_LIBRARY &&
+ aliasedTarget->IsImported())) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << libName << "\" because target \""
<< aliasedName << "\" is not a library.";