diff options
author | Brad King <brad.king@kitware.com> | 2017-11-20 18:37:40 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-11-20 18:37:50 (GMT) |
commit | 4d52b46c7046a23948221d4142d768b9ff834e33 (patch) | |
tree | f93d76fe4a4fdb4569e1863c021eb1b4e2f0f2ad /CMakeLists.txt | |
parent | 7ec847395d1302e2a09e090d486426f984342d04 (diff) | |
parent | 08353542e578cf756573c41ec4696dbf1c6513f0 (diff) | |
download | CMake-4d52b46c7046a23948221d4142d768b9ff834e33.zip CMake-4d52b46c7046a23948221d4142d768b9ff834e33.tar.gz CMake-4d52b46c7046a23948221d4142d768b9ff834e33.tar.bz2 |
Merge topic 'tidy-sha1-comment'
08353542 clang-tidy: Clarify comment explaining purpose of CLANG_TIDY_SHA1
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1497
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bf0c4d1..fafe536 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,7 +251,12 @@ if(CMake_RUN_CLANG_TIDY) endif() set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") - # provide definitions for targets that require a rebuild once .clang-tidy changes + # Create a preprocessor definition that depends on .clang-tidy content so + # the compile command will change when .clang-tidy changes. This ensures + # that a subsequent build re-runs clang-tidy on all sources even if they + # do not otherwise need to be recompiled. Nothing actually uses this + # definition. We add it to targets on which we run clang-tidy just to + # get the build dependency on the .clang-tidy file. file(SHA1 ${CMAKE_CURRENT_SOURCE_DIR}/.clang-tidy clang_tidy_sha1) set(CLANG_TIDY_DEFINITIONS "CLANG_TIDY_SHA1=${clang_tidy_sha1}") unset(clang_tidy_sha1) |