diff options
author | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-05-12 14:49:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-16 14:47:56 (GMT) |
commit | b480315e0c229454c335290b19cc689930d7849f (patch) | |
tree | fd6c95e7d53d4a9c095947ba7cd718e0ce1ae60f /Source/cmMakefileTargetGenerator.cxx | |
parent | 993dde925f208d98c68edcd451b0d6979e0abdd4 (diff) | |
download | CMake-b480315e0c229454c335290b19cc689930d7849f.zip CMake-b480315e0c229454c335290b19cc689930d7849f.tar.gz CMake-b480315e0c229454c335290b19cc689930d7849f.tar.bz2 |
TargetGenerator: Add SKIP_LINTING source property
The `SKIP_LINTING` source property was added to disable code check for
desired source files. The `SKIP_LINTING`includes `cpplint`, `clang-tidy`, \
`cppcheck` and `include-what-you-use`. If `SKIP_LINTING` is set on a
source file, the tools mentioned above will not be run on that source file.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 1cf3b8b..c915e26 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1057,10 +1057,13 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( compilerLauncher = GetCompilerLauncher(lang, config); } - std::string const codeCheck = this->GenerateCodeCheckRules( - source, compilerLauncher, "$(CMAKE_COMMAND)", config, nullptr); - if (!codeCheck.empty()) { - compileCommands.front().insert(0, codeCheck); + cmValue const skipCodeCheck = source.GetProperty("SKIP_LINTING"); + if (!skipCodeCheck.IsOn()) { + std::string const codeCheck = this->GenerateCodeCheckRules( + source, compilerLauncher, "$(CMAKE_COMMAND)", config, nullptr); + if (!codeCheck.empty()) { + compileCommands.front().insert(0, codeCheck); + } } // If compiler launcher was specified and not consumed above, it |