How can I specify additional arguments for use with CMAKE_CXX_CLANG_TIDY variable

↘锁芯ラ 提交于 2019-12-04 11:36:09

It works as expected with cmake 3.7.2 and clang-tidy 4.0.

E.g. directly specifying on the command line:

cmake -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-style=file;-checks=*"

or in the CMakeLists.txt:

set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-style=file;-checks=*")

You have to make sure that the clang-tidy arguments are correct, otherwise it seems to fail silently.

Everything is correct. CMake does not parse those arguments when generating the makefile, but when the makefile is executed. When a file was successful compiled, then clang-tidy will be executed automatically.

You could try setting CMAKE_CXX_CLANG_TIDY directly in your CMakeLists.txt:
set(CMAKE_CXX_CLANG_TIDY "clang-tidy" "-checks=*")

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!