Skip to content

Commit bd3e74c

Browse files
committed
Only build lldb-tblgen if it's not a current target
Summary: When doing standalone builds, you could potentially be building against an llvm which also built lldb. If this were the case, you'd be attempting to build this target twice. Reviewers: xiaobai Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D64847 llvm-svn: 366394
1 parent 9cdd215 commit bd3e74c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

lldb/utils/TableGen/CMakeLists.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
set(LLVM_LINK_COMPONENTS Support)
2-
3-
add_tablegen(lldb-tblgen LLDB
4-
LLDBOptionDefEmitter.cpp
5-
LLDBTableGen.cpp
6-
)
7-
set_target_properties(lldb-tblgen PROPERTIES FOLDER "LLDB tablegenning")
1+
# tablegen targets get exported via llvm for LLVMConfig.cmake. So standalone
2+
# builds of lldb can potentially import this via LLVMConfig and also attempt to
3+
# build it in tree. So only build it if it doesn't exist.
4+
if (TARGET lldb-tblgen)
5+
set(LLDB_TABLEGEN_EXE $<TARGET_FILE:lldb-tblgen> CACHE STRING "")
6+
else()
7+
set(LLVM_LINK_COMPONENTS Support)
88

9+
add_tablegen(lldb-tblgen LLDB
10+
LLDBOptionDefEmitter.cpp
11+
LLDBTableGen.cpp
12+
)
13+
set_target_properties(lldb-tblgen PROPERTIES FOLDER "LLDB tablegenning")
14+
endif()

0 commit comments

Comments
 (0)