diff options
author | Brad King <brad.king@kitware.com> | 2016-09-19 20:27:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-20 12:51:57 (GMT) |
commit | 501f9c93671cdbed546bb92382240cc704cf6e6a (patch) | |
tree | 8d41d1c5e6568dd77ec8849e1d0bf7d22ff0d478 | |
parent | 144a24dcdcbb075d60d31171e0bda0654e613287 (diff) | |
download | CMake-501f9c93671cdbed546bb92382240cc704cf6e6a.zip CMake-501f9c93671cdbed546bb92382240cc704cf6e6a.tar.gz CMake-501f9c93671cdbed546bb92382240cc704cf6e6a.tar.bz2 |
cmGlobalNinjaGenerator: Add API to check for implicit outputs support
Ninja 1.7 introduced support for implicit outputs on build statements.
Add an internal API to check whether the Ninja version in use for the
build supports this feature.
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index c74baa1..b913621 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1306,6 +1306,13 @@ bool cmGlobalNinjaGenerator::SupportsConsolePool() const RequiredNinjaVersionForConsolePool().c_str()); } +bool cmGlobalNinjaGenerator::SupportsImplicitOuts() const +{ + return !cmSystemTools::VersionCompare( + cmSystemTools::OP_LESS, this->NinjaVersion.c_str(), + this->RequiredNinjaVersionForImplicitOuts().c_str()); +} + void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) { WriteRule(*this->RulesFileStream, "CLEAN", ninjaCmd() + " -t clean", diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index d8eddd0..0201685 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -339,7 +339,9 @@ public: // Ninja generator uses 'deps' and 'msvc_deps_prefix' introduced in 1.3 static std::string RequiredNinjaVersion() { return "1.3"; } static std::string RequiredNinjaVersionForConsolePool() { return "1.5"; } + static std::string RequiredNinjaVersionForImplicitOuts() { return "1.7"; } bool SupportsConsolePool() const; + bool SupportsImplicitOuts() const; std::string NinjaOutputPath(std::string const& path); bool HasOutputPathPrefix() const { return !this->OutputPathPrefix.empty(); } |