From 6d85a6a64c6919c07d983b584bb74f6a29cddac5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 7 Feb 2014 15:31:57 +0100 Subject: add_library: Issue better diagnostic for INTERFACE GLOBAL signature. --- Source/cmAddLibraryCommand.cxx | 7 +++++++ Tests/RunCMake/interface_library/invalid_signature-stderr.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index a29f784..009b1ca 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -173,6 +173,13 @@ bool cmAddLibraryCommand ++s; 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 { break; diff --git a/Tests/RunCMake/interface_library/invalid_signature-stderr.txt b/Tests/RunCMake/interface_library/invalid_signature-stderr.txt index 701586a..6374b33 100644 --- a/Tests/RunCMake/interface_library/invalid_signature-stderr.txt +++ b/Tests/RunCMake/interface_library/invalid_signature-stderr.txt @@ -84,6 +84,6 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + 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\): CMakeLists.txt:3 \(include\) -- cgit v0.12