[Lldb-commits] [lldb] 3fbe518 - [lldb] Respect previously set values of LLDB_TABLEGEN_EXE

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 16 14:39:17 PST 2019


Author: Alex Langford
Date: 2019-12-16T14:31:42-08:00
New Revision: 3fbe518a102a344abbd837e364a404c0c695d183

URL: https://github.com/llvm/llvm-project/commit/3fbe518a102a344abbd837e364a404c0c695d183
DIFF: https://github.com/llvm/llvm-project/commit/3fbe518a102a344abbd837e364a404c0c695d183.diff

LOG: [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.

Added: 
    

Modified: 
    lldb/utils/TableGen/CMakeLists.txt

Removed: 
    


################################################################################
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()


        


More information about the lldb-commits mailing list