Skip to content
Open
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
21 changes: 19 additions & 2 deletions c/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ macro(define_option_string name description default)
endif()
endmacro()

# On Windows, we can't build both static and shared (they both generate a .lib), so disable static build
if(WIN32)
set(_STATIC_BUILD_DEFAULT OFF)
else()
set(_STATIC_BUILD_DEFAULT ON)
endif()
message(STATUS "Default static build: ${_STATIC_BUILD_DEFAULT}")

# Top level cmake dir
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
#----------------------------------------------------------------------
Expand All @@ -94,7 +102,7 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
define_option_string(ADBC_GO_BUILD_TAGS
"Build tags to append when compiling ADBC Go libraries" "")

define_option(ADBC_BUILD_STATIC "Build static libraries" ON)
define_option(ADBC_BUILD_STATIC "Build static libraries" "${_STATIC_BUILD_DEFAULT}")

define_option(ADBC_BUILD_SHARED "Build shared libraries" ON)

Expand Down Expand Up @@ -250,8 +258,17 @@ macro(validate_config)
endif()
endif()
endforeach()

endforeach()

# https://github.com/apache/arrow-adbc/issues/4581
# Don't allow building both static and shared libraries on Windows
# They both generate a .lib file, and so you get one or the other at random
if(WIN32
AND ADBC_BUILD_STATIC
AND ADBC_BUILD_SHARED)
message(FATAL_ERROR "Cannot enable both ADBC_BUILD_STATIC and ADBC_BUILD_SHARED on Windows"
)
endif()
endmacro()

macro(config_summary_message)
Expand Down
2 changes: 2 additions & 0 deletions ci/linux-packages/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ override_dh_auto_configure:
--buildsystem=cmake+ninja \
-- \
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
-DADBC_BUILD_SHARED=ON \
-DADBC_BUILD_STATIC=ON \
-DADBC_DRIVER_FLIGHTSQL=ON \
-DADBC_DRIVER_MANAGER=ON \
-DADBC_DRIVER_POSTGRESQL=ON \
Expand Down
2 changes: 2 additions & 0 deletions ci/linux-packages/yum/apache-arrow-adbc.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ cd c
%adbc_cmake \
-DCMAKE_BUILD_TYPE=${cmake_build_type} \
-G"Unix Makefiles" \
-DADBC_BUILD_SHARED=ON \
-DADBC_BUILD_STATIC=ON \
-DADBC_DRIVER_FLIGHTSQL=ON \
-DADBC_DRIVER_MANAGER=ON \
-DADBC_DRIVER_POSTGRESQL=ON \
Expand Down
Loading