diff options
author | Brad King <brad.king@kitware.com> | 2017-04-25 13:41:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-04-25 13:41:18 (GMT) |
commit | 74672e2ffaaa7f6c0efa1884a3f8d239d36ec7bf (patch) | |
tree | a26d41e0d84ac2b705ebf486efae21bae05efe12 /Source/cmNinjaTargetGenerator.cxx | |
parent | 7dca104e14519be4ff28978a1553a3395ecaf6d2 (diff) | |
parent | 594d3d6fffac33062629bafb819a5df7c1326824 (diff) | |
download | CMake-74672e2ffaaa7f6c0efa1884a3f8d239d36ec7bf.zip CMake-74672e2ffaaa7f6c0efa1884a3f8d239d36ec7bf.tar.gz CMake-74672e2ffaaa7f6c0efa1884a3f8d239d36ec7bf.tar.bz2 |
Merge topic 'ninja-dyndep-response-file'
594d3d6f Ninja: support response file for cmake_ninja_depends on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !722
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index e0b2217..7e29681 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -557,13 +557,26 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) // Write the rule for ninja dyndep file generation. std::vector<std::string> ddCmds; +#ifdef _WIN32 + // Windows command line length is limited -> use response file for dyndep + // rules + std::string ddRspFile = "$out.rsp"; + std::string ddRspContent = "$in"; + std::string ddInput = "@" + ddRspFile; +#else + std::string ddRspFile; + std::string ddRspContent; + std::string ddInput = "$in"; +#endif + // Run CMake dependency scanner on preprocessed output. std::string const cmake = this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); ddCmds.push_back(cmake + " -E cmake_ninja_dyndep" " --tdi=" + tdi + " --dd=$out" - " $in"); + " " + + ddInput); std::string const ddCmdLine = this->GetLocalGenerator()->BuildCommandLine(ddCmds); @@ -575,9 +588,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) this->GetGlobalGenerator()->AddRule( this->LanguageDyndepRule(lang), ddCmdLine, ddDesc.str(), ddComment.str(), /*depfile*/ "", - /*deps*/ "", - /*rspfile*/ "", - /*rspcontent*/ "", + /*deps*/ "", ddRspFile, ddRspContent, /*restat*/ "", /*generator*/ false); } |