diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-11 10:16:54 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-13 18:27:36 (GMT) |
commit | 62854e9966a3fe308cff4a76c89f6bf72f76551c (patch) | |
tree | 1750b80cdf1356680f143e6902c776bf4bf8376a /Source | |
parent | db8425be18439c899c08294dde117cc137c75d23 (diff) | |
download | CMake-62854e9966a3fe308cff4a76c89f6bf72f76551c.zip CMake-62854e9966a3fe308cff4a76c89f6bf72f76551c.tar.gz CMake-62854e9966a3fe308cff4a76c89f6bf72f76551c.tar.bz2 |
cmState: Move try_compile state from cmake class.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmState.cxx | 13 | ||||
-rw-r--r-- | Source/cmState.h | 4 | ||||
-rw-r--r-- | Source/cmake.cxx | 13 |
3 files changed, 22 insertions, 8 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index c43262f..be6a766 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -15,7 +15,8 @@ #include "cmCacheManager.h" cmState::cmState(cmake* cm) - : CMakeInstance(cm) + : CMakeInstance(cm), + IsInTryCompile(false) { } @@ -263,3 +264,13 @@ void cmState::ClearEnabledLanguages() { this->EnabledLanguages.clear(); } + +bool cmState::GetIsInTryCompile() const +{ + return this->IsInTryCompile; +} + +void cmState::SetIsInTryCompile(bool b) +{ + this->IsInTryCompile = b; +} diff --git a/Source/cmState.h b/Source/cmState.h index b1f1430..6df6182 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -76,10 +76,14 @@ public: std::vector<std::string> GetEnabledLanguages() const; void ClearEnabledLanguages(); + bool GetIsInTryCompile() const; + void SetIsInTryCompile(bool b); + private: std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions; std::vector<std::string> EnabledLanguages; cmake* CMakeInstance; + bool IsInTryCompile; }; #endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 94b0ae0..0dcf9be 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -151,7 +151,6 @@ cmake::cmake() #endif this->Verbose = false; - this->InTryCompile = false; this->CacheManager = new cmCacheManager(this); this->GlobalGenerator = 0; this->ProgressCallback = 0; @@ -1272,7 +1271,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) cmSystemTools::ExpandListArgument(std::string(var), argsSplit, true); // erase the property to avoid infinite recursion this->SetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", ""); - if(this->GetIsInTryCompile()) + if(this->State->GetIsInTryCompile()) { return 0; } @@ -1555,7 +1554,7 @@ int cmake::ActualConfigure() // reset any system configuration information, except for when we are // InTryCompile. With TryCompile the system info is taken from the parent's // info to save time - if (!this->InTryCompile) + if (!this->State->GetIsInTryCompile()) { this->GlobalGenerator->ClearEnabledLanguages(); @@ -1958,7 +1957,7 @@ void cmake::SetProgressCallback(ProgressCallbackType f, void *cd) void cmake::UpdateProgress(const char *msg, float prog) { - if(this->ProgressCallback && !this->InTryCompile) + if(this->ProgressCallback && !this->State->GetIsInTryCompile()) { (*this->ProgressCallback)(msg, prog, this->ProgressCallbackClientData); return; @@ -1967,12 +1966,12 @@ void cmake::UpdateProgress(const char *msg, float prog) bool cmake::GetIsInTryCompile() const { - return this->InTryCompile; + return this->State->GetIsInTryCompile(); } void cmake::SetIsInTryCompile(bool b) { - this->InTryCompile = b; + this->State->SetIsInTryCompile(b); } void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v) @@ -2339,7 +2338,7 @@ const char *cmake::GetProperty(const std::string& prop, else if ( prop == "IN_TRY_COMPILE" ) { this->SetProperty("IN_TRY_COMPILE", - this->GetIsInTryCompile()? "1":"0"); + this->State->GetIsInTryCompile() ? "1" : "0"); } else if ( prop == "ENABLED_LANGUAGES" ) { |