summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorFrancisco Facioni <francisco.facioni@hawkeyeinnovations.com>2019-05-30 08:35:03 (GMT)
committerBrad King <brad.king@kitware.com>2019-06-03 15:53:27 (GMT)
commitd91b5a72cd751b75fbce163fa7a3ea2f05bf484d (patch)
tree2067e7d2249a42402a974d390349dcd9bb258be1 /Source/cmNinjaTargetGenerator.cxx
parent5efac09beda23c1fb188c660df39b1884f252f64 (diff)
downloadCMake-d91b5a72cd751b75fbce163fa7a3ea2f05bf484d.zip
CMake-d91b5a72cd751b75fbce163fa7a3ea2f05bf484d.tar.gz
CMake-d91b5a72cd751b75fbce163fa7a3ea2f05bf484d.tar.bz2
Ninja: Add support for CUDA nvcc response files
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 4c93cf1..2139a45 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -465,12 +465,12 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
std::string flags = "$FLAGS";
std::string responseFlag;
- bool const lang_supports_response = !(lang == "RC" || lang == "CUDA");
+ bool const lang_supports_response = lang != "RC";
if (lang_supports_response && this->ForceResponseFile()) {
std::string const responseFlagVar =
"CMAKE_" + lang + "_RESPONSE_FILE_FLAG";
responseFlag = this->Makefile->GetSafeDefinition(responseFlagVar);
- if (responseFlag.empty()) {
+ if (responseFlag.empty() && lang != "CUDA") {
responseFlag = "@";
}
}
@@ -944,8 +944,16 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
std::string const objectFileDir =
cmSystemTools::GetFilenamePath(objectFileName);
+ std::string cmakeVarLang = "CMAKE_";
+ cmakeVarLang += language;
+
+ // build response file name
+ std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_FLAG";
+
+ const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar);
+
bool const lang_supports_response =
- !(language == "RC" || language == "CUDA");
+ !(language == "RC" || (language == "CUDA" && !flag));
int const commandLineLengthLimit =
((lang_supports_response && this->ForceResponseFile())) ? -1 : 0;