From: Felix Fietkau Date: Tue, 28 Nov 2023 21:09:24 +0000 (+0100) Subject: link librt if needed for shm_open X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e80dc00ee90c29ef56ae28f414b0e5bb361206e7;p=project%2Flibubox.git link librt if needed for shm_open Signed-off-by: Felix Fietkau --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a6ff58..74a87fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,9 +29,11 @@ SET_TARGET_PROPERTIES(ubox-static PROPERTIES OUTPUT_NAME ubox) SET(LIBS) CHECK_FUNCTION_EXISTS(clock_gettime HAVE_GETTIME) -IF(NOT HAVE_GETTIME) +CHECK_FUNCTION_EXISTS(shm_open HAVE_SHM) +IF(NOT HAVE_GETTIME OR NOT HAVE_SHM) CHECK_LIBRARY_EXISTS(rt clock_gettime "" NEED_GETTIME) - IF(NEED_GETTIME) + CHECK_LIBRARY_EXISTS(rt shm_open "" NEED_SHM) + IF(NEED_GETTIME OR NEED_SHM) TARGET_LINK_LIBRARIES(ubox rt) ENDIF() ENDIF()