summaryrefslogtreecommitdiff
path: root/lldb/utils
diff options
context:
space:
mode:
authorAlex Langford <apl@fb.com>2019-12-16 14:29:46 -0800
committerAlex Langford <apl@fb.com>2019-12-16 14:31:42 -0800
commit3fbe518a102a344abbd837e364a404c0c695d183 (patch)
tree614c7935e8b85de607b7011454107ad4f074e4f8 /lldb/utils
parent2ff251c6a39c55377fbcb0a4786a1bc4f7a60dda (diff)
downloadllvm-3fbe518a102a344abbd837e364a404c0c695d183.tar.gz
[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.
Diffstat (limited to 'lldb/utils')
-rw-r--r--lldb/utils/TableGen/CMakeLists.txt24
1 files changed, 13 insertions, 11 deletions
diff --git a/lldb/utils/TableGen/CMakeLists.txt b/lldb/utils/TableGen/CMakeLists.txt
index 2e8aec1770af..47a6400b4287 100644
--- a/lldb/utils/TableGen/CMakeLists.txt
+++ b/lldb/utils/TableGen/CMakeLists.txt
@@ -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()