diff options
author | Brad King <brad.king@kitware.com> | 2015-07-27 13:31:14 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-07-27 13:31:14 (GMT) |
commit | 91a159245fc5978c20245b60360e55e204f468a4 (patch) | |
tree | a4b76ae7ecd99b881f6cb1f933a007f7eb1d09c1 /Source/cmTarget.cxx | |
parent | 317df61fc817d4013baf225242be905e434ff2f5 (diff) | |
parent | 8d336875b3cea99e5c458d3e299d8caf8bc84b75 (diff) | |
download | CMake-91a159245fc5978c20245b60360e55e204f468a4.zip CMake-91a159245fc5978c20245b60360e55e204f468a4.tar.gz CMake-91a159245fc5978c20245b60360e55e204f468a4.tar.bz2 |
Merge topic 'cmRange-API'
8d336875 cmMakefile: Use Ranges for buildsystem property access.
514a1dff cmAlgorithms: Add some convenient typedefs.
c7b39d06 cmMakefile: Split accessors for include directories and origins.
b2de25ad cmMakefile: Split accessors for compile options and origins.
d6239507 cmMakefile: Split accessors for compile definitions and origins.
ef17bbef cmMakefile: Separate storage of buildsystem properties and their origins.
a89c02ce cmMakefile: Out of line some API.
b19587e7 cmMakefile: Remove some references from APIs.
1fe71e2e cmAlgorithms: Move Range type out of private namespace.
8ea0b81d cmAlgorithms: Rename cmRange to cmMakeRange.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 3d8adae..8520e29 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -402,13 +402,17 @@ void cmTarget::SetMakefile(cmMakefile* mf) { // Initialize the INCLUDE_DIRECTORIES property based on the current value // of the same directory property: - const std::vector<cmValueWithOrigin> parentIncludes = - this->Makefile->GetIncludeDirectoriesEntries(); + const cmStringRange parentIncludes = + this->Makefile->GetIncludeDirectoriesEntries(); + const cmBacktraceRange parentIncludesBts = + this->Makefile->GetIncludeDirectoriesBacktraces(); - for (std::vector<cmValueWithOrigin>::const_iterator it - = parentIncludes.begin(); it != parentIncludes.end(); ++it) + cmBacktraceRange::const_iterator btIt = parentIncludesBts.begin(); + for (cmStringRange::const_iterator it + = parentIncludes.begin(); + it != parentIncludes.end(); ++it, ++btIt) { - this->InsertInclude(*it); + this->InsertInclude(*it, *btIt); } const std::set<std::string> parentSystemIncludes = this->Makefile->GetSystemIncludeDirectories(); @@ -416,13 +420,17 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->SystemIncludeDirectories.insert(parentSystemIncludes.begin(), parentSystemIncludes.end()); - const std::vector<cmValueWithOrigin> parentOptions = + const cmStringRange parentOptions = this->Makefile->GetCompileOptionsEntries(); + const cmBacktraceRange parentOptionsBts = + this->Makefile->GetCompileOptionsBacktraces(); - for (std::vector<cmValueWithOrigin>::const_iterator it - = parentOptions.begin(); it != parentOptions.end(); ++it) + btIt = parentOptionsBts.begin(); + for (cmStringRange::const_iterator it + = parentOptions.begin(); + it != parentOptions.end(); ++it, ++btIt) { - this->InsertCompileOption(*it); + this->InsertCompileOption(*it, *btIt); } } @@ -1926,40 +1934,43 @@ void cmTarget::AppendBuildInterfaceIncludes() } //---------------------------------------------------------------------------- -void cmTarget::InsertInclude(const cmValueWithOrigin &entry, - bool before) +void cmTarget::InsertInclude(std::string const& entry, + cmListFileBacktrace const& bt, + bool before) { - cmGeneratorExpression ge(entry.Backtrace); + cmGeneratorExpression ge(bt); std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position = before ? this->Internal->IncludeDirectoriesEntries.begin() : this->Internal->IncludeDirectoriesEntries.end(); this->Internal->IncludeDirectoriesEntries.insert(position, - new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value))); + new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry))); } //---------------------------------------------------------------------------- -void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry, - bool before) +void cmTarget::InsertCompileOption(std::string const& entry, + cmListFileBacktrace const& bt, + bool before) { - cmGeneratorExpression ge(entry.Backtrace); + cmGeneratorExpression ge(bt); std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position = before ? this->Internal->CompileOptionsEntries.begin() : this->Internal->CompileOptionsEntries.end(); this->Internal->CompileOptionsEntries.insert(position, - new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value))); + new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry))); } //---------------------------------------------------------------------------- -void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry) +void cmTarget::InsertCompileDefinition(std::string const& entry, + cmListFileBacktrace const& bt) { - cmGeneratorExpression ge(entry.Backtrace); + cmGeneratorExpression ge(bt); this->Internal->CompileDefinitionsEntries.push_back( - new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value))); + new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry))); } //---------------------------------------------------------------------------- @@ -6686,7 +6697,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, } std::sort(props.begin(), props.end()); - std::string propsString = cmJoin(cmRange(props).retreat(1), ", "); + std::string propsString = cmJoin(cmMakeRange(props).retreat(1), ", "); propsString += " and the " + props.back(); std::ostringstream e; |