| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433 |
- /*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2015 Stephen Kelly <[email protected]>
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
- ============================================================================*/
- #include "cmState.h"
- #include "cmake.h"
- #include "cmCacheManager.h"
- #include "cmCommand.h"
- #include "cmAlgorithms.h"
- #include <assert.h>
- struct cmState::SnapshotDataType
- {
- cmState::PositionType ScopeParent;
- cmState::PositionType DirectoryParent;
- cmLinkedTree<cmState::PolicyStackEntry>::iterator Policies;
- cmLinkedTree<cmState::PolicyStackEntry>::iterator PolicyRoot;
- cmLinkedTree<cmState::PolicyStackEntry>::iterator PolicyScope;
- cmState::SnapshotType SnapshotType;
- cmLinkedTree<std::string>::iterator ExecutionListFile;
- cmLinkedTree<cmState::BuildsystemDirectoryStateType>::iterator
- BuildSystemDirectory;
- std::string EntryPointCommand;
- long EntryPointLine;
- std::vector<std::string>::size_type IncludeDirectoryPosition;
- std::vector<std::string>::size_type CompileDefinitionsPosition;
- std::vector<std::string>::size_type CompileOptionsPosition;
- };
- struct cmState::PolicyStackEntry: public cmPolicies::PolicyMap
- {
- typedef cmPolicies::PolicyMap derived;
- PolicyStackEntry(bool w = false): derived(), Weak(w) {}
- PolicyStackEntry(derived const& d, bool w): derived(d), Weak(w) {}
- PolicyStackEntry(PolicyStackEntry const& r): derived(r), Weak(r.Weak) {}
- bool Weak;
- };
- struct cmState::BuildsystemDirectoryStateType
- {
- cmState::PositionType DirectoryEnd;
- std::string Location;
- std::string OutputLocation;
- std::vector<std::string> CurrentSourceDirectoryComponents;
- std::vector<std::string> CurrentBinaryDirectoryComponents;
- // The top-most directories for relative path conversion. Both the
- // source and destination location of a relative path conversion
- // must be underneath one of these directories (both under source or
- // both under binary) in order for the relative path to be evaluated
- // safely by the build tools.
- std::string RelativePathTopSource;
- std::string RelativePathTopBinary;
- std::vector<std::string> IncludeDirectories;
- std::vector<cmListFileBacktrace> IncludeDirectoryBacktraces;
- std::vector<std::string> CompileDefinitions;
- std::vector<cmListFileBacktrace> CompileDefinitionsBacktraces;
- std::vector<std::string> CompileOptions;
- std::vector<cmListFileBacktrace> CompileOptionsBacktraces;
- };
- cmState::cmState(cmake* cm)
- : CMakeInstance(cm),
- IsInTryCompile(false),
- WindowsShell(false),
- WindowsVSIDE(false),
- WatcomWMake(false),
- MinGWMake(false),
- NMake(false),
- MSYSShell(false)
- {
- }
- cmState::~cmState()
- {
- cmDeleteAll(this->Commands);
- }
- const char* cmCacheEntryTypes[] =
- { "BOOL",
- "PATH",
- "FILEPATH",
- "STRING",
- "INTERNAL",
- "STATIC",
- "UNINITIALIZED",
- 0
- };
- const char*
- cmState::CacheEntryTypeToString(cmState::CacheEntryType type)
- {
- if ( type > 6 )
- {
- return cmCacheEntryTypes[6];
- }
- return cmCacheEntryTypes[type];
- }
- cmState::CacheEntryType
- cmState::StringToCacheEntryType(const char* s)
- {
- int i = 0;
- while(cmCacheEntryTypes[i])
- {
- if(strcmp(s, cmCacheEntryTypes[i]) == 0)
- {
- return static_cast<cmState::CacheEntryType>(i);
- }
- ++i;
- }
- return STRING;
- }
- bool cmState::IsCacheEntryType(std::string const& key)
- {
- for(int i=0; cmCacheEntryTypes[i]; ++i)
- {
- if(strcmp(key.c_str(), cmCacheEntryTypes[i]) == 0)
- {
- return true;
- }
- }
- return false;
- }
- std::vector<std::string> cmState::GetCacheEntryKeys() const
- {
- std::vector<std::string> definitions;
- definitions.reserve(this->CMakeInstance->GetCacheManager()->GetSize());
- cmCacheManager::CacheIterator cit =
- this->CMakeInstance->GetCacheManager()->GetCacheIterator();
- for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() )
- {
- definitions.push_back(cit.GetName());
- }
- return definitions;
- }
- const char* cmState::GetCacheEntryValue(std::string const& key) const
- {
- cmCacheManager::CacheEntry* e = this->CMakeInstance->GetCacheManager()
- ->GetCacheEntry(key);
- if (!e)
- {
- return 0;
- }
- return e->Value.c_str();
- }
- const char*
- cmState::GetInitializedCacheValue(std::string const& key) const
- {
- return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key);
- }
- cmState::CacheEntryType
- cmState::GetCacheEntryType(std::string const& key) const
- {
- cmCacheManager::CacheIterator it =
- this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str());
- return it.GetType();
- }
- void cmState::SetCacheEntryValue(std::string const& key,
- std::string const& value)
- {
- this->CMakeInstance->GetCacheManager()->SetCacheEntryValue(key, value);
- }
- void cmState::SetCacheEntryProperty(std::string const& key,
- std::string const& propertyName,
- std::string const& value)
- {
- cmCacheManager::CacheIterator it =
- this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str());
- it.SetProperty(propertyName, value.c_str());
- }
- void cmState::SetCacheEntryBoolProperty(std::string const& key,
- std::string const& propertyName,
- bool value)
- {
- cmCacheManager::CacheIterator it =
- this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str());
- it.SetProperty(propertyName, value);
- }
- const char* cmState::GetCacheEntryProperty(std::string const& key,
- std::string const& propertyName)
- {
- cmCacheManager::CacheIterator it = this->CMakeInstance->GetCacheManager()
- ->GetCacheIterator(key.c_str());
- if (!it.PropertyExists(propertyName))
- {
- return 0;
- }
- return it.GetProperty(propertyName);
- }
- bool cmState::GetCacheEntryPropertyAsBool(std::string const& key,
- std::string const& propertyName)
- {
- return this->CMakeInstance->GetCacheManager()
- ->GetCacheIterator(key.c_str()).GetPropertyAsBool(propertyName);
- }
- void cmState::AddCacheEntry(const std::string& key, const char* value,
- const char* helpString,
- cmState::CacheEntryType type)
- {
- this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value,
- helpString, type);
- }
- void cmState::RemoveCacheEntry(std::string const& key)
- {
- this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(key);
- }
- void cmState::AppendCacheEntryProperty(const std::string& key,
- const std::string& property,
- const std::string& value,
- bool asString)
- {
- this->CMakeInstance->GetCacheManager()
- ->GetCacheIterator(key.c_str()).AppendProperty(property,
- value.c_str(),
- asString);
- }
- void cmState::RemoveCacheEntryProperty(std::string const& key,
- std::string const& propertyName)
- {
- this->CMakeInstance->GetCacheManager()
- ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0);
- }
- cmState::Snapshot cmState::Reset()
- {
- this->GlobalProperties.clear();
- this->PropertyDefinitions.clear();
- PositionType pos = this->SnapshotData.Truncate();
- this->ExecutionListFiles.Truncate();
- {
- cmLinkedTree<BuildsystemDirectoryStateType>::iterator it =
- this->BuildsystemDirectory.Truncate();
- it->IncludeDirectories.clear();
- it->IncludeDirectoryBacktraces.clear();
- it->CompileDefinitions.clear();
- it->CompileDefinitionsBacktraces.clear();
- it->CompileOptions.clear();
- it->CompileOptionsBacktraces.clear();
- it->DirectoryEnd = pos;
- }
- this->PolicyStack.Clear();
- pos->Policies = this->PolicyStack.Root();
- pos->PolicyRoot = this->PolicyStack.Root();
- pos->PolicyScope = this->PolicyStack.Root();
- assert(pos->Policies.IsValid());
- assert(pos->PolicyRoot.IsValid());
- this->DefineProperty
- ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY,
- "", "", true);
- this->DefineProperty
- ("RULE_LAUNCH_LINK", cmProperty::DIRECTORY,
- "", "", true);
- this->DefineProperty
- ("RULE_LAUNCH_CUSTOM", cmProperty::DIRECTORY,
- "", "", true);
- this->DefineProperty
- ("RULE_LAUNCH_COMPILE", cmProperty::TARGET,
- "", "", true);
- this->DefineProperty
- ("RULE_LAUNCH_LINK", cmProperty::TARGET,
- "", "", true);
- this->DefineProperty
- ("RULE_LAUNCH_CUSTOM", cmProperty::TARGET,
- "", "", true);
- return Snapshot(this, pos);
- }
- void cmState::DefineProperty(const std::string& name,
- cmProperty::ScopeType scope,
- const char *ShortDescription,
- const char *FullDescription,
- bool chained)
- {
- this->PropertyDefinitions[scope].DefineProperty(name,scope,ShortDescription,
- FullDescription,
- chained);
- }
- cmPropertyDefinition const* cmState
- ::GetPropertyDefinition(const std::string& name,
- cmProperty::ScopeType scope) const
- {
- if (this->IsPropertyDefined(name,scope))
- {
- cmPropertyDefinitionMap const& defs =
- this->PropertyDefinitions.find(scope)->second;
- return &defs.find(name)->second;
- }
- return 0;
- }
- bool cmState::IsPropertyDefined(const std::string& name,
- cmProperty::ScopeType scope) const
- {
- std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>::const_iterator it
- = this->PropertyDefinitions.find(scope);
- if (it == this->PropertyDefinitions.end())
- {
- return false;
- }
- return it->second.IsPropertyDefined(name);
- }
- bool cmState::IsPropertyChained(const std::string& name,
- cmProperty::ScopeType scope) const
- {
- std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>::const_iterator it
- = this->PropertyDefinitions.find(scope);
- if (it == this->PropertyDefinitions.end())
- {
- return false;
- }
- return it->second.IsPropertyChained(name);
- }
- void cmState::SetLanguageEnabled(std::string const& l)
- {
- std::vector<std::string>::iterator it =
- std::lower_bound(this->EnabledLanguages.begin(),
- this->EnabledLanguages.end(), l);
- if (it == this->EnabledLanguages.end() || *it != l)
- {
- this->EnabledLanguages.insert(it, l);
- }
- }
- bool cmState::GetLanguageEnabled(std::string const& l) const
- {
- return std::binary_search(this->EnabledLanguages.begin(),
- this->EnabledLanguages.end(), l);
- }
- std::vector<std::string> cmState::GetEnabledLanguages() const
- {
- return this->EnabledLanguages;
- }
- void cmState::SetEnabledLanguages(std::vector<std::string> const& langs)
- {
- this->EnabledLanguages = langs;
- }
- void cmState::ClearEnabledLanguages()
- {
- this->EnabledLanguages.clear();
- }
- bool cmState::GetIsInTryCompile() const
- {
- return this->IsInTryCompile;
- }
- void cmState::SetIsInTryCompile(bool b)
- {
- this->IsInTryCompile = b;
- }
- void cmState::RenameCommand(std::string const& oldName,
- std::string const& newName)
- {
- // if the command already exists, free the old one
- std::string sOldName = cmSystemTools::LowerCase(oldName);
- std::string sNewName = cmSystemTools::LowerCase(newName);
- std::map<std::string, cmCommand*>::iterator pos =
- this->Commands.find(sOldName);
- if ( pos == this->Commands.end() )
- {
- return;
- }
- cmCommand* cmd = pos->second;
- pos = this->Commands.find(sNewName);
- if (pos != this->Commands.end())
- {
- delete pos->second;
- this->Commands.erase(pos);
- }
- this->Commands.insert(std::make_pair(sNewName, cmd));
- pos = this->Commands.find(sOldName);
- this->Commands.erase(pos);
- }
- void cmState::AddCommand(cmCommand* command)
- {
- std::string name = cmSystemTools::LowerCase(command->GetName());
- // if the command already exists, free the old one
- std::map<std::string, cmCommand*>::iterator pos = this->Commands.find(name);
- if (pos != this->Commands.end())
- {
- delete pos->second;
- this->Commands.erase(pos);
- }
- this->Commands.insert(std::make_pair(name, command));
- }
- void cmState::RemoveUnscriptableCommands()
- {
- std::vector<std::string> unscriptableCommands;
- for (std::map<std::string, cmCommand*>::iterator
- pos = this->Commands.begin();
- pos != this->Commands.end(); )
- {
- if (!pos->second->IsScriptable())
- {
- delete pos->second;
- this->Commands.erase(pos++);
- }
- else
- {
- ++pos;
- }
- }
- }
- cmCommand* cmState::GetCommand(std::string const& name) const
- {
- cmCommand* command = 0;
- std::string sName = cmSystemTools::LowerCase(name);
- std::map<std::string, cmCommand*>::const_iterator pos =
- this->Commands.find(sName);
- if (pos != this->Commands.end())
- {
- command = (*pos).second;
- }
- return command;
- }
- std::vector<std::string> cmState::GetCommandNames() const
- {
- std::vector<std::string> commandNames;
- commandNames.reserve(this->Commands.size());
- std::map<std::string, cmCommand*>::const_iterator cmds
- = this->Commands.begin();
- for ( ; cmds != this->Commands.end(); ++ cmds )
- {
- commandNames.push_back(cmds->first);
- }
- return commandNames;
- }
- void cmState::RemoveUserDefinedCommands()
- {
- std::vector<cmCommand*> renamedCommands;
- for(std::map<std::string, cmCommand*>::iterator j = this->Commands.begin();
- j != this->Commands.end(); )
- {
- if (j->second->IsA("cmMacroHelperCommand") ||
- j->second->IsA("cmFunctionHelperCommand"))
- {
- delete j->second;
- this->Commands.erase(j++);
- }
- else if (j->first != j->second->GetName())
- {
- renamedCommands.push_back(j->second);
- this->Commands.erase(j++);
- }
- else
- {
- ++j;
- }
- }
- for (std::vector<cmCommand*>::const_iterator it = renamedCommands.begin();
- it != renamedCommands.end(); ++it)
- {
- this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it;
- }
- }
- void cmState::SetGlobalProperty(const std::string& prop, const char* value)
- {
- this->GlobalProperties.SetProperty(prop, value);
- }
- void cmState::AppendGlobalProperty(const std::string& prop,
- const char* value, bool asString)
- {
- this->GlobalProperties.AppendProperty(prop, value, asString);
- }
- const char *cmState::GetGlobalProperty(const std::string& prop)
- {
- if ( prop == "CACHE_VARIABLES" )
- {
- std::vector<std::string> cacheKeys = this->GetCacheEntryKeys();
- this->SetGlobalProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str());
- }
- else if ( prop == "COMMANDS" )
- {
- std::vector<std::string> commands = this->GetCommandNames();
- this->SetGlobalProperty("COMMANDS", cmJoin(commands, ";").c_str());
- }
- else if ( prop == "IN_TRY_COMPILE" )
- {
- this->SetGlobalProperty("IN_TRY_COMPILE",
- this->IsInTryCompile ? "1" : "0");
- }
- else if ( prop == "ENABLED_LANGUAGES" )
- {
- std::string langs;
- langs = cmJoin(this->EnabledLanguages, ";");
- this->SetGlobalProperty("ENABLED_LANGUAGES", langs.c_str());
- }
- #define STRING_LIST_ELEMENT(F) ";" #F
- if (prop == "CMAKE_C_KNOWN_FEATURES")
- {
- return FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT) + 1;
- }
- if (prop == "CMAKE_CXX_KNOWN_FEATURES")
- {
- return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1;
- }
- #undef STRING_LIST_ELEMENT
- return this->GlobalProperties.GetPropertyValue(prop);
- }
- bool cmState::GetGlobalPropertyAsBool(const std::string& prop)
- {
- return cmSystemTools::IsOn(this->GetGlobalProperty(prop));
- }
- void cmState::SetSourceDirectory(std::string const& sourceDirectory)
- {
- this->SourceDirectory = sourceDirectory;
- cmSystemTools::ConvertToUnixSlashes(this->SourceDirectory);
- cmSystemTools::SplitPath(
- cmSystemTools::CollapseFullPath(this->SourceDirectory),
- this->SourceDirectoryComponents);
- }
- const char* cmState::GetSourceDirectory() const
- {
- return this->SourceDirectory.c_str();
- }
- std::vector<std::string> const& cmState::GetSourceDirectoryComponents() const
- {
- return this->SourceDirectoryComponents;
- }
- void cmState::SetBinaryDirectory(std::string const& binaryDirectory)
- {
- this->BinaryDirectory = binaryDirectory;
- cmSystemTools::ConvertToUnixSlashes(this->BinaryDirectory);
- cmSystemTools::SplitPath(
- cmSystemTools::CollapseFullPath(this->BinaryDirectory),
- this->BinaryDirectoryComponents);
- }
- void cmState::SetWindowsShell(bool windowsShell)
- {
- this->WindowsShell = windowsShell;
- }
- bool cmState::UseWindowsShell() const
- {
- return this->WindowsShell;
- }
- void cmState::SetWindowsVSIDE(bool windowsVSIDE)
- {
- this->WindowsVSIDE = windowsVSIDE;
- }
- bool cmState::UseWindowsVSIDE() const
- {
- return this->WindowsVSIDE;
- }
- void cmState::SetWatcomWMake(bool watcomWMake)
- {
- this->WatcomWMake = watcomWMake;
- }
- bool cmState::UseWatcomWMake() const
- {
- return this->WatcomWMake;
- }
- void cmState::SetMinGWMake(bool minGWMake)
- {
- this->MinGWMake = minGWMake;
- }
- bool cmState::UseMinGWMake() const
- {
- return this->MinGWMake;
- }
- void cmState::SetNMake(bool nMake)
- {
- this->NMake = nMake;
- }
- bool cmState::UseNMake() const
- {
- return this->NMake;
- }
- void cmState::SetMSYSShell(bool mSYSShell)
- {
- this->MSYSShell = mSYSShell;
- }
- bool cmState::UseMSYSShell() const
- {
- return this->MSYSShell;
- }
- const char* cmState::GetBinaryDirectory() const
- {
- return this->BinaryDirectory.c_str();
- }
- std::vector<std::string> const& cmState::GetBinaryDirectoryComponents() const
- {
- return this->BinaryDirectoryComponents;
- }
- void cmState::Directory::ComputeRelativePathTopSource()
- {
- // Relative path conversion inside the source tree is not used to
- // construct relative paths passed to build tools so it is safe to use
- // even when the source is a network path.
- cmState::Snapshot snapshot = this->Snapshot_;
- std::vector<cmState::Snapshot> snapshots;
- snapshots.push_back(snapshot);
- while (true)
- {
- snapshot = snapshot.GetBuildsystemDirectoryParent();
- if (snapshot.IsValid())
- {
- snapshots.push_back(snapshot);
- }
- else
- {
- break;
- }
- }
- std::string result = snapshots.front().GetDirectory().GetCurrentSource();
- for (std::vector<cmState::Snapshot>::const_iterator it =
- snapshots.begin() + 1; it != snapshots.end(); ++it)
- {
- std::string currentSource = it->GetDirectory().GetCurrentSource();
- if(cmSystemTools::IsSubDirectory(result, currentSource))
- {
- result = currentSource;
- }
- }
- this->DirectoryState->RelativePathTopSource = result;
- }
- void cmState::Directory::ComputeRelativePathTopBinary()
- {
- cmState::Snapshot snapshot = this->Snapshot_;
- std::vector<cmState::Snapshot> snapshots;
- snapshots.push_back(snapshot);
- while (true)
- {
- snapshot = snapshot.GetBuildsystemDirectoryParent();
- if (snapshot.IsValid())
- {
- snapshots.push_back(snapshot);
- }
- else
- {
- break;
- }
- }
- std::string result =
- snapshots.front().GetDirectory().GetCurrentBinary();
- for (std::vector<cmState::Snapshot>::const_iterator it =
- snapshots.begin() + 1; it != snapshots.end(); ++it)
- {
- std::string currentBinary = it->GetDirectory().GetCurrentBinary();
- if(cmSystemTools::IsSubDirectory(result, currentBinary))
- {
- result = currentBinary;
- }
- }
- // The current working directory on Windows cannot be a network
- // path. Therefore relative paths cannot work when the binary tree
- // is a network path.
- if(result.size() < 2 || result.substr(0, 2) != "//")
- {
- this->DirectoryState->RelativePathTopBinary = result;
- }
- else
- {
- this->DirectoryState->RelativePathTopBinary = "";
- }
- }
- cmState::Snapshot cmState::CreateBaseSnapshot()
- {
- PositionType pos = this->SnapshotData.Extend(this->SnapshotData.Root());
- pos->DirectoryParent = this->SnapshotData.Root();
- pos->ScopeParent = this->SnapshotData.Root();
- pos->SnapshotType = BaseType;
- pos->BuildSystemDirectory =
- this->BuildsystemDirectory.Extend(this->BuildsystemDirectory.Root());
- pos->ExecutionListFile =
- this->ExecutionListFiles.Extend(this->ExecutionListFiles.Root());
- pos->IncludeDirectoryPosition = 0;
- pos->CompileDefinitionsPosition = 0;
- pos->CompileOptionsPosition = 0;
- pos->BuildSystemDirectory->DirectoryEnd = pos;
- pos->Policies = this->PolicyStack.Root();
- pos->PolicyRoot = this->PolicyStack.Root();
- pos->PolicyScope = this->PolicyStack.Root();
- assert(pos->Policies.IsValid());
- assert(pos->PolicyRoot.IsValid());
- return cmState::Snapshot(this, pos);
- }
- cmState::Snapshot
- cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot,
- std::string const& entryPointCommand,
- long entryPointLine)
- {
- assert(originSnapshot.IsValid());
- PositionType pos = this->SnapshotData.Extend(originSnapshot.Position);
- pos->EntryPointLine = entryPointLine;
- pos->EntryPointCommand = entryPointCommand;
- pos->DirectoryParent = originSnapshot.Position;
- pos->ScopeParent = originSnapshot.Position;
- pos->SnapshotType = BuildsystemDirectoryType;
- pos->BuildSystemDirectory =
- this->BuildsystemDirectory.Extend(
- originSnapshot.Position->BuildSystemDirectory);
- pos->ExecutionListFile =
- this->ExecutionListFiles.Extend(
- originSnapshot.Position->ExecutionListFile);
- pos->BuildSystemDirectory->DirectoryEnd = pos;
- pos->Policies = originSnapshot.Position->Policies;
- pos->PolicyRoot = originSnapshot.Position->Policies;
- pos->PolicyScope = originSnapshot.Position->Policies;
- assert(pos->Policies.IsValid());
- assert(pos->PolicyRoot.IsValid());
- return cmState::Snapshot(this, pos);
- }
- cmState::Snapshot
- cmState::CreateFunctionCallSnapshot(cmState::Snapshot originSnapshot,
- std::string const& entryPointCommand,
- long entryPointLine,
- std::string const& fileName)
- {
- PositionType pos = this->SnapshotData.Extend(originSnapshot.Position,
- *originSnapshot.Position);
- pos->ScopeParent = originSnapshot.Position;
- pos->EntryPointLine = entryPointLine;
- pos->EntryPointCommand = entryPointCommand;
- pos->SnapshotType = FunctionCallType;
- pos->ExecutionListFile = this->ExecutionListFiles.Extend(
- originSnapshot.Position->ExecutionListFile, fileName);
- pos->BuildSystemDirectory->DirectoryEnd = pos;
- pos->PolicyScope = originSnapshot.Position->Policies;
- return cmState::Snapshot(this, pos);
- }
- cmState::Snapshot
- cmState::CreateMacroCallSnapshot(cmState::Snapshot originSnapshot,
- std::string const& entryPointCommand,
- long entryPointLine,
- std::string const& fileName)
- {
- PositionType pos = this->SnapshotData.Extend(originSnapshot.Position,
- *originSnapshot.Position);
- pos->EntryPointLine = entryPointLine;
- pos->EntryPointCommand = entryPointCommand;
- pos->SnapshotType = MacroCallType;
- pos->ExecutionListFile = this->ExecutionListFiles.Extend(
- originSnapshot.Position->ExecutionListFile, fileName);
- pos->BuildSystemDirectory->DirectoryEnd = pos;
- pos->PolicyScope = originSnapshot.Position->Policies;
- return cmState::Snapshot(this, pos);
- }
- cmState::Snapshot
- cmState::CreateCallStackSnapshot(cmState::Snapshot originSnapshot,
- const std::string& entryPointCommand,
- long entryPointLine,
- const std::string& fileName)
- {
- PositionType pos = this->SnapshotData.Extend(originSnapshot.Position,
- *originSnapshot.Position);
- pos->EntryPointLine = entryPointLine;
- pos->EntryPointCommand = entryPointCommand;
- pos->SnapshotType = CallStackType;
- pos->ExecutionListFile = this->ExecutionListFiles.Extend(
- originSnapshot.Position->ExecutionListFile, fileName);
- pos->BuildSystemDirectory->DirectoryEnd = pos;
- pos->PolicyScope = originSnapshot.Position->Policies;
- return cmState::Snapshot(this, pos);
- }
- cmState::Snapshot
- cmState::CreateVariableScopeSnapshot(cmState::Snapshot originSnapshot,
- std::string const& entryPointCommand,
- long entryPointLine)
- {
- PositionType pos = this->SnapshotData.Extend(originSnapshot.Position,
- *originSnapshot.Position);
- pos->ScopeParent = originSnapshot.Position;
- pos->EntryPointLine = entryPointLine;
- pos->EntryPointCommand = entryPointCommand;
- pos->SnapshotType = VariableScopeType;
- return cmState::Snapshot(this, pos);
- }
- cmState::Snapshot
- cmState::CreateInlineListFileSnapshot(cmState::Snapshot originSnapshot,
- const std::string& entryPointCommand,
- long entryPointLine,
- const std::string& fileName)
- {
- PositionType pos = this->SnapshotData.Extend(originSnapshot.Position,
- *originSnapshot.Position);
- pos->EntryPointLine = entryPointLine;
- pos->EntryPointCommand = entryPointCommand;
- pos->SnapshotType = InlineListFileType;
- pos->ExecutionListFile = this->ExecutionListFiles.Extend(
- originSnapshot.Position->ExecutionListFile, fileName);
- pos->BuildSystemDirectory->DirectoryEnd = pos;
- pos->PolicyScope = originSnapshot.Position->Policies;
- return cmState::Snapshot(this, pos);
- }
- cmState::Snapshot
- cmState::CreatePolicyScopeSnapshot(cmState::Snapshot originSnapshot)
- {
- PositionType pos = this->SnapshotData.Extend(originSnapshot.Position,
- *originSnapshot.Position);
- pos->SnapshotType = PolicyScopeType;
- pos->BuildSystemDirectory->DirectoryEnd = pos;
- pos->PolicyScope = originSnapshot.Position->Policies;
- return cmState::Snapshot(this, pos);
- }
- 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();
- prevPos->BuildSystemDirectory->DirectoryEnd = prevPos;
- return Snapshot(this, prevPos);
- }
- cmState::Snapshot::Snapshot(cmState* state)
- : State(state)
- , Position()
- {
- }
- cmState::Snapshot::Snapshot(cmState* state, PositionType position)
- : State(state),
- Position(position)
- {
- }
- cmState::SnapshotType cmState::Snapshot::GetType() const
- {
- return this->Position->SnapshotType;
- }
- const char* cmState::Directory::GetCurrentSource() const
- {
- return this->DirectoryState->Location.c_str();
- }
- void cmState::Directory::SetCurrentSource(std::string const& dir)
- {
- std::string& loc = this->DirectoryState->Location;
- loc = dir;
- cmSystemTools::ConvertToUnixSlashes(loc);
- loc = cmSystemTools::CollapseFullPath(loc);
- cmSystemTools::SplitPath(
- loc,
- this->DirectoryState->CurrentSourceDirectoryComponents);
- this->ComputeRelativePathTopSource();
- }
- const char* cmState::Directory::GetCurrentBinary() const
- {
- return this->DirectoryState->OutputLocation.c_str();
- }
- void cmState::Directory::SetCurrentBinary(std::string const& dir)
- {
- std::string& loc = this->DirectoryState->OutputLocation;
- loc = dir;
- cmSystemTools::ConvertToUnixSlashes(loc);
- loc = cmSystemTools::CollapseFullPath(loc);
- cmSystemTools::SplitPath(
- loc,
- this->DirectoryState->CurrentBinaryDirectoryComponents);
- this->ComputeRelativePathTopBinary();
- }
- void cmState::Snapshot::SetListFile(const std::string& listfile)
- {
- *this->Position->ExecutionListFile = listfile;
- }
- std::vector<std::string> const&
- cmState::Directory::GetCurrentSourceComponents() const
- {
- return this->DirectoryState->CurrentSourceDirectoryComponents;
- }
- std::vector<std::string> const&
- cmState::Directory::GetCurrentBinaryComponents() const
- {
- return this->DirectoryState->CurrentBinaryDirectoryComponents;
- }
- const char* cmState::Directory::GetRelativePathTopSource() const
- {
- return this->DirectoryState->RelativePathTopSource.c_str();
- }
- const char* cmState::Directory::GetRelativePathTopBinary() const
- {
- return this->DirectoryState->RelativePathTopBinary.c_str();
- }
- void cmState::Directory::SetRelativePathTopSource(const char* dir)
- {
- this->DirectoryState->RelativePathTopSource = dir;
- }
- void cmState::Directory::SetRelativePathTopBinary(const char* dir)
- {
- this->DirectoryState->RelativePathTopBinary = dir;
- }
- std::string cmState::Snapshot::GetExecutionListFile() const
- {
- return *this->Position->ExecutionListFile;
- }
- std::string cmState::Snapshot::GetEntryPointCommand() const
- {
- return this->Position->EntryPointCommand;
- }
- long cmState::Snapshot::GetEntryPointLine() const
- {
- return this->Position->EntryPointLine;
- }
- bool cmState::Snapshot::IsValid() const
- {
- return this->State && this->Position.IsValid()
- ? this->Position != this->State->SnapshotData.Root()
- : false;
- }
- cmState::Snapshot cmState::Snapshot::GetBuildsystemDirectoryParent() const
- {
- Snapshot snapshot;
- if (!this->State || this->Position == this->State->SnapshotData.Root())
- {
- return snapshot;
- }
- PositionType parentPos = this->Position->DirectoryParent;
- if (parentPos != this->State->SnapshotData.Root())
- {
- snapshot = Snapshot(this->State, parentPos);
- }
- return snapshot;
- }
- cmState::Snapshot cmState::Snapshot::GetCallStackParent() const
- {
- assert(this->State);
- assert(this->Position != this->State->SnapshotData.Root());
- Snapshot snapshot;
- PositionType parentPos = this->Position;
- while(parentPos->SnapshotType == cmState::PolicyScopeType)
- {
- ++parentPos;
- }
- if (parentPos->SnapshotType == cmState::BuildsystemDirectoryType
- || parentPos->SnapshotType == cmState::BaseType)
- {
- return snapshot;
- }
- ++parentPos;
- while(parentPos->SnapshotType == cmState::PolicyScopeType)
- {
- ++parentPos;
- }
- if (parentPos == this->State->SnapshotData.Root())
- {
- return snapshot;
- }
- snapshot = Snapshot(this->State, parentPos);
- return snapshot;
- }
- void cmState::Snapshot::PushPolicy(cmPolicies::PolicyMap entry, bool weak)
- {
- PositionType pos = this->Position;
- pos->Policies =
- this->State->PolicyStack.Extend(pos->Policies,
- PolicyStackEntry(entry, weak));
- }
- bool cmState::Snapshot::PopPolicy()
- {
- PositionType pos = this->Position;
- if (pos->Policies == pos->PolicyScope)
- {
- return false;
- }
- ++pos->Policies;
- return true;
- }
- bool cmState::Snapshot::CanPopPolicyScope()
- {
- return this->Position->Policies == this->Position->PolicyScope;
- }
- void cmState::Snapshot::SetPolicy(cmPolicies::PolicyID id,
- cmPolicies::PolicyStatus status)
- {
- // Update the policy stack from the top to the top-most strong entry.
- bool previous_was_weak = true;
- for(cmLinkedTree<PolicyStackEntry>::iterator psi = this->Position->Policies;
- previous_was_weak && psi != this->Position->PolicyRoot; ++psi)
- {
- psi->Set(id, status);
- previous_was_weak = psi->Weak;
- }
- }
- cmPolicies::PolicyStatus
- cmState::Snapshot::GetPolicy(cmPolicies::PolicyID id) const
- {
- cmPolicies::PolicyStatus status = cmPolicies::GetPolicyStatus(id);
- if(status == cmPolicies::REQUIRED_ALWAYS ||
- status == cmPolicies::REQUIRED_IF_USED)
- {
- return status;
- }
- cmLinkedTree<BuildsystemDirectoryStateType>::iterator dir =
- this->Position->BuildSystemDirectory;
- while (true)
- {
- assert(dir.IsValid());
- cmLinkedTree<PolicyStackEntry>::iterator leaf =
- dir->DirectoryEnd->Policies;
- cmLinkedTree<PolicyStackEntry>::iterator root =
- dir->DirectoryEnd->PolicyRoot;
- for( ; leaf != root; ++leaf)
- {
- if(leaf->IsDefined(id))
- {
- status = leaf->Get(id);
- return status;
- }
- }
- cmState::PositionType e = dir->DirectoryEnd;
- cmState::PositionType p = e->DirectoryParent;
- if (p == this->State->SnapshotData.Root())
- {
- break;
- }
- dir = p->BuildSystemDirectory;
- }
- return status;
- }
- bool cmState::Snapshot::HasDefinedPolicyCMP0011()
- {
- return !this->Position->Policies->IsEmpty();
- }
- static const std::string cmPropertySentinal = std::string();
- template<typename T, typename U, typename V>
- void InitializeContentFromParent(T& parentContent,
- T& thisContent,
- U& parentBacktraces,
- U& thisBacktraces,
- V& contentEndPosition)
- {
- std::vector<std::string>::const_iterator parentBegin =
- parentContent.begin();
- std::vector<std::string>::const_iterator parentEnd =
- parentContent.end();
- std::vector<std::string>::const_reverse_iterator parentRbegin =
- cmMakeReverseIterator(parentEnd);
- std::vector<std::string>::const_reverse_iterator parentRend =
- parentContent.rend();
- parentRbegin = std::find(parentRbegin, parentRend, cmPropertySentinal);
- std::vector<std::string>::const_iterator parentIt = parentRbegin.base();
- thisContent = std::vector<std::string>(parentIt, parentEnd);
- std::vector<cmListFileBacktrace>::const_iterator btIt =
- parentBacktraces.begin() + std::distance(parentBegin, parentIt);
- std::vector<cmListFileBacktrace>::const_iterator btEnd =
- parentBacktraces.end();
- thisBacktraces = std::vector<cmListFileBacktrace>(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;
- }
- cmState::Directory cmState::Snapshot::GetDirectory() const
- {
- return Directory(this->Position->BuildSystemDirectory, *this);
- }
- cmState::Directory::Directory(
- cmLinkedTree<BuildsystemDirectoryStateType>::iterator iter,
- const cmState::Snapshot& snapshot)
- : DirectoryState(iter), Snapshot_(snapshot)
- {
- }
- template <typename T, typename U>
- cmStringRange GetPropertyContent(T const& content, U contentEndPosition)
- {
- std::vector<std::string>::const_iterator end =
- content.begin() + contentEndPosition;
- std::vector<std::string>::const_reverse_iterator rbegin =
- cmMakeReverseIterator(end);
- rbegin = std::find(rbegin, content.rend(), cmPropertySentinal);
- return cmMakeRange(rbegin.base(), end);
- }
- template <typename T, typename U, typename V>
- cmBacktraceRange GetPropertyBacktraces(T const& content,
- U const& backtraces,
- V contentEndPosition)
- {
- std::vector<std::string>::const_iterator entryEnd =
- content.begin() + contentEndPosition;
- std::vector<std::string>::const_reverse_iterator rbegin =
- cmMakeReverseIterator(entryEnd);
- rbegin = std::find(rbegin, content.rend(), cmPropertySentinal);
- std::vector<cmListFileBacktrace>::const_iterator it =
- backtraces.begin() + std::distance(content.begin(), rbegin.base());
- std::vector<cmListFileBacktrace>::const_iterator end = backtraces.end();
- return cmMakeRange(it, end);
- }
- template <typename T, typename U, typename V>
- 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 <typename T, typename U, typename V>
- 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 <typename T, typename U, typename V>
- 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<std::string>::iterator entryEnd =
- this->DirectoryState->IncludeDirectories.begin()
- + this->Snapshot_.Position->IncludeDirectoryPosition;
- std::vector<std::string>::const_reverse_iterator rend =
- this->DirectoryState->IncludeDirectories.rend();
- std::vector<std::string>::reverse_iterator rbegin =
- cmMakeReverseIterator(entryEnd);
- std::vector<std::string>::const_reverse_iterator crbegin = rbegin;
- crbegin = std::find(crbegin, rend, cmPropertySentinal);
- std::vector<std::string>::const_iterator entryIt = crbegin.base();
- std::vector<std::string>::const_iterator entryBegin =
- this->DirectoryState->IncludeDirectories.begin();
- std::vector<cmListFileBacktrace>::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);
- }
|