OSDN Git Service

Call clang-tidy based on WITH_TIDY* variables.
authorChih-Hung Hsieh <chh@google.com>
Thu, 31 Mar 2016 23:30:23 +0000 (16:30 -0700)
committerChih-Hung Hsieh <chh@google.com>
Thu, 21 Apr 2016 19:31:13 +0000 (12:31 -0700)
commita9a55c7c7e76b2741eb675c0880d242e350b79a3
treec09f8b2a231e47bf25f158df96c82cdec7616ee8
parentda7fef62aa60da65a9f183cf82c14b6aa7694aff
Call clang-tidy based on WITH_TIDY* variables.

* Call clang-tidy before every C/C++ compilation if
  (1) clang-tidy is found at $(PATH_TO_CLANG_TIDY)
  (2) $(my_clang) is true
  (3) LOCAL_TIDY is 1 or true, or
      LOCAL_TIDY is undefined and WITH_TIDY is 1 or true.
* clang-tidy is called with -checks=$(my_tidy_checks),
  which has default '-*,google*,-google-readability*'
  and can be overwritten by WITH_TIDY_CHECKS.
* LOCAL_TIDY_CHECKS is appended to $(my_tidy_checks)
* Extra flags are passed to clang-tidy through
  WITH_TIDY_FLAGS or LOCAL_TIDY_FLAGS.
* To quickly find and fix clang-tidy warnings, set $(WITH_TIDY_ONLY)
  to 1 or true to skip compilation of C/C++ files.
* Add a PHONY tidy_only target,
  which includes all $(cpp_objects) and $(c_objects).
* The 'mm' and 'mmm' functions are changed to call make with
  the 'tidy_only' target when WITH_TIDY_ONLY is true or 1.
  In that case, only clang-tidy is called for C and C++ files.

Bug: http://b/27779618
Change-Id: I8adcfff217d68af49849b79aacee7d7654cafb1b
core/binary.mk
core/clear_vars.mk
core/config.mk
core/definitions.mk
core/main.mk
envsetup.sh