aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Talavera-Greenberg <jesse@jesse.tg>2023-07-07 19:36:22 -0400
committerGitHub <noreply@github.com>2023-07-08 01:36:22 +0200
commitd1ff103259bf44047b0da458cbd22d5e66a70773 (patch)
treee031508420c989c4ac33488c588c8b2802ba32f9
parent3c6359837ddd078fcfba9824f88b10b471d22a9b (diff)
Make linking librt conditional on it containing shm_open
Fixes building on UNIX platforms with no librt. Co-authored-by: Nadia Holmquist Pedersen <nadia@nhp.sh>
-rw-r--r--src/CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9676e2f..210e280 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -131,7 +131,10 @@ endif()
if (WIN32)
target_link_libraries(core PRIVATE ole32 comctl32 ws2_32)
elseif(NOT APPLE)
- target_link_libraries(core PRIVATE rt)
+ check_library_exists(rt shm_open "" NEED_LIBRT)
+ if (NEED_LIBRT)
+ target_link_libraries(core PRIVATE rt)
+ endif()
endif()
if (ENABLE_JIT_PROFILING)