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/cmNinjaNormalTargetGenerator.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/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index ddbc772..f1fb2d2 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -976,8 +976,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() preLinkCmdLines.push_back("cd " + homeOutDir); } - vars["PRE_LINK"] = localGen.BuildCommandLine(preLinkCmdLines); - std::string postBuildCmdLine = localGen.BuildCommandLine(postBuildCmdLines); + vars["PRE_LINK"] = localGen.BuildCommandLine(preLinkCmdLines, "pre-link", + this->GeneratorTarget); + std::string postBuildCmdLine = localGen.BuildCommandLine( + postBuildCmdLines, "post-build", this->GeneratorTarget); cmNinjaVars symlinkVars; bool const symlinkNeeded = |