clang-tidy: allow OBJC and OBJCXX

This commit is contained in:
Andrew Fuller
2020-11-04 20:46:51 -08:00
parent da0a7d28a4
commit 1134064e22
18 changed files with 69 additions and 16 deletions
+13 -7
View File
@@ -873,15 +873,21 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
}
// Maybe insert an include-what-you-use runner.
if (!compileCommands.empty() && (lang == "C" || lang == "CXX")) {
std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
cmProp iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
if (!compileCommands.empty() &&
(lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX")) {
std::string const tidy_prop = lang + "_CLANG_TIDY";
cmProp tidy = this->GeneratorTarget->GetProperty(tidy_prop);
std::string const cpplint_prop = lang + "_CPPLINT";
cmProp cpplint = this->GeneratorTarget->GetProperty(cpplint_prop);
std::string const cppcheck_prop = lang + "_CPPCHECK";
cmProp cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop);
cmProp iwyu = nullptr;
cmProp cpplint = nullptr;
cmProp cppcheck = nullptr;
if (lang == "C" || lang == "CXX") {
std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
std::string const cpplint_prop = lang + "_CPPLINT";
cpplint = this->GeneratorTarget->GetProperty(cpplint_prop);
std::string const cppcheck_prop = lang + "_CPPCHECK";
cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop);
}
if (cmNonempty(iwyu) || cmNonempty(tidy) || cmNonempty(cpplint) ||
cmNonempty(cppcheck)) {
std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_co_compile";
+13 -7
View File
@@ -824,15 +824,21 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
}
// Maybe insert an include-what-you-use runner.
if (!compileCmds.empty() && (lang == "C" || lang == "CXX")) {
std::string const iwyu_prop = cmStrCat(lang, "_INCLUDE_WHAT_YOU_USE");
cmProp iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
if (!compileCmds.empty() &&
(lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX")) {
std::string const tidy_prop = cmStrCat(lang, "_CLANG_TIDY");
cmProp tidy = this->GeneratorTarget->GetProperty(tidy_prop);
std::string const cpplint_prop = cmStrCat(lang, "_CPPLINT");
cmProp cpplint = this->GeneratorTarget->GetProperty(cpplint_prop);
std::string const cppcheck_prop = cmStrCat(lang, "_CPPCHECK");
cmProp cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop);
cmProp iwyu = nullptr;
cmProp cpplint = nullptr;
cmProp cppcheck = nullptr;
if (lang == "C" || lang == "CXX") {
std::string const iwyu_prop = cmStrCat(lang, "_INCLUDE_WHAT_YOU_USE");
iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
std::string const cpplint_prop = cmStrCat(lang, "_CPPLINT");
cpplint = this->GeneratorTarget->GetProperty(cpplint_prop);
std::string const cppcheck_prop = cmStrCat(lang, "_CPPCHECK");
cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop);
}
if (cmNonempty(iwyu) || cmNonempty(tidy) || cmNonempty(cpplint) ||
cmNonempty(cppcheck)) {
std::string run_iwyu = cmStrCat(cmakeCmd, " -E __run_co_compile");
+2
View File
@@ -372,6 +372,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initProp("ISPC_INSTRUCTION_SETS");
initProp("LINK_SEARCH_START_STATIC");
initProp("LINK_SEARCH_END_STATIC");
initProp("OBJC_CLANG_TIDY");
initProp("OBJCXX_CLANG_TIDY");
initProp("Swift_LANGUAGE_VERSION");
initProp("Swift_MODULE_DIRECTORY");
initProp("VS_JUST_MY_CODE_DEBUGGING");