Hi, I’ve added clang-tidy capability to my command line that will be set upon activation. before running it, I’ve made sure that my setup has clang-tidy installed.
here’s the CMake code
option(ENABLE_CLANG_TIDY "default is off" OFF)
if(ENABLE_CLANG_TIDY)
find_program(CLANG_TIDY clang-tidy)
if(CLANG_TIDY)
string(
CONCAT
clang_tidy_cmd
"${CLANG_TIDY}\;-config={Checks: '"
"*,"
"-google-runtime-references,"
.... <more flags> ... )
set_target_properties(${my_target} PROPERTIES CXX_CLANG_TIDY
${clang_tidy_cmd})
However, when I use the Xcode generator (`-G Xcode`) it's omitting the clang-tidy configuration from the compilation, and when setting CMake to generate simple makefile, the clang-tidy reappears in the compilation line of each cpp file.
Any idea why ? is it a bug ? my CMake version is 3.20.2