Commit 5efac09b authored by Francisco Facioni's avatar Francisco Facioni Committed by Brad King
Browse files

Ninja: Compute linker response file flag earlier

parent 73472408
......@@ -172,21 +172,24 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(bool useResponseFile)
vars.Language = "CUDA";
std::string responseFlag;
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);
if (flag) {
responseFlag = flag;
} else {
responseFlag = "@";
}
if (!useResponseFile) {
vars.Objects = "$in";
vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES";
} else {
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);
if (flag) {
responseFlag = flag;
} else {
responseFlag = "@";
}
rule.RspFile = "$RSP_FILE";
responseFlag += rule.RspFile;
......@@ -287,21 +290,24 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
}
std::string responseFlag;
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);
if (flag) {
responseFlag = flag;
} else {
responseFlag = "@";
}
if (!useResponseFile) {
vars.Objects = "$in";
vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES";
} else {
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);
if (flag) {
responseFlag = flag;
} else {
responseFlag = "@";
}
rule.RspFile = "$RSP_FILE";
responseFlag += rule.RspFile;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment