diff options
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r-- | Source/cmTargetLinkLibrariesCommand.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index c2f46a1..c289459 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -151,7 +151,8 @@ bool cmTargetLinkLibrariesCommand else if(args[i] == "LINK_PUBLIC") { if(i != 1 - && this->CurrentProcessingState != ProcessingPlainPrivateInterface) + && this->CurrentProcessingState != ProcessingPlainPrivateInterface + && this->CurrentProcessingState != ProcessingPlainPublicInterface) { this->Makefile->IssueMessage( cmake::FATAL_ERROR, @@ -181,7 +182,8 @@ bool cmTargetLinkLibrariesCommand else if(args[i] == "LINK_PRIVATE") { if(i != 1 - && this->CurrentProcessingState != ProcessingPlainPublicInterface) + && this->CurrentProcessingState != ProcessingPlainPublicInterface + && this->CurrentProcessingState != ProcessingPlainPrivateInterface) { this->Makefile->IssueMessage( cmake::FATAL_ERROR, @@ -322,6 +324,15 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt) { + if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY + && this->CurrentProcessingState != ProcessingKeywordLinkInterface) + { + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + "INTERFACE library can only be used with the INTERFACE keyword of " + "target_link_libraries"); + return false; + } + cmTarget::TLLSignature sig = (this->CurrentProcessingState == ProcessingPlainPrivateInterface || this->CurrentProcessingState == ProcessingPlainPublicInterface @@ -418,6 +429,11 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, return true; } + if (this->Target->GetType() == cmTarget::INTERFACE_LIBRARY) + { + return true; + } + // Get the list of configurations considered to be DEBUG. std::vector<std::string> const& debugConfigs = this->Makefile->GetCMakeInstance()->GetDebugConfigs(); |