summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-21 17:44:37 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-06-21 18:10:48 (GMT)
commit384a0dba63b166d94a199b12f104e53496a3302a (patch)
tree35a5c6d9ef09f7a4e5c2d2584ea5f1a982904467 /Source/cmMakefile.cxx
parent5e24ff17a22b780947e98eabc1d25320104f7b21 (diff)
downloadCMake-384a0dba63b166d94a199b12f104e53496a3302a.zip
CMake-384a0dba63b166d94a199b12f104e53496a3302a.tar.gz
CMake-384a0dba63b166d94a199b12f104e53496a3302a.tar.bz2
cmMakefile: Simplify condition handling.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e3a2e4c..93a6c08 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -564,14 +564,15 @@ bool cmMakefile::ReadListFile(const char* listfile,
this->ListFileStack.push_back(filenametoread);
cmListFile listFile;
- bool res = listFile.ParseFile(filenametoread.c_str(),
- requireProjectCommand, this);
- if (res)
+ if (!listFile.ParseFile(filenametoread.c_str(),
+ requireProjectCommand, this))
{
- // add this list file to the list of dependencies
- this->ListFiles.push_back(filenametoread);
+ return false;
}
+ // add this list file to the list of dependencies
+ this->ListFiles.push_back(filenametoread);
+
std::string currentParentFile
= this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
std::string currentFile
@@ -585,13 +586,8 @@ bool cmMakefile::ReadListFile(const char* listfile,
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
- if (res)
- {
- this->ReadListFileInternal(listFile, filenametoread.c_str(),
- noPolicyScope);
-
- this->CheckForUnusedVariables();
- }
+ this->ReadListFileInternal(listFile, filenametoread.c_str(), noPolicyScope);
+ this->CheckForUnusedVariables();
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
@@ -601,7 +597,7 @@ bool cmMakefile::ReadListFile(const char* listfile,
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
- return res;
+ return true;
}
void cmMakefile::ReadListFileInternal(cmListFile const& listFile,