summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-23 09:06:54 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-05-25 07:49:59 (GMT)
commitf5b0a0fba458077e0531586f07ed2d01fb7f6259 (patch)
tree1fe6aea68b7576737648a0355514974f5276b8ab /Source
parente40fcb598de8144a2824c7f30c754d3948231602 (diff)
downloadCMake-f5b0a0fba458077e0531586f07ed2d01fb7f6259.zip
CMake-f5b0a0fba458077e0531586f07ed2d01fb7f6259.tar.gz
CMake-f5b0a0fba458077e0531586f07ed2d01fb7f6259.tar.bz2
cmMakefile: Don't pop the directory listfile off the stack.
Simplify the IssueMessage implementation.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx26
1 files changed, 10 insertions, 16 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 81960eb..71a8b6d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -260,18 +260,10 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
else
{
cmListFileContext lfc;
- if(this->ListFileStack.empty())
- {
- // We are not processing the project. Add the directory-level context.
- lfc.FilePath = this->GetCurrentSourceDirectory();
- lfc.FilePath += "/CMakeLists.txt";
- }
- else
- {
- // We are processing the project but are not currently executing a
- // command. Add whatever context information we have.
- lfc.FilePath = this->ListFileStack.back();
- }
+ // We are not currently executing a command. Add whatever context
+ // information we have.
+ lfc.FilePath = this->ListFileStack.back();
+
if(!this->GetCMakeInstance()->GetIsInTryCompile())
{
lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath,
@@ -535,12 +527,16 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
{
this->AddDefinition("CMAKE_PARENT_LIST_FILE",
this->GetDefinition("CMAKE_CURRENT_LIST_FILE"));
- return this->ReadListFile(listfile, noPolicyScope, false);
+ bool result = this->ReadListFile(listfile, noPolicyScope, false);
+ this->ListFileStack.pop_back();
+ return result;
}
bool cmMakefile::ReadListFile(const char* listfile)
{
- return this->ReadListFile(listfile, true, false);
+ bool result = this->ReadListFile(listfile, true, false);
+ this->ListFileStack.pop_back();
+ return result;
}
bool cmMakefile::ReadListFile(const char* listfile,
@@ -577,8 +573,6 @@ bool cmMakefile::ReadListFile(const char* listfile,
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
- this->ListFileStack.pop_back();
-
if (res)
{
this->CheckForUnusedVariables();