diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index a2fa3b16ee..d7e2de6c86 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="; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 5e8cc7d5bd..0e746789e1 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -767,7 +767,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, driverMode = lang == "C" ? "gcc" : "g++"; } run_iwyu += this->GetLocalGenerator()->EscapeForShell( - cmStrCat(tidy, ";--driver-mode=", driverMode)); + cmStrCat(tidy, ";--extra-arg-before=--driver-mode=", driverMode)); } if (cpplint && *cpplint) { run_iwyu += " --cpplint=";