mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-19 13:09:47 -06:00
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.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user