add_library(): Allow imported object libraries with multi-arch

Fixes: #21276
This commit is contained in:
Craig Scott
2021-02-04 20:30:49 +11:00
parent 1a915e8953
commit 4d46b1401f
13 changed files with 158 additions and 21 deletions

View File

@@ -238,16 +238,6 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
status.SetError("called with IMPORTED argument but no library type.");
return false;
}
if (type == cmStateEnums::OBJECT_LIBRARY) {
std::string reason;
if (!mf.GetGlobalGenerator()->HasKnownObjectFileLocation(&reason)) {
mf.IssueMessage(
MessageType::FATAL_ERROR,
"The OBJECT library type may not be used for IMPORTED libraries" +
reason + ".");
return true;
}
}
if (type == cmStateEnums::INTERFACE_LIBRARY) {
if (!cmGeneratorExpression::IsValidTargetName(libName)) {
status.SetError(cmStrCat(