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 e8a85dcb0d GH-44994: [C++][CMake] Use librt only for Linux (#44984)
e8a85dcb0d is described below
commit e8a85dcb0d147a4768d141fff6312b1eaf1a27a2
Author: Brad Smith <[email protected]>
AuthorDate: Tue Dec 10 20:54:42 2024 -0500
GH-44994: [C++][CMake] Use librt only for Linux (#44984)
### Rationale for this change
OpenBSD does not have `librt.so`.
### What changes are included in this PR?
Use `librt.so` only for Linux
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.
* GitHub Issue: #44994
Lead-authored-by: Brad Smith <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/arrow/CMakeLists.txt | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index fac4d67c79..6e2294371e 100644
--- a/cpp/src/arrow/CMakeLists.txt
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -166,8 +166,7 @@ if(WIN32)
list(APPEND ARROW_SYSTEM_LINK_LIBS "ws2_32")
endif()
-if(NOT WIN32 AND NOT APPLE)
- # Pass -lrt on Linux only
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND ARROW_SYSTEM_LINK_LIBS rt)
endif()