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.
4if (NOT DEFINED LLDB_TABLEGEN_EXE)
5  if (TARGET lldb-tblgen)
6    set(LLDB_TABLEGEN_EXE $<TARGET_FILE:lldb-tblgen> CACHE STRING "")
7  else()
8    set(LLVM_LINK_COMPONENTS Support)
9
10    add_tablegen(lldb-tblgen LLDB
11      LLDBOptionDefEmitter.cpp
12      LLDBPropertyDefEmitter.cpp
13      LLDBTableGen.cpp
14      LLDBTableGenUtils.cpp
15      )
16    set_target_properties(lldb-tblgen PROPERTIES FOLDER "LLDB tablegenning")
17  endif()
18endif()
19