Skip to content

Commit

Permalink
Make linking librt conditional on it containing shm_open
Browse files Browse the repository at this point in the history
Fixes building on UNIX platforms with no librt.

Co-authored-by: Nadia Holmquist Pedersen <nadia@nhp.sh>
  • Loading branch information
JesseTG and nadiaholmquist authored Jul 7, 2023
1 parent 3c63598 commit d1ff103
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d1ff103

Please sign in to comment.