diff options
author | Roger Leigh <rleigh@dundee.ac.uk> | 2017-12-14 16:09:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-02-06 18:24:46 (GMT) |
commit | 22e8b3af041f49842aeafa2d97129f422404d7de (patch) | |
tree | 3d2c76d931789a162114d38023faeeea1cc90760 /Source/cmNinjaUtilityTargetGenerator.cxx | |
parent | f7c08c333b3ccd86134f73a8a3df5bf59c53bdd8 (diff) | |
download | CMake-22e8b3af041f49842aeafa2d97129f422404d7de.zip CMake-22e8b3af041f49842aeafa2d97129f422404d7de.tar.gz CMake-22e8b3af041f49842aeafa2d97129f422404d7de.tar.bz2 |
Ninja: Generate scripts for long custom command sequences
Ninja runs just one command line for every build statement, so the Ninja
generator needs to `&&`-chain multiple commands together into one long
string. For long custom command sequences this can exceed the maximum
command-line length for the operating system. In such cases, write the
commands out to a script instead, and then run the script from Ninja's
one command line.
Co-Author: Brad King <brad.king@kitware.com>
Fixes: #15612
Diffstat (limited to 'Source/cmNinjaUtilityTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaUtilityTargetGenerator.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index 7adeb8e..cc6d4b9 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -96,8 +96,8 @@ void cmNinjaUtilityTargetGenerator::Generate() this->GetBuildFileStream(), "Utility command for " + this->GetTargetName(), outputs, deps); } else { - std::string command = - this->GetLocalGenerator()->BuildCommandLine(commands); + std::string command = this->GetLocalGenerator()->BuildCommandLine( + commands, "utility", this->GeneratorTarget); const char* echoStr = this->GetGeneratorTarget()->GetProperty("EchoString"); std::string desc; |