diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9575affcd..c54f97240 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -273,68 +273,36 @@ void cmMakefile::IssueMessage(cmake::MessageType t, } } -template -typename Range::const_iterator find_backwards(Range const& range, T t) -{ - typename Range::const_reverse_iterator rend = - std::find(range.rbegin(), range.rend(), t); - return rend.base(); -} - -static const std::string cmPropertySentinal = std::string(); - cmStringRange cmMakefile::GetIncludeDirectoriesEntries() const { - std::vector::const_iterator it = - find_backwards(this->IncludeDirectoriesEntries, cmPropertySentinal); - return cmMakeRange(it, this->IncludeDirectoriesEntries.end()); + return this->StateSnapshot.GetDirectory().GetIncludeDirectoriesEntries(); } cmBacktraceRange cmMakefile::GetIncludeDirectoriesBacktraces() const { - std::vector::const_iterator it = - find_backwards(this->IncludeDirectoriesEntries, cmPropertySentinal); - std::vector::const_iterator btIt = - this->IncludeDirectoriesEntryBacktraces.begin() - + std::distance(this->IncludeDirectoriesEntries.begin(), it); - return cmMakeRange( - btIt, this->IncludeDirectoriesEntryBacktraces.end()); + return this->StateSnapshot.GetDirectory() + .GetIncludeDirectoriesEntryBacktraces(); } cmStringRange cmMakefile::GetCompileOptionsEntries() const { - std::vector::const_iterator it = - find_backwards(this->CompileOptionsEntries, cmPropertySentinal); - return cmMakeRange(it, this->CompileOptionsEntries.end()); + return this->StateSnapshot.GetDirectory().GetCompileOptionsEntries(); } cmBacktraceRange cmMakefile::GetCompileOptionsBacktraces() const { - std::vector::const_iterator it = - find_backwards(this->CompileOptionsEntries, cmPropertySentinal); - std::vector::const_iterator btIt = - this->CompileOptionsEntryBacktraces.begin() - + std::distance(this->CompileOptionsEntries.begin(), it); - return cmMakeRange( - btIt, this->CompileOptionsEntryBacktraces.end()); + return this->StateSnapshot.GetDirectory().GetCompileOptionsEntryBacktraces(); } cmStringRange cmMakefile::GetCompileDefinitionsEntries() const { - std::vector::const_iterator it = - find_backwards(this->CompileDefinitionsEntries, cmPropertySentinal); - return cmMakeRange(it, this->CompileDefinitionsEntries.end()); + return this->StateSnapshot.GetDirectory().GetCompileDefinitionsEntries(); } cmBacktraceRange cmMakefile::GetCompileDefinitionsBacktraces() const { - std::vector::const_iterator btIt = - this->CompileDefinitionsEntryBacktraces.begin(); - std::vector::const_iterator it = - find_backwards(this->CompileDefinitionsEntries, cmPropertySentinal) - + std::distance(this->CompileDefinitionsEntries.begin(), it); - return cmMakeRange( - btIt, this->CompileDefinitionsEntryBacktraces.end()); + return this->StateSnapshot.GetDirectory() + .GetCompileDefinitionsEntryBacktraces(); } //---------------------------------------------------------------------------- @@ -1591,62 +1559,7 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent) this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", this->GetCurrentBinaryDirectory()); - { - std::vector::const_iterator it = - find_backwards(parent->IncludeDirectoriesEntries, cmPropertySentinal); - std::vector::const_iterator begin = - parent->IncludeDirectoriesEntries.begin(); - std::vector::const_iterator end = - parent->IncludeDirectoriesEntries.end(); - this->IncludeDirectoriesEntries.insert( - this->IncludeDirectoriesEntries.end(), it, end); - - std::vector::const_iterator btIt = - parent->IncludeDirectoriesEntryBacktraces.begin() - + std::distance(begin, it); - std::vector::const_iterator btEnd = - parent->IncludeDirectoriesEntryBacktraces.end(); - this->IncludeDirectoriesEntryBacktraces.insert( - this->IncludeDirectoriesEntryBacktraces.end(), btIt, btEnd); - } - - { - std::vector::const_iterator it = - find_backwards(parent->CompileOptionsEntries, cmPropertySentinal); - std::vector::const_iterator begin = - parent->CompileOptionsEntries.begin(); - std::vector::const_iterator end = - parent->CompileOptionsEntries.end(); - this->CompileOptionsEntries.insert( - this->CompileOptionsEntries.end(), it, end); - - std::vector::const_iterator btIt = - parent->CompileOptionsEntryBacktraces.begin() - + std::distance(begin, it); - std::vector::const_iterator btEnd = - parent->CompileOptionsEntryBacktraces.end(); - this->CompileOptionsEntryBacktraces.insert( - this->CompileOptionsEntryBacktraces.end(), btIt, btEnd); - } - - { - std::vector::const_iterator it = - find_backwards(parent->CompileDefinitionsEntries, cmPropertySentinal); - std::vector::const_iterator begin = - parent->CompileDefinitionsEntries.begin(); - std::vector::const_iterator end = - parent->CompileDefinitionsEntries.end(); - this->CompileDefinitionsEntries.insert( - this->CompileDefinitionsEntries.end(), it, end); - - std::vector::const_iterator btIt = - parent->CompileDefinitionsEntryBacktraces.begin() - + std::distance(begin, it); - std::vector::const_iterator btEnd = - parent->CompileDefinitionsEntryBacktraces.end(); - this->CompileDefinitionsEntryBacktraces.insert( - this->CompileDefinitionsEntryBacktraces.end(), btIt, btEnd); - } + this->StateSnapshot.InitializeFromParent(); this->SystemIncludeDirectories = parent->SystemIncludeDirectories; @@ -1990,17 +1903,18 @@ void cmMakefile::AddIncludeDirectories(const std::vector &incs, return; } - std::vector::iterator position = - before ? this->IncludeDirectoriesEntries.begin() - : this->IncludeDirectoriesEntries.end(); - std::vector::iterator btPos = - this->IncludeDirectoriesEntryBacktraces.begin() - + std::distance(this->IncludeDirectoriesEntries.begin(), position); - cmListFileBacktrace lfbt = this->GetBacktrace(); std::string entryString = cmJoin(incs, ";"); - this->IncludeDirectoriesEntries.insert(position, entryString); - this->IncludeDirectoriesEntryBacktraces.insert(btPos, lfbt); + if (before) + { + this->StateSnapshot.GetDirectory() + .PrependIncludeDirectoriesEntry(entryString, lfbt); + } + else + { + this->StateSnapshot.GetDirectory() + .AppendIncludeDirectoriesEntry(entryString, lfbt); + } // Property on each target: for (cmTargets::iterator l = this->Targets.begin(); @@ -4226,41 +4140,35 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value) { if (prop == "INCLUDE_DIRECTORIES") { - this->IncludeDirectoriesEntries.push_back(cmPropertySentinal); - this->IncludeDirectoriesEntryBacktraces.push_back(cmListFileBacktrace()); if (!value) { + this->StateSnapshot.GetDirectory().ClearIncludeDirectories(); return; } cmListFileBacktrace lfbt = this->GetBacktrace(); - this->IncludeDirectoriesEntries.push_back(value); - this->IncludeDirectoriesEntryBacktraces.push_back(lfbt); + this->StateSnapshot.GetDirectory().SetIncludeDirectories(value, lfbt); return; } if (prop == "COMPILE_OPTIONS") { - this->CompileOptionsEntries.push_back(cmPropertySentinal); - this->CompileDefinitionsEntryBacktraces.push_back(cmListFileBacktrace()); if (!value) { + this->StateSnapshot.GetDirectory().ClearCompileOptions(); return; } cmListFileBacktrace lfbt = this->GetBacktrace(); - this->CompileOptionsEntries.push_back(value); - this->CompileOptionsEntryBacktraces.push_back(lfbt); + this->StateSnapshot.GetDirectory().SetCompileOptions(value, lfbt); return; } if (prop == "COMPILE_DEFINITIONS") { - this->CompileDefinitionsEntries.push_back(cmPropertySentinal); - this->CompileDefinitionsEntryBacktraces.push_back(cmListFileBacktrace()); if (!value) { + this->StateSnapshot.GetDirectory().ClearCompileDefinitions(); return; } cmListFileBacktrace lfbt = this->GetBacktrace(); - this->CompileDefinitionsEntries.push_back(value); - this->CompileDefinitionsEntryBacktraces.push_back(lfbt); + this->StateSnapshot.GetDirectory().SetCompileDefinitions(value, lfbt); return; } @@ -4274,22 +4182,21 @@ void cmMakefile::AppendProperty(const std::string& prop, if (prop == "INCLUDE_DIRECTORIES") { cmListFileBacktrace lfbt = this->GetBacktrace(); - this->IncludeDirectoriesEntries.push_back(value); - this->IncludeDirectoriesEntryBacktraces.push_back(lfbt); + this->StateSnapshot.GetDirectory().AppendIncludeDirectoriesEntry(value, + lfbt); return; } if (prop == "COMPILE_OPTIONS") { cmListFileBacktrace lfbt = this->GetBacktrace(); - this->CompileOptionsEntries.push_back(value); - this->CompileOptionsEntryBacktraces.push_back(lfbt); + this->StateSnapshot.GetDirectory().AppendCompileOptionsEntry(value, lfbt); return; } if (prop == "COMPILE_DEFINITIONS") { cmListFileBacktrace lfbt = this->GetBacktrace(); - this->CompileDefinitionsEntries.push_back(value); - this->CompileDefinitionsEntryBacktraces.push_back(lfbt); + this->StateSnapshot.GetDirectory().AppendCompileDefinitionsEntry(value, + lfbt); return; } @@ -4344,25 +4251,20 @@ const char *cmMakefile::GetProperty(const std::string& prop, } else if (prop == "INCLUDE_DIRECTORIES") { - std::vector::const_iterator it = - find_backwards(this->IncludeDirectoriesEntries, cmPropertySentinal); - output = cmJoin(cmMakeRange(it, this->IncludeDirectoriesEntries.end()), - ";"); + output = cmJoin(this->StateSnapshot.GetDirectory() + .GetIncludeDirectoriesEntries(), ";"); return output.c_str(); } else if (prop == "COMPILE_OPTIONS") { - std::vector::const_iterator it = - find_backwards(this->CompileOptionsEntries, cmPropertySentinal); - output = cmJoin(cmMakeRange(it, this->CompileOptionsEntries.end()), ";"); + output = cmJoin(this->StateSnapshot.GetDirectory() + .GetCompileOptionsEntries(), ";"); return output.c_str(); } else if (prop == "COMPILE_DEFINITIONS") { - std::vector::const_iterator it = - find_backwards(this->CompileDefinitionsEntries, cmPropertySentinal); - output = cmJoin(cmMakeRange(it, this->CompileDefinitionsEntries.end()), - ";"); + output = cmJoin(this->StateSnapshot.GetDirectory() + .GetCompileDefinitionsEntries(), ";"); return output.c_str(); } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 27911a97c..c335a33cf 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -846,13 +846,6 @@ protected: std::vector HeaderFileExtensions; std::string DefineFlags; - std::vector IncludeDirectoriesEntries; - std::vector IncludeDirectoriesEntryBacktraces; - std::vector CompileOptionsEntries; - std::vector CompileOptionsEntryBacktraces; - std::vector CompileDefinitionsEntries; - std::vector CompileDefinitionsEntryBacktraces; - // Track the value of the computed DEFINITIONS property. void AddDefineFlag(const char*, std::string&); void RemoveDefineFlag(const char*, std::string::size_type, std::string&); diff --git a/Source/cmState.cxx b/Source/cmState.cxx index d73148df3..d8f8306f9 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -28,6 +28,9 @@ struct cmState::SnapshotDataType BuildSystemDirectory; std::string EntryPointCommand; long EntryPointLine; + std::vector::size_type IncludeDirectoryPosition; + std::vector::size_type CompileDefinitionsPosition; + std::vector::size_type CompileOptionsPosition; }; struct cmState::BuildsystemDirectoryStateType @@ -44,6 +47,15 @@ struct cmState::BuildsystemDirectoryStateType // safely by the build tools. std::string RelativePathTopSource; std::string RelativePathTopBinary; + + std::vector IncludeDirectories; + std::vector IncludeDirectoryBacktraces; + + std::vector CompileDefinitions; + std::vector CompileDefinitionsBacktraces; + + std::vector CompileOptions; + std::vector CompileOptionsBacktraces; }; cmState::cmState(cmake* cm) @@ -228,7 +240,16 @@ cmState::Snapshot cmState::Reset() this->GlobalProperties.clear(); this->PropertyDefinitions.clear(); - this->BuildsystemDirectory.Truncate(); + { + cmLinkedTree::iterator it = + this->BuildsystemDirectory.Truncate(); + it->IncludeDirectories.clear(); + it->IncludeDirectoryBacktraces.clear(); + it->CompileDefinitions.clear(); + it->CompileDefinitionsBacktraces.clear(); + it->CompileOptions.clear(); + it->CompileOptionsBacktraces.clear(); + } PositionType pos = this->SnapshotData.Truncate(); this->ExecutionListFiles.Truncate(); @@ -698,6 +719,9 @@ cmState::Snapshot cmState::CreateBaseSnapshot() this->BuildsystemDirectory.Extend(this->BuildsystemDirectory.Root()); pos->ExecutionListFile = this->ExecutionListFiles.Extend(this->ExecutionListFiles.Root()); + pos->IncludeDirectoryPosition = 0; + pos->CompileDefinitionsPosition = 0; + pos->CompileOptionsPosition = 0; return cmState::Snapshot(this, pos); } @@ -796,6 +820,13 @@ cmState::Snapshot cmState::Pop(cmState::Snapshot originSnapshot) PositionType pos = originSnapshot.Position; PositionType prevPos = pos; ++prevPos; + prevPos->IncludeDirectoryPosition = + prevPos->BuildSystemDirectory->IncludeDirectories.size(); + prevPos->CompileDefinitionsPosition = + prevPos->BuildSystemDirectory->CompileDefinitions.size(); + prevPos->CompileOptionsPosition = + prevPos->BuildSystemDirectory->CompileOptions.size(); + if (prevPos == this->SnapshotData.Root()) { return Snapshot(this, prevPos); @@ -949,6 +980,62 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const return snapshot; } +static const std::string cmPropertySentinal = std::string(); + +template +void InitializeContentFromParent(T& parentContent, + T& thisContent, + U& parentBacktraces, + U& thisBacktraces, + V& contentEndPosition) +{ + std::vector::const_iterator parentBegin = + parentContent.begin(); + std::vector::const_iterator parentEnd = + parentContent.end(); + + std::vector::const_reverse_iterator parentRbegin = + cmMakeReverseIterator(parentEnd); + std::vector::const_reverse_iterator parentRend = + parentContent.rend(); + parentRbegin = std::find(parentRbegin, parentRend, cmPropertySentinal); + std::vector::const_iterator parentIt = parentRbegin.base(); + + thisContent = std::vector(parentIt, parentEnd); + + std::vector::const_iterator btIt = + parentBacktraces.begin() + std::distance(parentBegin, parentIt); + std::vector::const_iterator btEnd = + parentBacktraces.end(); + + thisBacktraces = std::vector(btIt, btEnd); + + contentEndPosition = thisContent.size(); +} + +void cmState::Snapshot::InitializeFromParent() +{ + PositionType parent = this->Position->DirectoryParent; + + InitializeContentFromParent(parent->BuildSystemDirectory->IncludeDirectories, + this->Position->BuildSystemDirectory->IncludeDirectories, + parent->BuildSystemDirectory->IncludeDirectoryBacktraces, + this->Position->BuildSystemDirectory->IncludeDirectoryBacktraces, + this->Position->IncludeDirectoryPosition); + + InitializeContentFromParent(parent->BuildSystemDirectory->CompileDefinitions, + this->Position->BuildSystemDirectory->CompileDefinitions, + parent->BuildSystemDirectory->CompileDefinitionsBacktraces, + this->Position->BuildSystemDirectory->CompileDefinitionsBacktraces, + this->Position->CompileDefinitionsPosition); + + InitializeContentFromParent(parent->BuildSystemDirectory->CompileOptions, + this->Position->BuildSystemDirectory->CompileOptions, + parent->BuildSystemDirectory->CompileOptionsBacktraces, + this->Position->BuildSystemDirectory->CompileOptionsBacktraces, + this->Position->CompileOptionsPosition); +} + cmState* cmState::Snapshot::GetState() const { return this->State; @@ -966,3 +1053,220 @@ cmState::Directory::Directory( { } + +template +cmStringRange GetPropertyContent(T const& content, U contentEndPosition) +{ + std::vector::const_iterator end = + content.begin() + contentEndPosition; + + std::vector::const_reverse_iterator rbegin = + cmMakeReverseIterator(end); + rbegin = std::find(rbegin, content.rend(), cmPropertySentinal); + + return cmMakeRange(rbegin.base(), end); +} + +template +cmBacktraceRange GetPropertyBacktraces(T const& content, + U const& backtraces, + V contentEndPosition) +{ + std::vector::const_iterator entryEnd = + content.begin() + contentEndPosition; + + std::vector::const_reverse_iterator rbegin = + cmMakeReverseIterator(entryEnd); + rbegin = std::find(rbegin, content.rend(), cmPropertySentinal); + + std::vector::const_iterator it = + backtraces.begin() + std::distance(content.begin(), rbegin.base()); + + std::vector::const_iterator end = backtraces.end(); + return cmMakeRange(it, end); +} + +template +void AppendEntry(T& content, U& backtraces, V& endContentPosition, + const std::string& vec, const cmListFileBacktrace& lfbt) +{ + assert(endContentPosition == content.size()); + + content.push_back(vec); + backtraces.push_back(lfbt); + + endContentPosition = content.size(); +} + +template +void SetContent(T& content, U& backtraces, V& endContentPosition, + const std::string& vec, const cmListFileBacktrace& lfbt) +{ + assert(endContentPosition == content.size()); + + content.resize(content.size() + 2); + backtraces.resize(backtraces.size() + 2); + + content.back() = vec; + backtraces.back() = lfbt; + + endContentPosition = content.size(); +} + +template +void ClearContent(T& content, U& backtraces, V& endContentPosition) +{ + assert(endContentPosition == content.size()); + + content.resize(content.size() + 1); + backtraces.resize(backtraces.size() + 1); + + endContentPosition = content.size(); +} + +cmStringRange +cmState::Directory::GetIncludeDirectoriesEntries() const +{ + return GetPropertyContent(this->DirectoryState->IncludeDirectories, + this->Snapshot_.Position->IncludeDirectoryPosition); +} + +cmBacktraceRange +cmState::Directory::GetIncludeDirectoriesEntryBacktraces() const +{ + return GetPropertyBacktraces(this->DirectoryState->IncludeDirectories, + this->DirectoryState->IncludeDirectoryBacktraces, + this->Snapshot_.Position->IncludeDirectoryPosition); +} + +void cmState::Directory::AppendIncludeDirectoriesEntry( + const std::string& vec, const cmListFileBacktrace& lfbt) +{ + AppendEntry(this->DirectoryState->IncludeDirectories, + this->DirectoryState->IncludeDirectoryBacktraces, + this->Snapshot_.Position->IncludeDirectoryPosition, + vec, lfbt); +} + +void cmState::Directory::PrependIncludeDirectoriesEntry( + const std::string& vec, const cmListFileBacktrace& lfbt) +{ + std::vector::iterator entryEnd = + this->DirectoryState->IncludeDirectories.begin() + + this->Snapshot_.Position->IncludeDirectoryPosition; + + std::vector::const_reverse_iterator rend = + this->DirectoryState->IncludeDirectories.rend(); + std::vector::reverse_iterator rbegin = + cmMakeReverseIterator(entryEnd); + std::vector::const_reverse_iterator crbegin = rbegin; + crbegin = std::find(crbegin, rend, cmPropertySentinal); + + std::vector::const_iterator entryIt = crbegin.base(); + std::vector::const_iterator entryBegin = + this->DirectoryState->IncludeDirectories.begin(); + + std::vector::iterator btIt = + this->DirectoryState->IncludeDirectoryBacktraces.begin() + + std::distance(entryBegin, entryIt); + + this->DirectoryState->IncludeDirectories.insert(rbegin.base(), vec); + this->DirectoryState->IncludeDirectoryBacktraces.insert(btIt, lfbt); + + this->Snapshot_.Position->IncludeDirectoryPosition = + this->DirectoryState->IncludeDirectories.size(); +} + +void cmState::Directory::SetIncludeDirectories( + const std::string& vec, const cmListFileBacktrace& lfbt) +{ + SetContent(this->DirectoryState->IncludeDirectories, + this->DirectoryState->IncludeDirectoryBacktraces, + this->Snapshot_.Position->IncludeDirectoryPosition, + vec, lfbt); +} + +void cmState::Directory::ClearIncludeDirectories() +{ + ClearContent(this->DirectoryState->IncludeDirectories, + this->DirectoryState->IncludeDirectoryBacktraces, + this->Snapshot_.Position->IncludeDirectoryPosition); +} + +cmStringRange cmState::Directory::GetCompileDefinitionsEntries() const +{ + return GetPropertyContent(this->DirectoryState->CompileDefinitions, + this->Snapshot_.Position->CompileDefinitionsPosition); +} + +cmBacktraceRange +cmState::Directory::GetCompileDefinitionsEntryBacktraces() const +{ + return GetPropertyBacktraces(this->DirectoryState->CompileDefinitions, + this->DirectoryState->CompileDefinitionsBacktraces, + this->Snapshot_.Position->CompileDefinitionsPosition); +} + +void cmState::Directory::AppendCompileDefinitionsEntry(const std::string& vec, + const cmListFileBacktrace& lfbt) +{ + AppendEntry(this->DirectoryState->CompileDefinitions, + this->DirectoryState->CompileDefinitionsBacktraces, + this->Snapshot_.Position->CompileDefinitionsPosition, + vec, lfbt); +} + +void cmState::Directory::SetCompileDefinitions(const std::string& vec, + const cmListFileBacktrace& lfbt) +{ + SetContent(this->DirectoryState->CompileDefinitions, + this->DirectoryState->CompileDefinitionsBacktraces, + this->Snapshot_.Position->CompileDefinitionsPosition, + vec, lfbt); +} + +void cmState::Directory::ClearCompileDefinitions() +{ + ClearContent(this->DirectoryState->CompileDefinitions, + this->DirectoryState->CompileDefinitionsBacktraces, + this->Snapshot_.Position->CompileDefinitionsPosition); +} + +cmStringRange cmState::Directory::GetCompileOptionsEntries() const +{ + return GetPropertyContent(this->DirectoryState->CompileOptions, + this->Snapshot_.Position->CompileOptionsPosition); +} + +cmBacktraceRange cmState::Directory::GetCompileOptionsEntryBacktraces() const +{ + return GetPropertyBacktraces(this->DirectoryState->CompileOptions, + this->DirectoryState->CompileOptionsBacktraces, + this->Snapshot_.Position->CompileOptionsPosition); +} + +void +cmState::Directory::AppendCompileOptionsEntry(const std::string& vec, + const cmListFileBacktrace& lfbt) +{ + AppendEntry(this->DirectoryState->CompileOptions, + this->DirectoryState->CompileOptionsBacktraces, + this->Snapshot_.Position->CompileOptionsPosition, + vec, lfbt); +} + +void cmState::Directory::SetCompileOptions(const std::string& vec, + const cmListFileBacktrace& lfbt) +{ + SetContent(this->DirectoryState->CompileOptions, + this->DirectoryState->CompileOptionsBacktraces, + this->Snapshot_.Position->CompileOptionsPosition, + vec, lfbt); +} + +void cmState::Directory::ClearCompileOptions() +{ + ClearContent(this->DirectoryState->CompileOptions, + this->DirectoryState->CompileOptionsBacktraces, + this->Snapshot_.Position->CompileOptionsPosition); +} diff --git a/Source/cmState.h b/Source/cmState.h index 17ee6ecea..0d5300f75 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -16,6 +16,7 @@ #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" #include "cmLinkedTree.h" +#include "cmAlgorithms.h" class cmake; class cmCommand; @@ -56,6 +57,8 @@ public: Snapshot GetBuildsystemDirectoryParent() const; Snapshot GetCallStackParent() const; + void InitializeFromParent(); + cmState* GetState() const; Directory GetDirectory() const; @@ -87,6 +90,32 @@ public: void SetRelativePathTopSource(const char* dir); void SetRelativePathTopBinary(const char* dir); + cmStringRange GetIncludeDirectoriesEntries() const; + cmBacktraceRange GetIncludeDirectoriesEntryBacktraces() const; + void AppendIncludeDirectoriesEntry(std::string const& vec, + cmListFileBacktrace const& lfbt); + void PrependIncludeDirectoriesEntry(std::string const& vec, + cmListFileBacktrace const& lfbt); + void SetIncludeDirectories(std::string const& vec, + cmListFileBacktrace const& lfbt); + void ClearIncludeDirectories(); + + cmStringRange GetCompileDefinitionsEntries() const; + cmBacktraceRange GetCompileDefinitionsEntryBacktraces() const; + void AppendCompileDefinitionsEntry(std::string const& vec, + cmListFileBacktrace const& lfbt); + void SetCompileDefinitions(std::string const& vec, + cmListFileBacktrace const& lfbt); + void ClearCompileDefinitions(); + + cmStringRange GetCompileOptionsEntries() const; + cmBacktraceRange GetCompileOptionsEntryBacktraces() const; + void AppendCompileOptionsEntry(std::string const& vec, + cmListFileBacktrace const& lfbt); + void SetCompileOptions(std::string const& vec, + cmListFileBacktrace const& lfbt); + void ClearCompileOptions(); + private: void ComputeRelativePathTopSource(); void ComputeRelativePathTopBinary();