summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-24 15:28:09 (GMT)
committerBrad King <brad.king@kitware.com>2018-01-24 19:31:53 (GMT)
commite342e4100a597dc8a7f94c55409e619a4848754f (patch)
treeb8af1b5cdf45d12da95f38025efe7c8bd83d8dd3 /Source/cmNinjaTargetGenerator.cxx
parent05e9cdb81ecddba496f21d0c9e35e9536261337f (diff)
downloadCMake-e342e4100a597dc8a7f94c55409e619a4848754f.zip
CMake-e342e4100a597dc8a7f94c55409e619a4848754f.tar.gz
CMake-e342e4100a597dc8a7f94c55409e619a4848754f.tar.bz2
Makefile,Ninja: Use tool-specific response file flag for include dirs
When we use a response file for `-I` flags, not all compilers support the `@<file>` syntax. Define `CMAKE_<LANG>_RESPONSE_FILE_FLAG` to specify tool-specific flag, just as we do for linking already via `CMAKE_<LANG>_RESPONSE_FILE_LINK_FLAG`.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index f967168..debf476 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -416,14 +416,20 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
std::string flags = "$FLAGS";
std::string rspfile;
std::string rspcontent;
- std::string responseFlag;
bool const lang_supports_response = !(lang == "RC" || lang == "CUDA");
if (lang_supports_response && this->ForceResponseFile()) {
+ std::string const responseFlagVar =
+ "CMAKE_" + lang + "_RESPONSE_FILE_FLAG";
+ std::string responseFlag =
+ this->Makefile->GetSafeDefinition(responseFlagVar);
+ if (responseFlag.empty()) {
+ responseFlag = "@";
+ }
rspfile = "$RSP_FILE";
- responseFlag = "@" + rspfile;
+ responseFlag += rspfile;
rspcontent = " $DEFINES $INCLUDES $FLAGS";
- flags = responseFlag;
+ flags = std::move(responseFlag);
vars.Defines = "";
vars.Includes = "";
}