summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-28 16:01:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-28 16:01:19 (GMT)
commit193352e420f8a21300d80ca115da2858a7f27ae6 (patch)
tree62b08330bbfd976d0cdede96abc4884fcbf63ff2 /Source/cmNinjaTargetGenerator.cxx
parente3be80f4fc1d6fedf45666b7d18dda12ef20054e (diff)
parentf6f4eb090714df50b77b164bbd5bb65a8ce59cbc (diff)
downloadCMake-193352e420f8a21300d80ca115da2858a7f27ae6.zip
CMake-193352e420f8a21300d80ca115da2858a7f27ae6.tar.gz
CMake-193352e420f8a21300d80ca115da2858a7f27ae6.tar.bz2
Merge topic 'clang-tidy-driver-mode'
f6f4eb0907 clang-tidy: Add driver mode argument Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4208
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 4ebdd24..5e8cc7d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -761,7 +761,13 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
}
if (tidy && *tidy) {
run_iwyu += " --tidy=";
- run_iwyu += this->GetLocalGenerator()->EscapeForShell(tidy);
+ const char* driverMode = this->Makefile->GetDefinition(
+ "CMAKE_" + lang + "_CLANG_TIDY_DRIVER_MODE");
+ if (!(driverMode && *driverMode)) {
+ driverMode = lang == "C" ? "gcc" : "g++";
+ }
+ run_iwyu += this->GetLocalGenerator()->EscapeForShell(
+ cmStrCat(tidy, ";--driver-mode=", driverMode));
}
if (cpplint && *cpplint) {
run_iwyu += " --cpplint=";