diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 55a9d5cd2..f248c57e7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1570,23 +1570,23 @@ void cmMakefile::InitializeFromParent() // Initialize definitions with the closure of the parent scope. this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure(); - const std::vector parentIncludes = + const std::vector& parentIncludes = parent->GetIncludeDirectoriesEntries(); this->IncludeDirectoriesEntries.insert(this->IncludeDirectoriesEntries.end(), - parentIncludes.begin(), - parentIncludes.end()); + parentIncludes.begin(), + parentIncludes.end()); - const std::vector parentOptions = + const std::vector& parentOptions = parent->GetCompileOptionsEntries(); this->CompileOptionsEntries.insert(this->CompileOptionsEntries.end(), parentOptions.begin(), parentOptions.end()); - const std::vector parentDefines = + const std::vector& parentDefines = parent->GetCompileDefinitionsEntries(); this->CompileDefinitionsEntries.insert(this->CompileDefinitionsEntries.end(), - parentDefines.begin(), - parentDefines.end()); + parentDefines.begin(), + parentDefines.end()); this->SystemIncludeDirectories = parent->SystemIncludeDirectories; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 66a33bb46..45f3b9f4a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -853,15 +853,15 @@ public: /** Set whether or not to report a CMP0000 violation. */ void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; } - std::vector GetIncludeDirectoriesEntries() const + const std::vector& GetIncludeDirectoriesEntries() const { return this->IncludeDirectoriesEntries; } - std::vector GetCompileOptionsEntries() const + const std::vector& GetCompileOptionsEntries() const { return this->CompileOptionsEntries; } - std::vector GetCompileDefinitionsEntries() const + const std::vector& GetCompileDefinitionsEntries() const { return this->CompileDefinitionsEntries; }