kou commented on code in PR #55604:
URL: https://github.com/apache/arrow/pull/55604#discussion_r4578302535


##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt:
##########
@@ -130,38 +130,36 @@ if(WIN32)
                          win_system_dsn.cc)
 endif()
 
-if(WIN32)
+# On macOS, always link Arrow libraries statically.
+# On Windows and Linux, link Arrow libraries dynamically if the shared 
libraries are
+# built, and statically otherwise.
+if(NOT APPLE)

Review Comment:
   How about using `if(APPLE) ... else() ... endif()` instead of `if(NOT APPLE) 
... else() ... endif()` for readability? I want to avoid a negative condition 
such as `if(NOT ...)` as much as possible.



##########
.github/workflows/cpp_extra.yml:
##########
@@ -529,10 +530,21 @@ jobs:
           sudo sysctl -w vm.mmap_rnd_bits=28
           source ci/scripts/util_enable_core_dumps.sh
           archery docker run ubuntu-cpp-odbc
+      - name: Check ODBC Dependency
+        run: |
+          # The ODBC driver should link Arrow libraries dynamically on Linux
+          lib="$(pwd)/build/cpp/release/libarrow_flight_sql_odbc.so"
+          ldd "${lib}"
+          for arrow_lib in libarrow libarrow_compute libarrow_flight 
libarrow_flight_sql; do
+            ldd "${lib}" | grep -Fq "${arrow_lib}.so" || {
+              echo "Error: ${arrow_lib} is not dynamically linked to ${lib}"
+              exit 1
+            }
+          done

Review Comment:
   We don't need this check here. Using shared library is important in deb/RPM 
packages not normal builds.



-- 
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]

Reply via email to