ustream: prevent recursive calls to the read callback
[project/libubox.git] / CMakeLists.txt
index dcd455c02dfb36df7a52ab035e654af2452ee6d8..b0fca612537e43ab3b9fe4c01ea441b53fa4447f 100644 (file)
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.13)
 INCLUDE(CheckLibraryExists)
 INCLUDE(CheckFunctionExists)
 
@@ -21,7 +21,7 @@ IF(JSONC_FOUND)
   INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS})
 ENDIF()
 
-SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c safe_list.c runqueue.c md5.c kvlist.c ulog.c base64.c)
+SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c safe_list.c runqueue.c md5.c kvlist.c ulog.c base64.c udebug.c udebug-remote.c)
 
 ADD_LIBRARY(ubox SHARED ${SOURCES})
 ADD_LIBRARY(ubox-static STATIC ${SOURCES})
@@ -29,14 +29,17 @@ 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()
 
 FILE(GLOB headers *.h)
+LIST(FILTER headers EXCLUDE REGEX "-priv.h$" )
 INSTALL(FILES ${headers}
        DESTINATION include/libubox
 )
@@ -92,3 +95,9 @@ IF(EXISTS ${json})
        )
 
 ENDIF()
+
+IF(ABIVERSION)
+       SET_TARGET_PROPERTIES(ubox PROPERTIES VERSION ${ABIVERSION})
+       SET_TARGET_PROPERTIES(json_script PROPERTIES VERSION ${ABIVERSION})
+       SET_TARGET_PROPERTIES(blobmsg_json PROPERTIES VERSION ${ABIVERSION})
+ENDIF()