mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-15 20:51:35 +00:00
c135744b1d
Separate the CMake logic for Lua and Python to clearly distinguish between code specific to either scripting language and the code shared by both. What this patch does is: - Move Python specific code into the bindings/python subdirectory. - Move the Lua specific code into the bindings/lua subdirectory. - Add the _python suffix to Python specific functions/targets. - Fix a dependency issue that would check the binding instead of whether the scripting language is enabled. Note that this patch also changes where the bindings are generated, which might affect downstream projects that check them in. Differential revision: https://reviews.llvm.org/D85708
41 lines
856 B
CMake
41 lines
856 B
CMake
file(GLOB SWIG_INTERFACES interface/*.i)
|
|
file(GLOB_RECURSE SWIG_SOURCES *.swig)
|
|
file(GLOB SWIG_HEADERS
|
|
${LLDB_SOURCE_DIR}/include/lldb/API/*.h
|
|
${LLDB_SOURCE_DIR}/include/lldb/*.h
|
|
)
|
|
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()
|
|
|
|
if(LLDB_BUILD_FRAMEWORK)
|
|
set(framework_arg --framework --target-platform Darwin)
|
|
endif()
|
|
|
|
if(APPLE)
|
|
set(DARWIN_EXTRAS "-D__APPLE__")
|
|
else()
|
|
set(DARWIN_EXTRAS "")
|
|
endif()
|
|
|
|
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}
|
|
)
|
|
|
|
if (LLDB_ENABLE_PYTHON)
|
|
add_subdirectory(python)
|
|
endif()
|
|
|
|
if (LLDB_ENABLE_LUA)
|
|
add_subdirectory(lua)
|
|
endif()
|