Skip to content

Commit 5e4e882

Browse files
mstorsjotstellar
authored andcommitted
[clang-tidy] Add CLANG_TIDY_CONFUSABLE_CHARS_GEN cmake cache variable to avoid building when cross compiling
This is similar to the LLVM_TABLEGEN, CLANG_TABLEGEN and CLANG_PSEUDO_GEN cmake cache variables. Differential Revision: https://reviews.llvm.org/D129799 (cherry picked from commit dc95d0c)
1 parent e8c390d commit 5e4e882

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clang-tools-extra/clang-tidy/misc/CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ set(LLVM_LINK_COMPONENTS
33
Support
44
)
55

6-
if(LLVM_USE_HOST_TOOLS)
6+
set(CLANG_TIDY_CONFUSABLE_CHARS_GEN "clang-tidy-confusable-chars-gen" CACHE
7+
STRING "Host clang-tidy-confusable-chars-gen executable. Saves building if cross-compiling.")
8+
9+
if(NOT CLANG_TIDY_CONFUSABLE_CHARS_GEN STREQUAL "clang-tidy-confusable-chars-gen")
10+
set(make_confusable_table ${CLANG_TIDY_CONFUSABLE_CHARS_GEN})
11+
set(make_confusable_table_target ${CLANG_TIDY_CONFUSABLE_CHARS_GEN})
12+
elseif(LLVM_USE_HOST_TOOLS)
713
build_native_tool(clang-tidy-confusable-chars-gen make_confusable_table)
814
set(make_confusable_table_target "${make_confusable_table}")
915
else()

0 commit comments

Comments
 (0)