[clang-tools-extra] dc95d0c - [clang-tidy] Add CLANG_TIDY_CONFUSABLE_CHARS_GEN cmake cache variable to avoid building when cross compiling

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 28 02:01:06 PDT 2022


Author: Martin Storsjö
Date: 2022-07-28T12:00:21+03:00
New Revision: dc95d0c525636aed53a3b38258efa2dff4c83edf

URL: https://github.com/llvm/llvm-project/commit/dc95d0c525636aed53a3b38258efa2dff4c83edf
DIFF: https://github.com/llvm/llvm-project/commit/dc95d0c525636aed53a3b38258efa2dff4c83edf.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
index ee8fe0b37fce9..de76b4b00c360 100644
--- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
@@ -3,7 +3,13 @@ set(LLVM_LINK_COMPONENTS
   Support
   )
 
-if(LLVM_USE_HOST_TOOLS)
+set(CLANG_TIDY_CONFUSABLE_CHARS_GEN "clang-tidy-confusable-chars-gen" CACHE
+  STRING "Host clang-tidy-confusable-chars-gen executable. Saves building if cross-compiling.")
+
+if(NOT CLANG_TIDY_CONFUSABLE_CHARS_GEN STREQUAL "clang-tidy-confusable-chars-gen")
+  set(make_confusable_table ${CLANG_TIDY_CONFUSABLE_CHARS_GEN})
+  set(make_confusable_table_target ${CLANG_TIDY_CONFUSABLE_CHARS_GEN})
+elseif(LLVM_USE_HOST_TOOLS)
   build_native_tool(clang-tidy-confusable-chars-gen make_confusable_table)
   set(make_confusable_table_target "${make_confusable_table}")
 else()


        


More information about the cfe-commits mailing list