From e8a85dcb0d147a4768d141fff6312b1eaf1a27a2 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Tue, 10 Dec 2024 20:54:42 -0500 Subject: [PATCH] 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 Co-authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- 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 fac4d67c79bb6..6e2294371e7a6 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()