summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-24 12:15:51 (GMT)
committerBrad King <brad.king@kitware.com>2018-08-29 13:38:32 (GMT)
commitfb73edf70cc1aea44eac27c8827e616c650bbe7d (patch)
tree145aaf6c8c775b90520682f16df58d59b8b15187 /Source/cmake.cxx
parentbd7dd6d414303e8fc4da786107f4292768d87638 (diff)
downloadCMake-fb73edf70cc1aea44eac27c8827e616c650bbe7d.zip
CMake-fb73edf70cc1aea44eac27c8827e616c650bbe7d.tar.gz
CMake-fb73edf70cc1aea44eac27c8827e616c650bbe7d.tar.bz2
cmake: Drop unnecessary working mode checks
In `cmake::Run` we return before `Configure` or `Generate` when not working in normal mode so they do not need mode checks. While at it, remove a long-outdated comment about when to save the cache.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5bb1f22..1bf8f7d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1262,10 +1262,7 @@ int cmake::ActualConfigure()
this->UpdateConversionPathTable();
this->CleanupCommandsAndMacros();
- int res = 0;
- if (this->GetWorkingMode() == NORMAL_MODE) {
- res = this->DoPreConfigureChecks();
- }
+ int res = this->DoPreConfigureChecks();
if (res < 0) {
return -2;
}
@@ -1431,11 +1428,8 @@ int cmake::ActualConfigure()
"CMakeLists.txt ?");
}
- // only save the cache if there were no fatal errors
- if (this->GetWorkingMode() == NORMAL_MODE) {
- this->State->SaveVerificationScript(this->GetHomeOutputDirectory());
- this->SaveCache(this->GetHomeOutputDirectory());
- }
+ this->State->SaveVerificationScript(this->GetHomeOutputDirectory());
+ this->SaveCache(this->GetHomeOutputDirectory());
if (cmSystemTools::GetErrorOccuredFlag()) {
return -1;
}
@@ -1588,7 +1582,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
}
int ret = this->Configure();
- if (ret || this->GetWorkingMode() != NORMAL_MODE) {
+ if (ret) {
#if defined(CMAKE_HAVE_VS_GENERATORS)
if (!this->VSSolutionFile.empty() && this->GlobalGenerator) {
// CMake is running to regenerate a Visual Studio build tree
@@ -1634,9 +1628,8 @@ int cmake::Generate()
// Save the cache again after a successful Generate so that any internal
// variables created during Generate are saved. (Specifically target GUIDs
// for the Visual Studio and Xcode generators.)
- if (this->GetWorkingMode() == NORMAL_MODE) {
- this->SaveCache(this->GetHomeOutputDirectory());
- }
+ this->SaveCache(this->GetHomeOutputDirectory());
+
return 0;
}