summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-21 21:13:24 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-06-30 21:14:21 (GMT)
commitbe5997ef77dccc866ddb96bdfd2f529f74988eef (patch)
tree41dcdc8866ebb2997c66a3dcaae51437de23c4cb
parent5bf9bfda3f364b27ca91eacab18ec4dad2cc59f7 (diff)
downloadCMake-be5997ef77dccc866ddb96bdfd2f529f74988eef.zip
CMake-be5997ef77dccc866ddb96bdfd2f529f74988eef.tar.gz
CMake-be5997ef77dccc866ddb96bdfd2f529f74988eef.tar.bz2
cmMakefile: Inline ProcessBuildsystemFile into only caller.
-rw-r--r--Source/cmMakefile.cxx82
1 files changed, 39 insertions, 43 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 53c2d4c..32dd8f5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -405,48 +405,6 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
return result;
}
-class cmMakefile::BuildsystemFileScope
-{
-public:
- BuildsystemFileScope(cmMakefile* mf, std::string const& filename)
- : Makefile(mf), ReportError(true)
- {
- this->Makefile->ListFileStack.push_back(filename);
- this->Makefile->PushPolicyBarrier();
- this->Makefile->PushFunctionBlockerBarrier();
- }
-
- ~BuildsystemFileScope()
- {
- this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
- this->Makefile->PopPolicyBarrier(this->ReportError);
- }
-
- void Quiet() { this->ReportError = false; }
-private:
- cmMakefile* Makefile;
- bool ReportError;
-};
-
-bool cmMakefile::ProcessBuildsystemFile(const char* filename)
-{
- this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename);
-
- BuildsystemFileScope scope(this, filename);
-
- cmListFile listFile;
- if (!listFile.ParseFile(filename, this->IsRootMakefile(), this))
- {
- return false;
- }
- this->ReadListFile(listFile, filename);
- if(cmSystemTools::GetFatalErrorOccured())
- {
- scope.Quiet();
- }
- return true;
-}
-
//----------------------------------------------------------------------------
class cmMakefile::IncludeScope
{
@@ -1697,6 +1655,29 @@ public:
}
};
+class cmMakefile::BuildsystemFileScope
+{
+public:
+ BuildsystemFileScope(cmMakefile* mf, std::string const& filename)
+ : Makefile(mf), ReportError(true)
+ {
+ this->Makefile->ListFileStack.push_back(filename);
+ this->Makefile->PushPolicyBarrier();
+ this->Makefile->PushFunctionBlockerBarrier();
+ }
+
+ ~BuildsystemFileScope()
+ {
+ this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
+ this->Makefile->PopPolicyBarrier(this->ReportError);
+ }
+
+ void Quiet() { this->ReportError = false; }
+private:
+ cmMakefile* Makefile;
+ bool ReportError;
+};
+
//----------------------------------------------------------------------------
void cmMakefile::Configure()
{
@@ -1710,7 +1691,22 @@ void cmMakefile::Configure()
std::string currentStart = this->StateSnapshot.GetCurrentSourceDirectory();
currentStart += "/CMakeLists.txt";
assert(cmSystemTools::FileExists(currentStart.c_str(), true));
- this->ProcessBuildsystemFile(currentStart.c_str());
+ this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
+
+ {
+ BuildsystemFileScope scope(this, currentStart);
+ cmListFile listFile;
+ if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
+ {
+ this->SetConfigured();
+ return;
+ }
+ this->ReadListFile(listFile, currentStart);
+ if(cmSystemTools::GetFatalErrorOccured())
+ {
+ scope.Quiet();
+ }
+ }
// at the end handle any old style subdirs
std::vector<cmMakefile*> subdirs = this->UnConfiguredDirectories;