2020-05-30 14:50:26 +08:00
|
|
|
file(GLOB SWIG_INTERFACES interface/*.i)
|
2015-03-14 00:31:58 +08:00
|
|
|
file(GLOB_RECURSE SWIG_SOURCES *.swig)
|
2019-09-26 00:37:11 +08:00
|
|
|
file(GLOB SWIG_HEADERS
|
|
|
|
${LLDB_SOURCE_DIR}/include/lldb/API/*.h
|
|
|
|
${LLDB_SOURCE_DIR}/include/lldb/*.h
|
2015-05-29 01:25:34 +08:00
|
|
|
)
|
2019-09-26 02:17:45 +08:00
|
|
|
file(GLOB SWIG_PRIVATE_HEADERS
|
|
|
|
${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h
|
|
|
|
)
|
|
|
|
foreach(private_header ${SWIG_PRIVATE_HEADERS})
|
|
|
|
list(REMOVE_ITEM SWIG_HEADERS ${private_header})
|
|
|
|
endforeach()
|
2014-04-03 23:03:11 +08:00
|
|
|
|
2016-09-22 05:02:16 +08:00
|
|
|
if(LLDB_BUILD_FRAMEWORK)
|
|
|
|
set(framework_arg --framework --target-platform Darwin)
|
|
|
|
endif()
|
|
|
|
|
2019-09-26 00:37:11 +08:00
|
|
|
if(APPLE)
|
|
|
|
set(DARWIN_EXTRAS "-D__APPLE__")
|
|
|
|
else()
|
|
|
|
set(DARWIN_EXTRAS "")
|
|
|
|
endif()
|
|
|
|
|
2019-12-09 07:32:57 +08:00
|
|
|
set(SWIG_COMMON_FLAGS
|
|
|
|
-c++
|
|
|
|
-features autodoc
|
|
|
|
-I${LLDB_SOURCE_DIR}/include
|
|
|
|
-I${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-D__STDC_LIMIT_MACROS
|
|
|
|
-D__STDC_CONSTANT_MACROS
|
|
|
|
${DARWIN_EXTRAS}
|
2019-01-04 20:47:02 +08:00
|
|
|
)
|
|
|
|
|
2021-11-24 03:47:38 +08:00
|
|
|
function(create_relative_symlink swig_target dest_file output_dir output_name)
|
|
|
|
get_filename_component(dest_file ${dest_file} ABSOLUTE)
|
|
|
|
get_filename_component(output_dir ${output_dir} ABSOLUTE)
|
|
|
|
file(RELATIVE_PATH rel_dest_file ${output_dir} ${dest_file})
|
|
|
|
if(CMAKE_HOST_UNIX)
|
|
|
|
set(LLVM_LINK_OR_COPY create_symlink)
|
|
|
|
else()
|
|
|
|
set(LLVM_LINK_OR_COPY copy)
|
|
|
|
endif()
|
|
|
|
add_custom_command(TARGET ${swig_target} POST_BUILD VERBATIM
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} ${rel_dest_file} ${output_name}
|
|
|
|
WORKING_DIRECTORY ${output_dir})
|
|
|
|
endfunction()
|
|
|
|
|
2019-12-09 07:32:57 +08:00
|
|
|
if (LLDB_ENABLE_PYTHON)
|
2020-08-11 23:43:44 +08:00
|
|
|
add_subdirectory(python)
|
2019-12-09 07:32:57 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LLDB_ENABLE_LUA)
|
2020-08-11 23:43:44 +08:00
|
|
|
add_subdirectory(lua)
|
2019-12-09 07:32:57 +08:00
|
|
|
endif()
|