summaryrefslogtreecommitdiffstats
path: root/Source/cmAddExecutableCommand.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-05-28 11:51:22 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-06-02 15:11:47 (GMT)
commit056489d567b657bd1ebeae8bf78f4937f900b2e0 (patch)
treed3800c8fdf726c1e04cf73e463b68861efe6abd3 /Source/cmAddExecutableCommand.cxx
parent254f2b9058f814e952ef0178e13b3f98e8d216a1 (diff)
downloadCMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.zip
CMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.tar.gz
CMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.tar.bz2
add_library/add_executable: allow local alias to imported targets
Fixes: #20641
Diffstat (limited to 'Source/cmAddExecutableCommand.cxx')
-rw-r--r--Source/cmAddExecutableCommand.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index e738bc4..9dd8a19 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -117,14 +117,9 @@ bool cmAddExecutableCommand(std::vector<std::string> const& args,
"\" is not an executable."));
return false;
}
- if (aliasedTarget->IsImported() &&
- !aliasedTarget->IsImportedGloballyVisible()) {
- status.SetError(cmStrCat("cannot create ALIAS target \"", exename,
- "\" because target \"", aliasedName,
- "\" is imported but not globally visible."));
- return false;
- }
- mf.AddAlias(exename, aliasedName);
+ mf.AddAlias(exename, aliasedName,
+ !aliasedTarget->IsImported() ||
+ aliasedTarget->IsImportedGloballyVisible());
return true;
}