summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be8a394..45de57a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,6 +123,16 @@ IF(UBUS_SUPPORT)
SET_TARGET_PROPERTIES(ubus_lib PROPERTIES OUTPUT_NAME ubus PREFIX "")
TARGET_LINK_OPTIONS(ubus_lib PRIVATE ${UCODE_MODULE_LINK_OPTIONS})
TARGET_LINK_LIBRARIES(ubus_lib ${ubus} ${blobmsg_json})
+ FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test.c" "
+ #include <libubus.h>
+ int main() { return UBUS_STATUS_NO_MEMORY; }
+ ")
+ TRY_COMPILE(HAVE_NEW_UBUS_STATUS_CODES
+ ${CMAKE_BINARY_DIR}
+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test.c")
+ IF(HAVE_NEW_UBUS_STATUS_CODES)
+ ADD_DEFINITIONS(-DHAVE_NEW_UBUS_STATUS_CODES)
+ ENDIF()
ENDIF()
IF(UCI_SUPPORT)