diff options
author | Peter Kuemmel <syntheticpp@gmx.net> | 2012-06-14 12:15:16 (GMT) |
---|---|---|
committer | Peter Kuemmel <syntheticpp@gmx.net> | 2012-06-14 12:22:56 (GMT) |
commit | 654608600474a27eeddafd50ea25c7e3882fd460 (patch) | |
tree | b666e0b55bbc137f5d631504cec812136607e854 /Source/cmGlobalNinjaGenerator.cxx | |
parent | 220fdc16fc577feb3401a44eea475dae119257b0 (diff) | |
download | CMake-654608600474a27eeddafd50ea25c7e3882fd460.zip CMake-654608600474a27eeddafd50ea25c7e3882fd460.tar.gz CMake-654608600474a27eeddafd50ea25c7e3882fd460.tar.bz2 |
Ninja: don't use shell when cmake is called directly
When linking with cmake and vs_link_* the command line
could be too long for cmd.exe, which needs not to be
called in this case. (was not cached by a test)
Introduce rules which don't use the shell and use this
rule when there are no pre or post step.
For free we get a small speedup, because cmd is then
not called.
Also be more accurate when estimating the
command line length.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 11d8653..2c00e06 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -106,6 +106,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, const cmNinjaDeps& implicitDeps, const cmNinjaDeps& orderOnlyDeps, const cmNinjaVars& variables, + bool suppressShell, int cmdLineLimit) { // Make sure there is a rule. @@ -177,8 +178,15 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, // check if a response file rule should be used const std::string args = arguments.str(); - if (cmdLineLimit > 0 && args.size() > (size_t)cmdLineLimit) + if (suppressShell) + { + builds << "_NOSHELL"; + } + else if (cmdLineLimit > 0 && + args.size() + builds.str().size() > (size_t)cmdLineLimit) + { builds << "_RSPFILE"; + } os << builds.str() << args; |