summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-07-29 00:00:00 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-28 13:12:16 (GMT)
commit78357e98a4c306847ddc30d9d6db361b66baf31b (patch)
tree45cfe52a6cfbba527dd01bbf482aeadf8582f641
parent261a2585d9df7113a5ba7c9beacb641754444523 (diff)
downloadCMake-78357e98a4c306847ddc30d9d6db361b66baf31b.zip
CMake-78357e98a4c306847ddc30d9d6db361b66baf31b.tar.gz
CMake-78357e98a4c306847ddc30d9d6db361b66baf31b.tar.bz2
Avoid duplicate calls to GetDefinition
-rw-r--r--Source/cmGlobalGenerator.cxx6
-rw-r--r--Source/cmGraphVizWriter.cxx2
2 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index eff6665..ac7c236 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -401,15 +401,13 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
"all generators must specify this->FindMakeProgramFile");
return false;
}
- if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") ||
- cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile);
if (!setMakeProgram.empty()) {
mf->ReadListFile(setMakeProgram);
}
}
- if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") ||
- cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
std::ostringstream err;
err << "CMake was unable to find a build program corresponding to \""
<< this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You "
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index c23156d..8e9abf8 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -260,7 +260,7 @@ void cmGraphVizWriter::ReadSettings(
do { \
const char* value = mf.GetDefinition(cmakeDefinition); \
if (value) { \
- (var) = mf.IsOn(cmakeDefinition); \
+ (var) = cmIsOn(value); \
} \
} while (false)