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