From 584510569f3b66057a6dd123f1cd4c010341c38d Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Sun, 19 May 2013 12:07:54 +0300 Subject: [PATCH] Imported Upstream version 2.8.11 --- ChangeLog.manual | 14 +++++ Source/CMakeVersion.cmake | 2 +- Source/cmTarget.cxx | 68 ++++++++++++++++++++----- Source/cmTarget.h | 1 - Source/cmTargetLinkLibrariesCommand.cxx | 8 --- Source/cmTargetLinkLibrariesCommand.h | 19 ++++--- 6 files changed, 80 insertions(+), 32 deletions(-) diff --git a/ChangeLog.manual b/ChangeLog.manual index 2a44133e0..a0da0d578 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,17 @@ +Changes in CMake 2.8.11 (since 2.8.11-rc4) +---------------------------------------- +None + +Changes in CMake 2.8.11-rc4 (since 2.8.11-rc3) +---------------------------------------------- +Brad King (1): + target_link_libraries: Update usage requirements documentation + +Stephen Kelly (3): + Centralize maintenance of usage requirement include directories + Fix include dir propagation from conditionally linked targets + Memoize usage requirement include directories in a config-specific map + Changes in CMake 2.8.11-rc3 (since 2.8.11-rc2) ---------------------------------------------- Brad King (1): diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ce99a2c7d..f2792d620 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -3,4 +3,4 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) set(CMake_VERSION_TWEAK 0) -set(CMake_VERSION_RC 3) +#set(CMake_VERSION_RC 0) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 66c22b16e..d14bfcaf6 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -142,7 +142,7 @@ public: std::vector IncludeDirectoriesEntries; std::vector LinkInterfaceIncludeDirectoriesEntries; - std::vector + std::map > CachedLinkInterfaceIncludeDirectoriesEntries; std::map CachedLinkInterfaceCompileDefinitions; @@ -164,6 +164,19 @@ void deleteAndClear( entries.clear(); } +//---------------------------------------------------------------------------- +void deleteAndClear( + std::map > &entries) +{ + for (std::map >::iterator + it = entries.begin(), end = entries.end(); it != end; ++it) + { + deleteAndClear(it->second); + } +} + //---------------------------------------------------------------------------- cmTargetInternals::~cmTargetInternals() { @@ -2706,6 +2719,19 @@ void cmTarget::SetProperty(const char* prop, const char* value) new cmTargetInternals::IncludeDirectoriesEntry(cge)); return; } + if (strcmp(prop, "LINK_LIBRARIES") == 0) + { + this->Internal->LinkInterfaceIncludeDirectoriesEntries.clear(); + if (cmGeneratorExpression::IsValidTargetName(value) + || cmGeneratorExpression::Find(value) != std::string::npos) + { + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmValueWithOrigin entry(value, lfbt); + this->Internal->LinkInterfaceIncludeDirectoriesEntries.push_back(entry); + } + // Fall through + } this->Properties.SetProperty(prop, value, cmProperty::TARGET); this->MaybeInvalidatePropertyCache(prop); } @@ -2727,6 +2753,18 @@ void cmTarget::AppendProperty(const char* prop, const char* value, new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(value))); return; } + if (strcmp(prop, "LINK_LIBRARIES") == 0) + { + if (cmGeneratorExpression::IsValidTargetName(value) + || cmGeneratorExpression::Find(value) != std::string::npos) + { + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmValueWithOrigin entry(value, lfbt); + this->Internal->LinkInterfaceIncludeDirectoriesEntries.push_back(entry); + } + // Fall through + } this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString); this->MaybeInvalidatePropertyCache(prop); } @@ -2762,12 +2800,6 @@ void cmTarget::AppendBuildInterfaceIncludes() } } -//---------------------------------------------------------------------------- -void cmTarget::AppendTllInclude(const cmValueWithOrigin &entry) -{ - this->Internal->LinkInterfaceIncludeDirectoriesEntries.push_back(entry); -} - //---------------------------------------------------------------------------- void cmTarget::InsertInclude(const cmValueWithOrigin &entry, bool before) @@ -2939,25 +2971,33 @@ std::vector cmTarget::GetIncludeDirectories(const char *config) ge.Parse(it->Value); std::string result = cge->Evaluate(this->Makefile, config, false, this, 0, 0); - if (!cmGeneratorExpression::IsValidTargetName(result.c_str()) - || !this->Makefile->FindTargetToUse(result.c_str())) + if (!this->Makefile->FindTargetToUse(result.c_str())) { continue; } } + std::string includeGenex = "$Value + ",INTERFACE_INCLUDE_DIRECTORIES>"; + if (cmGeneratorExpression::Find(it->Value) != std::string::npos) + { + // Because it->Value is a generator expression, ensure that it + // evaluates to the non-empty string before being used in the + // TARGET_PROPERTY expression. + includeGenex = "$<$Value + ">:" + includeGenex + ">"; + } cmGeneratorExpression ge(it->Backtrace); cmsys::auto_ptr cge = ge.Parse( - "$Value + ",INTERFACE_INCLUDE_DIRECTORIES>"); + includeGenex); - this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries.push_back( + this->Internal + ->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back( new cmTargetInternals::IncludeDirectoriesEntry(cge, it->Value)); } } processIncludeDirectories(this, - this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries, + this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[configString], includes, uniqueIncludes, &dagChecker, @@ -2967,7 +3007,7 @@ std::vector cmTarget::GetIncludeDirectories(const char *config) if (!this->Makefile->IsGeneratingBuildSystem()) { deleteAndClear( - this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries); + this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries); } else { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index e25133e58..9d467961b 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -495,7 +495,6 @@ public: std::vector GetIncludeDirectories(const char *config); void InsertInclude(const cmValueWithOrigin &entry, bool before = false); - void AppendTllInclude(const cmValueWithOrigin &entry); void AppendBuildInterfaceIncludes(); diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 3f652c93c..b7b7691c8 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -259,14 +259,6 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, // Handle normal case first. if(this->CurrentProcessingState != ProcessingLinkInterface) { - { - cmListFileBacktrace lfbt; - this->Makefile->GetBacktrace(lfbt); - cmValueWithOrigin entry(this->Target->GetDebugGeneratorExpressions(lib, - llt), - lfbt); - this->Target->AppendTllInclude(entry); - } this->Makefile ->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt); if (this->CurrentProcessingState != ProcessingPublicInterface) diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h index aaabdfa3a..c683016dd 100644 --- a/Source/cmTargetLinkLibrariesCommand.h +++ b/Source/cmTargetLinkLibrariesCommand.h @@ -97,14 +97,17 @@ public: "Calls to other signatures of this command may set the property " "making any libraries linked exclusively by this signature private." "\n" - "Target usage requirements are also consumed by this command. If the " - " is linked to another target which has " - "a populated INTERFACE_INCLUDE_DIRECTORIES, the content of it is " - "appended to the INCLUDE_DIRECTORIES of . Similarly, the " - "INTERFACE_COMPILE_DEFINITONS of a dependee are added to the " - "COMPILE_DEFINITONS of , and the " - "INTERFACE_POSITION_INDEPENDENT_CODE property is used to determine the " - "POSITION_INDEPENDENT_CODE property of ." + "CMake will also propagate \"usage requirements\" from linked library " + "targets. " + "Usage requirements affect compilation of sources in the . " + "They are specified by properties defined on linked targets. " + "During generation of the build system, CMake integrates " + "usage requirement property values with the corresponding " + "build properties for :\n" + " INTERFACE_COMPILE_DEFINITONS: Appends to COMPILE_DEFINITONS\n" + " INTERFACE_INCLUDE_DIRECTORIES: Appends to INCLUDE_DIRECTORIES\n" + " INTERFACE_POSITION_INDEPENDENT_CODE: Sets POSITION_INDEPENDENT_CODE\n" + " or checked for consistency with existing value\n" "\n" " target_link_libraries( LINK_INTERFACE_LIBRARIES\n" " [[debug|optimized|general] ] ...)\n"