prefer to link against libjson-c over libjson (the new library name in git versions...
[project/netifd.git] / CMakeLists.txt
index adb2c07..2076fc9 100644 (file)
@@ -11,13 +11,16 @@ IF(APPLE)
 ENDIF()
 
 SET(SOURCES
-       main.c utils.c
+       main.c utils.c system.c tunnel.c
        interface.c interface-ip.c interface-event.c
        proto.c proto-static.c proto-shell.c
-       config.c device.c bridge.c vlan.c ubus.c)
+       config.c device.c bridge.c vlan.c alias.c
+       ubus.c)
 
+
+find_library(json NAMES json-c json)
 SET(LIBS
-       ubox ubus uci json blobmsg_json)
+       ubox ubus uci ${json} blobmsg_json)
 
 IF (NOT DEFINED LIBNL_LIBS)
   SET(LIBNL_LIBS -lnl)
@@ -33,6 +36,9 @@ ENDIF()
 
 IF(DEBUG)
   ADD_DEFINITIONS(-DDEBUG -g3)
+  IF(NO_OPTIMIZE)
+    ADD_DEFINITIONS(-O0)
+  ENDIF()
 ENDIF()