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


##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -968,6 +968,8 @@ if(NOT ARROW_BUILD_SHARED AND ARROW_BUILD_STATIC)
 
   string(APPEND ARROW_TESTING_PC_CFLAGS "${ARROW_TESTING_PC_CFLAGS_PRIVATE}")
   set(ARROW_TESTING_PC_CFLAGS_PRIVATE "")
+
+  string(APPEND ARROW_PC_LIBS_PRIVATE " -l${CMAKE_DL_LIBS}")

Review Comment:
   If we put this to this block, this flag isn't used when 
`-DARROW_BUILD_SHARED=ON -DARROW_BUILD_STATIC=ON` is used. Does this work?
   
   ```diff
   diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
   index c5449d9956..4329d66821 100644
   --- a/cpp/src/arrow/CMakeLists.txt
   +++ b/cpp/src/arrow/CMakeLists.txt
   @@ -140,9 +140,10 @@ if(ARROW_ENABLE_THREADING)
      list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS Threads::Threads)
    endif()
    
   -if(NOT MSVC_TOOLCHAIN)
   +if(CMAKE_DL_LIBS)
      list(APPEND ARROW_SHARED_INSTALL_INTERFACE_LIBS ${CMAKE_DL_LIBS})
      list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${CMAKE_DL_LIBS})
   +  string(APPEND ARROW_PC_LIBS_PRIVATE " -l${CMAKE_DL_LIBS}")
    endif()
    
    set(ARROW_TEST_LINK_TOOLCHAIN ${ARROW_GTEST_GMOCK} 
${ARROW_GTEST_GTEST_MAIN})
   ```



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