mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-13 18:49:38 -06:00
Merge topic 'target-SKIP_LINTING'
f100769d72Add `SKIP_LINTING` target property and `CMAKE_SKIP_LINTING` variable0d6b5d54b2Tests/RunCMake/MultiLint: Extract test preparation code into separate file3a21092d75Tests/RunCMake/MultiLint: Refactor test runs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !11139
This commit is contained in:
@@ -1011,14 +1011,18 @@ void cmFastbuildNormalTargetGenerator::CollapseAllExecsIntoOneScriptfile(
|
||||
std::string cmFastbuildNormalTargetGenerator::ComputeCodeCheckOptions(
|
||||
cmSourceFile const& srcFile)
|
||||
{
|
||||
cmValue const skipCodeCheck = srcFile.GetProperty("SKIP_LINTING");
|
||||
std::string staticCheckRule;
|
||||
if (!skipCodeCheck.IsOn()) {
|
||||
std::string compilerLauncher;
|
||||
staticCheckRule = this->GenerateCodeCheckRules(srcFile, compilerLauncher,
|
||||
"", Config, nullptr);
|
||||
LogMessage(cmStrCat("CodeCheck: ", staticCheckRule));
|
||||
cmValue const srcSkipCodeCheckVal = srcFile.GetProperty("SKIP_LINTING");
|
||||
bool const skipCodeCheck = srcSkipCodeCheckVal.IsSet()
|
||||
? srcSkipCodeCheckVal.IsOn()
|
||||
: this->GetGeneratorTarget()->GetPropertyAsBool("SKIP_LINTING");
|
||||
|
||||
if (skipCodeCheck) {
|
||||
return {};
|
||||
}
|
||||
std::string compilerLauncher;
|
||||
std::string staticCheckRule = this->GenerateCodeCheckRules(
|
||||
srcFile, compilerLauncher, "", Config, nullptr);
|
||||
LogMessage(cmStrCat("CodeCheck: ", staticCheckRule));
|
||||
return staticCheckRule;
|
||||
}
|
||||
|
||||
|
||||
@@ -1091,8 +1091,12 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
|
||||
compilerLauncher = GetCompilerLauncher(lang, config);
|
||||
}
|
||||
|
||||
cmValue const skipCodeCheck = source.GetProperty("SKIP_LINTING");
|
||||
if (!skipCodeCheck.IsOn()) {
|
||||
cmValue const srcSkipCodeCheckVal = source.GetProperty("SKIP_LINTING");
|
||||
bool const skipCodeCheck = srcSkipCodeCheckVal.IsSet()
|
||||
? srcSkipCodeCheckVal.IsOn()
|
||||
: this->GetGeneratorTarget()->GetPropertyAsBool("SKIP_LINTING");
|
||||
|
||||
if (!skipCodeCheck) {
|
||||
std::string const codeCheck = this->GenerateCodeCheckRules(
|
||||
source, compilerLauncher, "$(CMAKE_COMMAND)", config, nullptr);
|
||||
if (!codeCheck.empty()) {
|
||||
|
||||
@@ -1423,8 +1423,12 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
||||
|
||||
auto compilerLauncher = this->GetCompilerLauncher(language, config);
|
||||
|
||||
cmValue const skipCodeCheck = source->GetProperty("SKIP_LINTING");
|
||||
if (!skipCodeCheck.IsOn()) {
|
||||
cmValue const srcSkipCodeCheckVal = source->GetProperty("SKIP_LINTING");
|
||||
bool const skipCodeCheck = srcSkipCodeCheckVal.IsSet()
|
||||
? srcSkipCodeCheckVal.IsOn()
|
||||
: this->GetGeneratorTarget()->GetPropertyAsBool("SKIP_LINTING");
|
||||
|
||||
if (!skipCodeCheck) {
|
||||
auto const cmakeCmd = this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
|
||||
vars["CODE_CHECK"] =
|
||||
|
||||
@@ -465,6 +465,7 @@ TargetProperty const StaticTargetProperties[] = {
|
||||
{ "Fortran_LINKER_LAUNCHER"_s, IC::CanCompileSources },
|
||||
|
||||
// Static analysis
|
||||
{ "SKIP_LINTING"_s, IC::CanCompileSources },
|
||||
// -- C
|
||||
{ "C_CLANG_TIDY"_s, IC::CanCompileSources },
|
||||
{ "C_CLANG_TIDY_EXPORT_FIXES_DIR"_s, IC::CanCompileSources },
|
||||
@@ -1805,6 +1806,7 @@ void cmTarget::CopyImportedCxxModulesProperties(cmTarget const* tgt)
|
||||
"CXX_CPPCHECK",
|
||||
"CXX_ICSTAT",
|
||||
"CXX_INCLUDE_WHAT_YOU_USE",
|
||||
"SKIP_LINTING",
|
||||
|
||||
// Build graph properties
|
||||
"EXCLUDE_FROM_ALL",
|
||||
|
||||
Reference in New Issue
Block a user