summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-12-08 15:32:57 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-12-21 11:28:41 -0800
commitbf03e17c570171c7a52117fe63ace89d58f328d5 (patch)
tree8361b20a3a9569ef8cf70fed5033e24c414e99c7 /lldb/source/API
parent2203089a60d826e882e2ccfc5cc5d361b4f91078 (diff)
downloadbcm5719-llvm-bf03e17c570171c7a52117fe63ace89d58f328d5.tar.gz
bcm5719-llvm-bf03e17c570171c7a52117fe63ace89d58f328d5.zip
[Lldb/Lua] Generate Lua Bindings
This patch uses SWIG to generate the Lua bindings for the SB API. It covers most of the API, but some methods require a type map similar to Python. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html Differential revision: https://reviews.llvm.org/D71235
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 1a99a26dfc4..7b9d4cb61e2 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -9,6 +9,11 @@ if(LLDB_ENABLE_PYTHON)
set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp)
endif()
+if(LLDB_ENABLE_LUA)
+ get_target_property(lldb_scripts_dir swig_wrapper_lua BINARY_DIR)
+ set(lldb_lua_wrapper ${lldb_scripts_dir}/LLDBWrapLua.cpp)
+endif()
+
if(LLDB_BUILD_FRAMEWORK)
set(option_install_prefix INSTALL_PREFIX ${LLDB_FRAMEWORK_INSTALL_DIR})
set(option_framework FRAMEWORK)
@@ -85,6 +90,7 @@ add_lldb_library(liblldb SHARED ${option_framework}
SBUnixSignals.cpp
SystemInitializerFull.cpp
${lldb_python_wrapper}
+ ${lldb_lua_wrapper}
LINK_LIBS
lldbBase
@@ -130,6 +136,19 @@ if(lldb_python_wrapper)
endif ()
endif()
+if(lldb_lua_wrapper)
+ add_dependencies(liblldb swig_wrapper_lua)
+ target_include_directories(liblldb PRIVATE ${LUA_INCLUDE_DIR})
+
+ if (MSVC)
+ set_property(SOURCE ${lldb_lua_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
+ else()
+ set_property(SOURCE ${lldb_lua_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
+ endif()
+
+ set_source_files_properties(${lldb_lua_wrapper} PROPERTIES GENERATED ON)
+endif()
+
set_target_properties(liblldb
PROPERTIES
VERSION ${LLDB_VERSION}
OpenPOWER on IntegriCloud