add_library: Issue better diagnostic for INTERFACE GLOBAL signature.

This commit is contained in:
Stephen Kelly 2014-02-07 15:31:57 +01:00
parent 770245e928
commit 6d85a6a64c
2 changed files with 8 additions and 1 deletions

View File

@ -173,6 +173,13 @@ bool cmAddLibraryCommand
++s; ++s;
importGlobal = true; importGlobal = true;
} }
else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL")
{
cmOStringStream e;
e << "GLOBAL option may only be used with IMPORTED libraries.";
this->SetError(e.str().c_str());
return false;
}
else else
{ {
break; break;

View File

@ -84,6 +84,6 @@ Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\) CMakeLists.txt:3 \(include\)
+ +
CMake Error at invalid_signature.cmake:20 \(add_library\): CMake Error at invalid_signature.cmake:20 \(add_library\):
add_library INTERFACE library requires no source arguments. add_library GLOBAL option may only be used with IMPORTED libraries.
Call Stack \(most recent call first\): Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\) CMakeLists.txt:3 \(include\)