Skip to content

Commit 423546d

Browse files
committed
Use targets instead of hard-coded dll regex
Add `RUNTIME ` removes `.lib` file Clean up
1 parent 0e4d03c commit 423546d

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

cpp/src/arrow/flight/sql/odbc/CMakeLists.txt

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
# GH-44792: Arrow will switch to C++ 20
2020
set(CMAKE_CXX_STANDARD 20)
2121

22-
add_custom_target(arrow_flight_sql_odbc)
23-
2422
if(WIN32)
2523
if(MSVC_VERSION GREATER_EQUAL 1900)
2624
set(ODBCINST legacy_stdio_definitions odbccp32 shlwapi)
@@ -114,30 +112,19 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER)
114112
# GH-47876 TODO: set up `flight_sql_odbc_lib` component for macOS Installer
115113
# GH-47877 TODO: set up `flight_sql_odbc_lib` component for Linux Installer
116114
if(WIN32)
117-
# -AL- note: below change may break local build if the odbc location is different.
118-
# `cpp_build.sh` sets build_dir=${2}/cpp.
119-
message(STATUS "-AL- BUILD_OUTPUT_ROOT_DIRECTORY CMAKE_BUILD_TYPE/: ${BUILD_OUTPUT_ROOT_DIRECTORY}${CMAKE_BUILD_TYPE}/")
120-
message(STATUS "-AL- BUILD_OUTPUT_ROOT_DIRECTORY cpp/CMAKE_BUILD_TYPE/: ${BUILD_OUTPUT_ROOT_DIRECTORY}cpp/${CMAKE_BUILD_TYPE}/")
121-
# install(DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}${CMAKE_BUILD_TYPE}/"
122-
install(DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}cpp/${CMAKE_BUILD_TYPE}/"
123-
DESTINATION bin
124-
COMPONENT flight_sql_odbc_lib
125-
FILES_MATCHING
126-
# Use regex for dll name patterns with versions
127-
PATTERN "abseil_dll.dll"
128-
PATTERN "arrow.dll"
129-
PATTERN "arrow_compute.dll"
130-
PATTERN "arrow_flight.dll"
131-
PATTERN "arrow_flight_sql.dll"
132-
PATTERN "arrow_flight_sql_odbc.dll"
133-
PATTERN "boost_locale*.dll"
134-
PATTERN "cares.dll"
135-
PATTERN "libcrypto*.dll"
136-
PATTERN "libprotobuf.dll"
137-
PATTERN "libssl*.dll"
138-
PATTERN "re2.dll"
139-
PATTERN "utf8proc.dll"
140-
PATTERN "zlib1.dll")
115+
# Install ODBC and its Arrow dependencies
116+
install(TARGETS arrow_shared
117+
arrow_compute_shared
118+
arrow_flight_shared
119+
arrow_flight_sql_shared
120+
arrow_flight_sql_odbc_shared
121+
RUNTIME_DEPENDENCIES
122+
PRE_EXCLUDE_REGEXES
123+
"api-ms-.*"
124+
"ext-ms-.*"
125+
POST_EXCLUDE_REGEXES
126+
".*system32/.*\\.dll"
127+
RUNTIME DESTINATION bin COMPONENT flight_sql_odbc_lib)
141128

142129
set(CPACK_WIX_EXTRA_SOURCES
143130
"${CMAKE_CURRENT_SOURCE_DIR}/install/windows/arrow-flight-sql-odbc.wxs")

0 commit comments

Comments
 (0)