|
@@ -49,47 +49,117 @@ bool cmAddLibraryCommand
|
|
|
std::string libType = *s;
|
|
std::string libType = *s;
|
|
|
if(libType == "STATIC")
|
|
if(libType == "STATIC")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (type == cmTarget::INTERFACE_LIBRARY)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified with conflicting STATIC type.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
++s;
|
|
++s;
|
|
|
type = cmTarget::STATIC_LIBRARY;
|
|
type = cmTarget::STATIC_LIBRARY;
|
|
|
haveSpecifiedType = true;
|
|
haveSpecifiedType = true;
|
|
|
}
|
|
}
|
|
|
else if(libType == "SHARED")
|
|
else if(libType == "SHARED")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (type == cmTarget::INTERFACE_LIBRARY)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified with conflicting SHARED type.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
++s;
|
|
++s;
|
|
|
type = cmTarget::SHARED_LIBRARY;
|
|
type = cmTarget::SHARED_LIBRARY;
|
|
|
haveSpecifiedType = true;
|
|
haveSpecifiedType = true;
|
|
|
}
|
|
}
|
|
|
else if(libType == "MODULE")
|
|
else if(libType == "MODULE")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (type == cmTarget::INTERFACE_LIBRARY)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified with conflicting MODULE type.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
++s;
|
|
++s;
|
|
|
type = cmTarget::MODULE_LIBRARY;
|
|
type = cmTarget::MODULE_LIBRARY;
|
|
|
haveSpecifiedType = true;
|
|
haveSpecifiedType = true;
|
|
|
}
|
|
}
|
|
|
else if(libType == "OBJECT")
|
|
else if(libType == "OBJECT")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (type == cmTarget::INTERFACE_LIBRARY)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified with conflicting OBJECT type.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
++s;
|
|
++s;
|
|
|
type = cmTarget::OBJECT_LIBRARY;
|
|
type = cmTarget::OBJECT_LIBRARY;
|
|
|
haveSpecifiedType = true;
|
|
haveSpecifiedType = true;
|
|
|
}
|
|
}
|
|
|
else if(libType == "UNKNOWN")
|
|
else if(libType == "UNKNOWN")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (type == cmTarget::INTERFACE_LIBRARY)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified with conflicting UNKNOWN type.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
++s;
|
|
++s;
|
|
|
type = cmTarget::UNKNOWN_LIBRARY;
|
|
type = cmTarget::UNKNOWN_LIBRARY;
|
|
|
haveSpecifiedType = true;
|
|
haveSpecifiedType = true;
|
|
|
}
|
|
}
|
|
|
else if(libType == "ALIAS")
|
|
else if(libType == "ALIAS")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (type == cmTarget::INTERFACE_LIBRARY)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified with conflicting ALIAS type.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
++s;
|
|
++s;
|
|
|
isAlias = true;
|
|
isAlias = true;
|
|
|
}
|
|
}
|
|
|
else if(libType == "INTERFACE")
|
|
else if(libType == "INTERFACE")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (haveSpecifiedType)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified with conflicting/multiple types.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isAlias)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified with conflicting ALIAS type.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (excludeFromAll)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
++s;
|
|
++s;
|
|
|
type = cmTarget::INTERFACE_LIBRARY;
|
|
type = cmTarget::INTERFACE_LIBRARY;
|
|
|
haveSpecifiedType = true;
|
|
haveSpecifiedType = true;
|
|
|
}
|
|
}
|
|
|
else if(*s == "EXCLUDE_FROM_ALL")
|
|
else if(*s == "EXCLUDE_FROM_ALL")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (type == cmTarget::INTERFACE_LIBRARY)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
++s;
|
|
++s;
|
|
|
excludeFromAll = true;
|
|
excludeFromAll = true;
|
|
|
}
|
|
}
|
|
@@ -109,6 +179,24 @@ bool cmAddLibraryCommand
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (type == cmTarget::INTERFACE_LIBRARY)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (s != args.end())
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library requires no source arguments.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (importGlobal && !importTarget)
|
|
|
|
|
+ {
|
|
|
|
|
+ cmOStringStream e;
|
|
|
|
|
+ e << "INTERFACE library specified as GLOBAL, but not as IMPORTED.";
|
|
|
|
|
+ this->SetError(e.str().c_str());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
bool nameOk = cmGeneratorExpression::IsValidTargetName(libName) &&
|
|
bool nameOk = cmGeneratorExpression::IsValidTargetName(libName) &&
|
|
|
!cmGlobalGenerator::IsReservedTarget(libName);
|
|
!cmGlobalGenerator::IsReservedTarget(libName);
|
|
|
|
|
|