This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 32885c91a1 GH-41340: [C++][CMake][Windows] Remove needless .dll suffix 
from link libraries (#41341)
32885c91a1 is described below

commit 32885c91a1c94f1c8530815f4d4b8fc068859de8
Author: Sutou Kouhei <[email protected]>
AuthorDate: Thu Apr 25 11:10:25 2024 +0900

    GH-41340: [C++][CMake][Windows] Remove needless .dll suffix from link 
libraries (#41341)
    
    ### Rationale for this change
    
    We should use `.lib` (import library) not `.dll` for linking. So `.dll` is 
wrong. (But it seems working... Why...?)
    
    ### What changes are included in this PR?
    
    Remove `.dll` from link libraries because CMake generates suitable link 
options from library name automatically:
    
    
https://cmake.org/cmake/help/latest/command/target_link_libraries.html#command:target_link_libraries
    
    > A plain library name: The generated link line will ask the linker to 
search for the library (e.g. `foo` becomes `-lfoo` or `foo.lib`).
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    Yes.
    * GitHub Issue: #41340
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/CMakeLists.txt           | 2 +-
 cpp/src/arrow/CMakeLists.txt | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index cc4df6d2fa..df83f56dd2 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -708,7 +708,7 @@ list(APPEND ARROW_TEST_LINK_LIBS ${ARROW_GTEST_GMOCK} 
${ARROW_GTEST_GTEST_MAIN})
 if(ARROW_BUILD_BENCHMARKS)
   set(ARROW_BENCHMARK_LINK_LIBS benchmark::benchmark_main 
${ARROW_TEST_LINK_LIBS})
   if(WIN32)
-    list(APPEND ARROW_BENCHMARK_LINK_LIBS Shlwapi.dll)
+    list(APPEND ARROW_BENCHMARK_LINK_LIBS shlwapi)
   endif()
 endif()
 
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 026bb5c77e..2ef82dd614 100644
--- a/cpp/src/arrow/CMakeLists.txt
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -163,7 +163,7 @@ if(CMAKE_THREAD_LIBS_INIT)
 endif()
 
 if(WIN32)
-  list(APPEND ARROW_SYSTEM_LINK_LIBS "ws2_32.dll")
+  list(APPEND ARROW_SYSTEM_LINK_LIBS "ws2_32")
 endif()
 
 if(NOT WIN32 AND NOT APPLE)
@@ -628,9 +628,9 @@ else()
   list(APPEND ARROW_TESTING_STATIC_INSTALL_INTERFACE_LIBS ArrowTesting::gtest)
 endif()
 if(WIN32)
-  list(APPEND ARROW_TESTING_SHARED_LINK_LIBS "ws2_32.dll")
-  list(APPEND ARROW_TESTING_STATIC_LINK_LIBS "ws2_32.dll")
-  list(APPEND ARROW_TESTING_STATIC_INSTALL_INTERFACE_LIBS "ws2_32.dll")
+  list(APPEND ARROW_TESTING_SHARED_LINK_LIBS "ws2_32")
+  list(APPEND ARROW_TESTING_STATIC_LINK_LIBS "ws2_32")
+  list(APPEND ARROW_TESTING_STATIC_INSTALL_INTERFACE_LIBS "ws2_32")
 endif()
 
 set(ARROW_TESTING_SRCS

Reply via email to