xref: /llvm-project/lldb/utils/TableGen/CMakeLists.txt (revision c3efb57655001896fac955f4d42657db42c836b0)
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  endif()
17endif()
18