[clang-tools-extra] 830d158 - [pseudo] Add CLANG_PSEUDO_GEN cmake cache variable to avoid nested CMake invocation
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 3 11:50:12 PDT 2022
Author: Sam McCall
Date: 2022-06-03T20:48:55+02:00
New Revision: 830d158d2b7d2fa45f39fe12aa0b2ffc70c7e771
URL: https://github.com/llvm/llvm-project/commit/830d158d2b7d2fa45f39fe12aa0b2ffc70c7e771
DIFF: https://github.com/llvm/llvm-project/commit/830d158d2b7d2fa45f39fe12aa0b2ffc70c7e771.diff
LOG: [pseudo] Add CLANG_PSEUDO_GEN cmake cache variable to avoid nested CMake invocation
Similar to LLVM_TABLEGEN, CLANG_TABLEGEN variables
Differential Revision: https://reviews.llvm.org/D126717
Added:
Modified:
clang-tools-extra/pseudo/include/CMakeLists.txt
Removed:
################################################################################
diff --git a/clang-tools-extra/pseudo/include/CMakeLists.txt b/clang-tools-extra/pseudo/include/CMakeLists.txt
index aff866def493..92259594bce1 100644
--- a/clang-tools-extra/pseudo/include/CMakeLists.txt
+++ b/clang-tools-extra/pseudo/include/CMakeLists.txt
@@ -1,7 +1,13 @@
# The cxx.bnf grammar file
set(cxx_bnf ${CMAKE_CURRENT_SOURCE_DIR}/../lib/cxx.bnf)
-if(LLVM_USE_HOST_TOOLS)
+set(CLANG_PSEUDO_GEN "clang-pseudo-gen" CACHE
+ STRING "Host clang-pseudo-gen executable. Saves building if cross-compiling.")
+
+if(NOT CLANG_PSEUDO_GEN STREQUAL "clang-pseudo-gen")
+ set(pseudo_gen ${CLANG_PSEUDO_GEN})
+ set(pseudo_gen_target ${CLANG_PSEUDO_GEN})
+elseif(LLVM_USE_HOST_TOOLS)
build_native_tool(clang-pseudo-gen pseudo_gen)
set(pseudo_gen_target "${pseudo_gen}")
else()
More information about the cfe-commits
mailing list