diff options
author | Brad King <brad.king@kitware.com> | 2020-01-28 16:01:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-28 16:01:19 (GMT) |
commit | 193352e420f8a21300d80ca115da2858a7f27ae6 (patch) | |
tree | 62b08330bbfd976d0cdede96abc4884fcbf63ff2 /Source/cmNinjaTargetGenerator.cxx | |
parent | e3be80f4fc1d6fedf45666b7d18dda12ef20054e (diff) | |
parent | f6f4eb090714df50b77b164bbd5bb65a8ce59cbc (diff) | |
download | CMake-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.cxx | 8 |
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="; |