summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-10 13:12:27 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-03-10 13:12:27 (GMT)
commit01fadeb205317f7bd22b4762a03fcb7b32b2bc95 (patch)
tree32713d25dc3877100d04fccd6d82c56cb1913c1f /Source
parentfa4617b7ea00474053b3d0278f316db226322626 (diff)
parenta6b09085715d0d7f299e9ca76a4835ce5f5acfaf (diff)
downloadCMake-01fadeb205317f7bd22b4762a03fcb7b32b2bc95.zip
CMake-01fadeb205317f7bd22b4762a03fcb7b32b2bc95.tar.gz
CMake-01fadeb205317f7bd22b4762a03fcb7b32b2bc95.tar.bz2
Merge topic 'ninja-check-root-robustly'
a6b09085 Ninja: Improve internal check for generating at the top-level (#15436)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmLocalNinjaGenerator.cxx3
2 files changed, 2 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 3a9d5be..d64ae0f 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -130,7 +130,7 @@ public:
std::string ConvertToOptionallyRelativeOutputPath(const std::string& remote);
///! set/get the parent generator
- cmLocalGenerator* GetParent(){return this->Parent;}
+ cmLocalGenerator* GetParent() const {return this->Parent;}
void SetParent(cmLocalGenerator* g) { this->Parent = g; g->AddChild(this); }
///! set/get the children
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 413dc0f..640c1b3 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -182,8 +182,7 @@ cmake* cmLocalNinjaGenerator::GetCMakeInstance()
bool cmLocalNinjaGenerator::isRootMakefile() const
{
- return (strcmp(this->Makefile->GetCurrentDirectory(),
- this->GetCMakeInstance()->GetHomeDirectory()) == 0);
+ return !this->GetParent();
}
void cmLocalNinjaGenerator::WriteBuildFileTop()