-
Notifications
You must be signed in to change notification settings - Fork 0
Build ODBC statically on macOS #153
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
base: apache-odbc
Are you sure you want to change the base?
Changes from all commits
e4b4c69
9288a6f
711b3e0
eea27ba
f27dad7
7b72564
b80234c
51b8526
f6efc09
27f4573
f661478
2eb9a5d
88c7c96
aac357d
c1de9c8
10bf349
64fe7f9
7ed2f88
87cfd56
89466c0
d3c0914
3f098f1
b0f11c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1107,6 +1107,11 @@ function(build_boost) | |
| else() | ||
| list(APPEND BOOST_EXCLUDE_LIBRARIES uuid) | ||
| endif() | ||
| if(ARROW_FLIGHT_SQL_ODBC) | ||
| list(APPEND BOOST_INCLUDE_LIBRARIES beast xpressive) | ||
| else() | ||
| list(APPEND BOOST_EXCLUDE_LIBRARIES beast xpressive) | ||
| endif() | ||
| set(BOOST_SKIP_INSTALL_RULES ON) | ||
| if(NOT ARROW_ENABLE_THREADING) | ||
| set(BOOST_UUID_LINK_LIBATOMIC OFF) | ||
|
|
@@ -3024,8 +3029,8 @@ function(build_cares) | |
| if(APPLE) | ||
| # libresolv must be linked from c-ares version 1.16.1 | ||
| find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv REQUIRED) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this change, we have failed run with Fixes error: |
||
| set_target_properties(c-ares::cares PROPERTIES INTERFACE_LINK_LIBRARIES | ||
| "${LIBRESOLV_LIBRARY}") | ||
| set_target_properties(c-ares PROPERTIES INTERFACE_LINK_LIBRARIES | ||
| "${LIBRESOLV_LIBRARY}") | ||
| endif() | ||
|
|
||
| set(ARROW_BUNDLED_STATIC_LIBS | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| add_library(arrow_odbc_spi_impl | ||
| add_library(arrow_odbc_spi_impl STATIC | ||
| accessors/binary_array_accessor.cc | ||
| accessors/binary_array_accessor.h | ||
| accessors/boolean_array_accessor.cc | ||
|
|
@@ -133,8 +133,11 @@ endif() | |
| if(APPLE) | ||
| target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) | ||
| target_link_libraries(arrow_odbc_spi_impl | ||
| PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale | ||
| iodbc) | ||
| PUBLIC arrow_flight_sql_static | ||
| arrow_compute_static | ||
| Boost::locale | ||
| Boost::headers | ||
| RapidJSON) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need iodbc anymore? |
||
| else() | ||
| find_package(ODBC REQUIRED) | ||
| target_include_directories(arrow_odbc_spi_impl PUBLIC ${ODBC_INCLUDE_DIR}) | ||
|
|
@@ -143,14 +146,6 @@ else() | |
| ${ODBCINST}) | ||
| endif() | ||
|
|
||
| set_target_properties(arrow_odbc_spi_impl | ||
| PROPERTIES ARCHIVE_OUTPUT_DIRECTORY | ||
| ${CMAKE_BINARY_DIR}/$<CONFIG>/lib | ||
| LIBRARY_OUTPUT_DIRECTORY | ||
| ${CMAKE_BINARY_DIR}/$<CONFIG>/lib | ||
| RUNTIME_OUTPUT_DIRECTORY | ||
| ${CMAKE_BINARY_DIR}/$<CONFIG>/lib) | ||
|
|
||
| # CLI | ||
| add_executable(arrow_odbc_spi_impl_cli main.cc) | ||
| set_target_properties(arrow_odbc_spi_impl_cli | ||
|
|
@@ -159,6 +154,16 @@ set_target_properties(arrow_odbc_spi_impl_cli | |
| target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) | ||
|
|
||
| # Unit tests | ||
|
|
||
| # On Windows, dynamic linking ODBC is supported. | ||
| # On unix systems, static linking ODBC is supported, thus the library linking is static. | ||
| if(WIN32) | ||
| set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_shared) | ||
| else() | ||
| # unix | ||
| set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_static) | ||
| endif() | ||
|
|
||
| add_arrow_test(odbc_spi_impl_test | ||
| SOURCES | ||
| accessors/boolean_array_accessor_test.cc | ||
|
|
@@ -177,4 +182,4 @@ add_arrow_test(odbc_spi_impl_test | |
| util_test.cc | ||
| EXTRA_LINK_LIBS | ||
| arrow_odbc_spi_impl | ||
| arrow_flight_testing_shared) | ||
| ${ODBC_SPI_IMPL_TEST_LINK_LIBS}) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some blank lines for readability?