git: 31704f29a4b9 - stable/12 - Don't build lldb-tablegen if MK_LLDB=no

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 25 Dec 2021 11:55:51 UTC
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=31704f29a4b9a2524424a8b0ff9cb6e35fdeae3d

commit 31704f29a4b9a2524424a8b0ff9cb6e35fdeae3d
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-07-05 17:36:02 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-25 11:51:23 +0000

    Don't build lldb-tablegen if MK_LLDB=no
    
    Split out from D31060.
    
    Reviewed by:    emaste
    
    (cherry picked from commit c5d1d88a351abe869c436f4f70c85d4c29e6e98c)
---
 Makefile.inc1 | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index a90eaf5d66a5..e4ccf47efe04 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2189,14 +2189,17 @@ _localedef=	usr.bin/localedef
 # We need to build tblgen when we're building clang or lld, either as
 # bootstrap tools, or as the part of the normal build.
 .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \
-    ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no"
+    ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no" || \
+    ${MK_LLDB} != "no"
 _clang_tblgen= \
 	lib/clang/libllvmminimal \
-	usr.bin/clang/llvm-tblgen \
-	usr.bin/clang/clang-tblgen \
-	usr.bin/clang/lldb-tblgen
-# XXX: lldb-tblgen is not needed, if top-level MK_LLDB=no
-
+	usr.bin/clang/llvm-tblgen
+.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no"
+_clang_tblgen+=	usr.bin/clang/clang-tblgen
+.endif
+.if ${MK_LLDB} != "no"
+_clang_tblgen+=	usr.bin/clang/lldb-tblgen
+.endif
 ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal
 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal
 ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal