Skip to content

Commit d657ed1

Browse files
rossburtonkraj
authored andcommitted
[clang] Only build clang-tblgen if it is actually needed
It's possible to build clang with an existing clang-tblgen (common when cross-compiling, for instance) by setting CLANG_TABLEGEN_EXE. If this is the case there's no need to build it, as it won't be used. Upstream-Status: Submitted [llvm#161952] Signed-off-by: Ross Burton <[email protected]> Signed-off-by: Khem Raj <[email protected]>
1 parent 4adea6f commit d657ed1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,9 @@ option(CLANG_ENABLE_HLSL "Include HLSL build products" Off)
479479
# While HLSL support is experimental this should stay hidden.
480480
mark_as_advanced(CLANG_ENABLE_HLSL)
481481

482-
add_subdirectory(utils/TableGen)
482+
if (NOT DEFINED CLANG_TABLEGEN_EXE OR CLANG_INCLUDE_TESTS)
483+
add_subdirectory(utils/TableGen)
484+
endif()
483485

484486
# Export CLANG_TABLEGEN_EXE for use by flang docs.
485487
set(CLANG_TABLEGEN_EXE "${CLANG_TABLEGEN_EXE}" CACHE INTERNAL "")

0 commit comments

Comments
 (0)