mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
add_library/add_executable: allow local alias to imported targets
Fixes: #20641
This commit is contained in:
@@ -219,14 +219,9 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
|
||||
"\" is not a library."));
|
||||
return false;
|
||||
}
|
||||
if (aliasedTarget->IsImported() &&
|
||||
!aliasedTarget->IsImportedGloballyVisible()) {
|
||||
status.SetError(cmStrCat("cannot create ALIAS target \"", libName,
|
||||
"\" because target \"", aliasedName,
|
||||
"\" is imported but not globally visible."));
|
||||
return false;
|
||||
}
|
||||
mf.AddAlias(libName, aliasedName);
|
||||
mf.AddAlias(libName, aliasedName,
|
||||
!aliasedTarget->IsImported() ||
|
||||
aliasedTarget->IsImportedGloballyVisible());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user