summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.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/cmNinjaNormalTargetGenerator.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/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 63af69e..7ad8ab3 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -182,11 +182,11 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(bool useResponseFile)
if (flag) {
responseFlag = flag;
- } else {
+ } else if (this->TargetLinkLanguage != "CUDA") {
responseFlag = "@";
}
- if (!useResponseFile) {
+ if (!useResponseFile || responseFlag.empty()) {
vars.Objects = "$in";
vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES";
} else {
@@ -300,11 +300,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
if (flag) {
responseFlag = flag;
- } else {
+ } else if (this->TargetLinkLanguage != "CUDA") {
responseFlag = "@";
}
- if (!useResponseFile) {
+ if (!useResponseFile || responseFlag.empty()) {
vars.Objects = "$in";
vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES";
} else {
@@ -713,7 +713,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
bool usedResponseFile = false;
globalGen->WriteBuild(this->GetBuildFileStream(), build,
commandLineLengthLimit, &usedResponseFile);
- this->WriteDeviceLinkRule(false);
+ this->WriteDeviceLinkRule(usedResponseFile);
}
void cmNinjaNormalTargetGenerator::WriteLinkStatement()
@@ -1047,8 +1047,17 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
symlinkVars["POST_BUILD"] = postBuildCmdLine;
}
+ std::string cmakeVarLang = "CMAKE_";
+ cmakeVarLang += this->TargetLinkLanguage;
+
+ // build response file name
+ std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG";
+
+ const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar);
+
bool const lang_supports_response =
- !(this->TargetLinkLanguage == "RC" || this->TargetLinkLanguage == "CUDA");
+ !(this->TargetLinkLanguage == "RC" ||
+ (this->TargetLinkLanguage == "CUDA" && !flag));
int commandLineLengthLimit = -1;
if (!lang_supports_response || !this->ForceResponseFile()) {
commandLineLengthLimit =