diff options
author | Brad King <brad.king@kitware.com> | 2019-01-30 19:55:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-30 19:58:21 (GMT) |
commit | f4f3b6b9af13366b16ce5a3be7af6c2b68c8be09 (patch) | |
tree | dfd2cf00fbc2f95bde96f3ff27edb8531d9b0f65 | |
parent | 699cd032128afcda78e12a76b227faa6c1f6a258 (diff) | |
download | CMake-f4f3b6b9af13366b16ce5a3be7af6c2b68c8be09.zip CMake-f4f3b6b9af13366b16ce5a3be7af6c2b68c8be09.tar.gz CMake-f4f3b6b9af13366b16ce5a3be7af6c2b68c8be09.tar.bz2 |
Ninja: Detect when ninja is new enough to support a multi-line depfile
Ninja 1.9 supports the multi-line depfile format generated by the
Intel Compiler for Windows. Teach the global generator to detect
when the version is new enough to support this.
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 4fd0673..6498024 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -454,6 +454,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm) , NinjaSupportsConsolePool(false) , NinjaSupportsImplicitOuts(false) , NinjaSupportsManifestRestat(false) + , NinjaSupportsMultilineDepfile(false) , NinjaSupportsDyndeps(0) { #ifdef _WIN32 @@ -581,6 +582,9 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures() this->NinjaSupportsManifestRestat = !cmSystemTools::VersionCompare( cmSystemTools::OP_LESS, this->NinjaVersion.c_str(), RequiredNinjaVersionForManifestRestat().c_str()); + this->NinjaSupportsMultilineDepfile = !cmSystemTools::VersionCompare( + cmSystemTools::OP_LESS, this->NinjaVersion.c_str(), + RequiredNinjaVersionForMultilineDepfile().c_str()); { // Our ninja branch adds ".dyndep-#" to its version number, // where '#' is a feature-specific version number. Extract it. @@ -1478,6 +1482,11 @@ bool cmGlobalNinjaGenerator::SupportsManifestRestat() const return this->NinjaSupportsManifestRestat; } +bool cmGlobalNinjaGenerator::SupportsMultilineDepfile() const +{ + return this->NinjaSupportsMultilineDepfile; +} + void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) { WriteRule(*this->RulesFileStream, "CLEAN", ninjaCmd() + " -t clean", diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index b3aa88f..c619e67 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -345,9 +345,14 @@ public: static std::string RequiredNinjaVersionForConsolePool() { return "1.5"; } static std::string RequiredNinjaVersionForImplicitOuts() { return "1.7"; } static std::string RequiredNinjaVersionForManifestRestat() { return "1.8"; } + static std::string RequiredNinjaVersionForMultilineDepfile() + { + return "1.9"; + } bool SupportsConsolePool() const; bool SupportsImplicitOuts() const; bool SupportsManifestRestat() const; + bool SupportsMultilineDepfile() const; std::string NinjaOutputPath(std::string const& path) const; bool HasOutputPathPrefix() const { return !this->OutputPathPrefix.empty(); } @@ -461,6 +466,7 @@ private: bool NinjaSupportsConsolePool; bool NinjaSupportsImplicitOuts; bool NinjaSupportsManifestRestat; + bool NinjaSupportsMultilineDepfile; unsigned long NinjaSupportsDyndeps; private: |