diff options
author | Brad King <brad.king@kitware.com> | 2020-01-31 13:59:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-31 14:00:52 (GMT) |
commit | 3aea8658014177c6ad56f46876196a4428977909 (patch) | |
tree | d50a4ec8f5325638a8444216087e9c0c7e6a5cf3 /Source/cmMakefileTargetGenerator.cxx | |
parent | 193352e420f8a21300d80ca115da2858a7f27ae6 (diff) | |
download | CMake-3aea8658014177c6ad56f46876196a4428977909.zip CMake-3aea8658014177c6ad56f46876196a4428977909.tar.gz CMake-3aea8658014177c6ad56f46876196a4428977909.tar.bz2 |
clang-tidy: Fix explicit --driver-mode= argument
Since commit f6f4eb0907 (clang-tidy: Add driver mode argument,
2020-01-19) the `clang-tidy` tool rejects the new option:
Unknown command line argument '--driver-mode=g++'.
This is because we are adding the flag before the main compiler
command-line. Encode it with `--extra-arg-before=` so that `clang-tidy`
knows it is supposed to be part of the compiler command.
Suggested-by: Hanjiang Yu
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index a2fa3b1..d7e2de6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -788,7 +788,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( driverMode = lang == "C" ? "gcc" : "g++"; } run_iwyu += this->LocalGenerator->EscapeForShell( - cmStrCat(tidy, ";--driver-mode=", driverMode)); + cmStrCat(tidy, ";--extra-arg-before=--driver-mode=", driverMode)); } if (cpplint && *cpplint) { run_iwyu += " --cpplint="; |