Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

96 lines
3.7 KiB
CMake

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapLua.cpp
DEPENDS ${SWIG_SOURCES}
DEPENDS ${SWIG_INTERFACES}
DEPENDS ${SWIG_HEADERS}
DEPENDS lldb-sbapi-dwarf-enums
COMMAND ${SWIG_EXECUTABLE}
${SWIG_COMMON_FLAGS}
-I${CMAKE_CURRENT_SOURCE_DIR}
-lua
-w503
-outdir ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapLua.cpp
${CMAKE_CURRENT_SOURCE_DIR}/lua.swig
VERBATIM
COMMENT "Building LLDB Lua wrapper")
add_custom_target(swig_wrapper_lua ALL DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapLua.cpp
)
function(create_lua_package swig_target working_dir pkg_dir)
cmake_parse_arguments(ARG "NOINIT" "" "FILES" ${ARGN})
add_custom_command(TARGET ${swig_target} POST_BUILD VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory ${pkg_dir}
WORKING_DIRECTORY ${working_dir})
endfunction()
function(finish_swig_lua swig_target lldb_lua_bindings_dir lldb_lua_target_dir)
add_custom_target(${swig_target} ALL VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory ${lldb_lua_target_dir}
DEPENDS swig_wrapper_lua liblldb
COMMENT "LLDB Lua API")
if (LLDB_ENABLE_DYNAMIC_SCRIPTINTERPRETERS)
# The SWIG wrapper lives in the plugin library in this mode.
set(liblldb_filename "liblldbPluginScriptInterpreterLua${CMAKE_SHARED_LIBRARY_SUFFIX}")
elseif (LLDB_BUILD_FRAMEWORK)
set(liblldb_filename "LLDB")
else()
set(liblldb_filename "liblldb${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
if(LLDB_BUILD_FRAMEWORK)
set(LIBLLDB_SYMLINK_DEST "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/${liblldb_filename}")
else()
set(LIBLLDB_SYMLINK_DEST "${LLVM_SHLIB_OUTPUT_INTDIR}/${liblldb_filename}")
endif()
if(WIN32)
set(LIBLLDB_SYMLINK_OUTPUT_FILE "lldb.dll")
else()
set(LIBLLDB_SYMLINK_OUTPUT_FILE "lldb.so")
endif()
create_relative_symlink(${swig_target} ${LIBLLDB_SYMLINK_DEST}
${lldb_lua_target_dir} ${LIBLLDB_SYMLINK_OUTPUT_FILE})
set(lldb_lua_library_target "${swig_target}-library")
add_custom_target(${lldb_lua_library_target})
add_dependencies(${lldb_lua_library_target} ${swig_target})
# Ensure we do the Lua post-build step when building lldb.
add_dependencies(lldb ${swig_target})
if(LLDB_BUILD_FRAMEWORK)
set(LLDB_LUA_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Resources/Lua)
else()
set(LLDB_LUA_INSTALL_PATH ${LLDB_LUA_RELATIVE_PATH})
endif()
install(DIRECTORY ${lldb_lua_target_dir}/
DESTINATION ${LLDB_LUA_INSTALL_PATH}
COMPONENT ${lldb_lua_library_target})
set(lldb_lua_library_install_target "install-${lldb_lua_library_target}")
if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(${lldb_lua_library_install_target}
COMPONENT ${lldb_lua_library_target}
DEPENDS ${lldb_lua_library_target})
# Tools that link liblldb need the lua bindings installed alongside.
# The list is populated by add_lldb_executable.
get_property(lldb_liblldb_tools GLOBAL PROPERTY LLDB_TOOLS_LINKING_LIBLLDB)
foreach(tool ${lldb_liblldb_tools})
if(TARGET install-${tool})
add_dependencies(install-${tool} ${lldb_lua_library_install_target})
endif()
if(TARGET install-${tool}-stripped AND TARGET ${lldb_lua_library_install_target}-stripped)
add_dependencies(install-${tool}-stripped ${lldb_lua_library_install_target}-stripped)
endif()
endforeach()
endif()
endfunction()
function(add_lua_wrapper target)
get_target_property(lua_bindings_dir swig_wrapper_lua BINARY_DIR)
set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp)
add_dependencies(${target} swig_wrapper_lua)
add_swig_wrapper(${target} ${lldb_lua_wrapper})
endfunction()