Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2023-11-29 00:09:24 +0300
committerFelix Fietkau <nbd@nbd.name>2023-11-29 00:10:43 +0300
commite80dc00ee90c29ef56ae28f414b0e5bb361206e7 (patch)
treec239453d70b348bf384aa18a473f73266898acc2
parent260ad5bd1566ce08753df743292680afa74bd06f (diff)
link librt if needed for shm_open
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
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()