diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c792be4..8e4033d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ PROJECT(utpl C) ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-error=unused-variable -ffunction-sections -D_GNU_SOURCE) OPTION(FS_SUPPORT "Filesystem plugin support" ON) +OPTION(MATH_SUPPORT "Math plugin support" ON) OPTION(UBUS_SUPPORT "Ubus plugin support" ON) OPTION(UCI_SUPPORT "UCI plugin support" ON) @@ -50,11 +51,6 @@ SET_SOURCE_FILES_PROPERTIES("parser.c" PROPERTIES GENERATED TRUE COMPILE_FLAGS - ADD_EXECUTABLE(utpl main.c ast.c lexer.c parser.c eval.c lib.c) TARGET_LINK_LIBRARIES(utpl ${json}) -CHECK_FUNCTION_EXISTS(ceil CEIL_FUNCTION_EXISTS) -IF (NOT CEIL_FUNCTION_EXISTS) - TARGET_LINK_LIBRARIES(utpl m) -ENDIF() - CHECK_FUNCTION_EXISTS(dlopen DLOPEN_FUNCTION_EXISTS) IF (NOT DLOPEN_FUNCTION_EXISTS) TARGET_LINK_LIBRARIES(utpl dl) @@ -80,6 +76,16 @@ IF(FS_SUPPORT) SET_TARGET_PROPERTIES(fs_lib PROPERTIES OUTPUT_NAME lib/fs PREFIX "") ENDIF() +IF(MATH_SUPPORT) + SET(LIBRARIES ${LIBRARIES} math_lib) + ADD_LIBRARY(math_lib MODULE lib/math.c) + SET_TARGET_PROPERTIES(math_lib PROPERTIES OUTPUT_NAME lib/math PREFIX "") + CHECK_FUNCTION_EXISTS(ceil CEIL_FUNCTION_EXISTS) + IF (NOT CEIL_FUNCTION_EXISTS) + TARGET_LINK_LIBRARIES(math_lib m) + ENDIF() +ENDIF() + IF(UBUS_SUPPORT) SET(LIBRARIES ${LIBRARIES} ubus_lib) ADD_LIBRARY(ubus_lib MODULE lib/ubus.c) |