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>
This commit is contained in:
Jesse Talavera-Greenberg 2023-07-07 19:36:22 -04:00 committed by GitHub
parent 3c6359837d
commit d1ff103259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,7 +131,10 @@ endif()
if (WIN32) if (WIN32)
target_link_libraries(core PRIVATE ole32 comctl32 ws2_32) target_link_libraries(core PRIVATE ole32 comctl32 ws2_32)
elseif(NOT APPLE) 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() endif()
if (ENABLE_JIT_PROFILING) if (ENABLE_JIT_PROFILING)