diff options
author | Francisco Facioni <francisco.facioni@hawkeyeinnovations.com> | 2019-05-30 08:35:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-03 15:52:28 (GMT) |
commit | 5efac09beda23c1fb188c660df39b1884f252f64 (patch) | |
tree | 94be4f973c1cffba9b6f3cc4aaf7aa274776c5b4 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 73472408c501e66c9dd8c027293b8c0907001b42 (diff) | |
download | CMake-5efac09beda23c1fb188c660df39b1884f252f64.zip CMake-5efac09beda23c1fb188c660df39b1884f252f64.tar.gz CMake-5efac09beda23c1fb188c660df39b1884f252f64.tar.bz2 |
Ninja: Compute linker response file flag earlier
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 1399ee2..63af69e 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -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; |