On Wed, Apr 27, 2016 at 10:47 PM, Gregor Jasny <gja...@googlemail.com> wrote:
> Hallo Daniel,
>
> On 09/04/16 00:31, Daniel Pfeifer wrote:
>> I implemented the integration of `clang-tidy` along the lines of the
>> `include-what-you-use` integration.
>> There is a new `<LANG>_CLANG_TIDY` target property that is initialized
>> with the value of the `CMAKE_<LANG>_CLANG_TIDY` variable.
>> It contains the command line for `clang-tidy` as a ;-list.
>
> I'm wondering what's the advantage of having this built-in support for
> clang tidy over using the generated compile command database instead?

The compile command database is just this: a database of compile
commands. It does not execute clang-tidy at all. To execute clang-tidy
for all source files that are listed in the database, you need a
separate tool.
There is this one, which requires Python:
https://llvm.org/svn/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py

Having this functionality built into CMake means:

* No additional dependencies.
* Warning messages inside your IDE.
* Warning messages on CDash.

Since clang-tidy is executed directly before the compiler for each
individual source file, you may set CMAKE_CXX_CLANG_TIDY to
"clang-tidy;-fix-errors" and successfully compile invalid code. :-)
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to