diff options
author | Brad King <brad.king@kitware.com> | 2018-05-10 14:11:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-10 14:11:48 (GMT) |
commit | 4f0c5d3775ff4682bf6c6794d017ab278c141016 (patch) | |
tree | 100951320b12e1c34e6f875df257af23e4aabfcc /Source | |
parent | b28e093f6a1688c90462ca575efd19f52f2a2bdc (diff) | |
parent | e567d7eb639b43c2256340acdf4b0053dec0018a (diff) | |
download | CMake-4f0c5d3775ff4682bf6c6794d017ab278c141016.zip CMake-4f0c5d3775ff4682bf6c6794d017ab278c141016.tar.gz CMake-4f0c5d3775ff4682bf6c6794d017ab278c141016.tar.bz2 |
Merge branch 'restore-imported-lib-alias-diagnostic' into release-3.11
Merge-request: !2058
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmAddLibraryCommand.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 1278232..7792235 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -228,6 +228,14 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args, this->SetError(e.str()); return false; } + if (aliasedTarget->IsImported() && + !aliasedTarget->IsImportedGloballyVisible()) { + std::ostringstream e; + e << "cannot create ALIAS target \"" << libName << "\" because target \"" + << aliasedName << "\" is imported but not globally visible."; + this->SetError(e.str()); + return false; + } this->Makefile->AddAlias(libName, aliasedName); return true; } |