Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMake] Fix the static bindings workflow. #13

Merged
merged 1 commit into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lldb/cmake/caches/Apple-lldb-Linux.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
include(${CMAKE_CURRENT_LIST_DIR}/Apple-lldb-base.cmake)

# Begin Swift Mods
set(LLDB_ALLOW_STATIC_BINDINGS ON CACHE BOOL "")
# End Swift Mods

set(LLVM_DISTRIBUTION_COMPONENTS
lldb
liblldb
Expand Down
4 changes: 4 additions & 0 deletions lldb/cmake/caches/Apple-lldb-base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ set(LLVM_ENABLE_MODULES OFF CACHE BOOL "")

set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
set(LIBCXX_ENABLE_STATIC OFF CACHE BOOL "")

# Begin Swift Mods
set(LLDB_USE_STATIC_BINDINGS ON CACHE BOOL "")
# End Swift Mods
2 changes: 1 addition & 1 deletion lldb/cmake/modules/LLDBConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Da

# BEGIN SWIFT MOD
option(LLDB_ENABLE_SWIFT_SUPPORT "Enable swift support" ON)
option(LLDB_ALLOW_STATIC_BINDINGS "Enable using static/baked language bindings if swig is not present." OFF)
option(LLDB_USE_STATIC_BINDINGS "Use the static Python bindings." OFF)
# END SWIFT CODE

if(LLDB_BUILD_FRAMEWORK)
Expand Down
22 changes: 12 additions & 10 deletions lldb/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ if(LLDB_BUILD_FRAMEWORK)
set(framework_arg --framework --target-platform Darwin)
endif()

find_package(SWIG)
if(${SWIG_FOUND})
set(SWIG_MIN_VERSION "2.0.0")
if (${SWIG_VERSION} VERSION_LESS ${SWIG_MIN_VERSION})
message(FATAL_ERROR "LLDB requires swig ${SWIG_MIN_VERSION}, your version is ${SWIG_VERSION}.")
endif()
set(PREPARE_BINDINGS_ARGS
"--swig-executable=${SWIG_EXECUTABLE}")
elseif(${LLDB_ALLOW_STATIC_BINDINGS})
if(${LLDB_USE_STATIC_BINDINGS})
set(PREPARE_BINDINGS_ARGS
--use-static-binding)
else()
message(FATAL_ERROR "swig not found and static bindings not permitted - install swig or specify -DLLDB_ALLOW_STATIC_BINDINGS=1")
find_package(SWIG)
if(${SWIG_FOUND})
set(SWIG_MIN_VERSION "2.0.0")
if (${SWIG_VERSION} VERSION_LESS ${SWIG_MIN_VERSION})
message(FATAL_ERROR "LLDB requires swig ${SWIG_MIN_VERSION}, your version is ${SWIG_VERSION}.")
endif()
set(PREPARE_BINDINGS_ARGS
"--swig-executable=${SWIG_EXECUTABLE}")
else()
message(FATAL_ERROR "LLDB requires swig ${SWIG_MIN_VERSION}. To use the static bindings instead use -DLLDB_USE_STATIC_BINDINGS=ON")
endif()
endif()

add_custom_command(
Expand Down