[Lldb-commits] [lldb] [lldb] Use Python script to generate SBLanguages.h (PR #90753)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon May 6 03:57:01 PDT 2024


================
@@ -20,9 +20,19 @@ if(LLDB_ENABLE_LUA)
   set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp)
 endif()
 
-lldb_tablegen(../../include/lldb/API/SBLanguages.h -gen-lldb-sbapi-dwarf-enum
-  SOURCE ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
-  TARGET lldb-sbapi-dwarf-enums)
+# Target to generate SBLanguages.h from Dwarf.def.
+set(sb_languages_file
+  ${CMAKE_CURRENT_BINARY_DIR}/../../include/lldb/API/SBLanguages.h)
+add_custom_target(
----------------
labath wrote:

I believe this should be using `add_custom_command`. Per the [cmake docs](https://cmake.org/cmake/help/latest/command/add_custom_target.html), `add_custom_target` "... has no output file and is always considered out of date even if the commands try to create a file with the name of the target". This causes an incremental clean build to always run this command and also rebuild anything that depends on it.

https://github.com/llvm/llvm-project/pull/90753


More information about the lldb-commits mailing list