From f4f3b6b9af13366b16ce5a3be7af6c2b68c8be09 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Jan 2019 14:55:34 -0500 Subject: 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. --- Source/cmGlobalNinjaGenerator.cxx | 9 +++++++++ Source/cmGlobalNinjaGenerator.h | 6 ++++++ 2 files changed, 15 insertions(+) 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: -- cgit v0.12