[lldb] Respect previously set values of LLDB_TABLEGEN_EXE

If you set LLDB_TABLEGEN_EXE in a CMake cache file or in the CMake
invocation line, your setting isn't respected. Setting up the tablegen
for the host will overwrite the value that we set LLDB_TABLEGEN_EXE to,
which defeats the whole point of setting it in the first place.
This commit is contained in:
Alex Langford 2019-12-16 14:29:46 -08:00
parent 2ff251c6a3
commit 3fbe518a10
1 changed files with 13 additions and 11 deletions

View File

@ -1,16 +1,18 @@
# tablegen targets get exported via llvm for LLVMConfig.cmake. So standalone
# builds of lldb can potentially import this via LLVMConfig and also attempt to
# build it in tree. So only build it if it doesn't exist.
if (TARGET lldb-tblgen)
set(LLDB_TABLEGEN_EXE $<TARGET_FILE:lldb-tblgen> CACHE STRING "")
else()
set(LLVM_LINK_COMPONENTS Support)
if (NOT DEFINED LLDB_TABLEGEN_EXE)
if (TARGET lldb-tblgen)
set(LLDB_TABLEGEN_EXE $<TARGET_FILE:lldb-tblgen> CACHE STRING "")
else()
set(LLVM_LINK_COMPONENTS Support)
add_tablegen(lldb-tblgen LLDB
LLDBOptionDefEmitter.cpp
LLDBPropertyDefEmitter.cpp
LLDBTableGen.cpp
LLDBTableGenUtils.cpp
)
set_target_properties(lldb-tblgen PROPERTIES FOLDER "LLDB tablegenning")
add_tablegen(lldb-tblgen LLDB
LLDBOptionDefEmitter.cpp
LLDBPropertyDefEmitter.cpp
LLDBTableGen.cpp
LLDBTableGenUtils.cpp
)
set_target_properties(lldb-tblgen PROPERTIES FOLDER "LLDB tablegenning")
endif()
endif()