kou commented on code in PR #49220:
URL: https://github.com/apache/arrow/pull/49220#discussion_r2850519168
##########
cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt:
##########
@@ -25,29 +25,51 @@ set(ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS
../../example/sqlite_server.cc
../../example/sqlite_tables_schema_batch_reader.cc)
+if(ARROW_TEST_LINKAGE STREQUAL "static")
+ set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static
+ ${ARROW_TEST_STATIC_LINK_LIBS})
+else()
+ set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_shared
+ ${ARROW_TEST_SHARED_LINK_LIBS})
+endif()
Review Comment:
Hmm. It seems that switching `STATIC_LINK_LIBS` and `EXTRA_LINK_LIBS` for
static/shared is strange...
Does this work?
```cmake
if(ARROW_TEST_LINKAGE STREQUAL "static")
set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static
${ARROW_TEST_LINK_LIBS})
else()
set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_shared
${ARROW_TEST_LINK_LIBS})
endif()
# ...
add_arrow_test(flight_sql_odbc_test
# ...
STATIC_LINK_LIBS ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}
EXTRA_LINK_LIBS ${ODBC_LIBRARIES} ...)
```
##########
.github/workflows/cpp_extra.yml:
##########
@@ -395,6 +414,10 @@ jobs:
export ARROW_CMAKE_ARGS="-DODBC_INCLUDE_DIR=$ODBC_INCLUDE_DIR"
export CXXFLAGS="$CXXFLAGS -I$ODBC_INCLUDE_DIR"
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
+ - name: Check ODBC Dependency
+ run: |
+ # ODBC dependency should not include Arrow or third party libraries
+ ! otool -L $(pwd)/build/cpp/debug/libarrow_flight_sql_odbc.dylib |
grep -Ei 'arrow_flight_sql\.|arrow_flight\.|arrow_compute|boost|iodbc|grpc'
Review Comment:
Can we use `archery linking check-dependencies`?
See also:
https://github.com/apache/arrow-java/blob/39b0593ac53c1444d0eb05f698fc3c0aa300f30b/ci/scripts/jni_macos_build.sh#L97-L115
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]