FIND_LIBRARY(libjson NAMES json-c json)
OPTION(UBUS_SUPPORT "enable ubus support" ON)
+OPTION(VXLAN_SUPPORT "enable VXLAN support" ON)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
FIND_LIBRARY(nl nl-tiny)
+ SET(SOURCES ${SOURCES} wg-linux.c)
+ELSE()
+ SET(nl "")
+ SET(VXLAN_SUPPORT OFF)
+ENDIF()
+IF(VXLAN_SUPPORT)
find_library(bpf NAMES bpf)
find_library(elf NAMES elf)
find_library(zlib NAMES z)
- SET(SOURCES ${SOURCES} wg-linux.c vxlan.c bpf.c rtnl.c)
+ SET(SOURCES ${SOURCES} bpf.c vxlan.c rtnl.c)
+ ADD_DEFINITIONS(-DVXLAN_SUPPORT)
ELSE()
- SET(nl "")
SET(bpf "")
SET(elf "")
SET(zlib "")
ENDIF()
+
IF(UBUS_SUPPORT)
SET(SOURCES ${SOURCES} ubus.c)
ADD_DEFINITIONS(-DUBUS_SUPPORT=1)
s->type = strcpy(type_buf, type);
if (config)
s->config = memcpy(config_buf, config, blob_pad_len(config));
-#ifdef linux
+#ifdef VXLAN_SUPPORT
if (type && !strcmp(type, "vxlan"))
s->ops = &vxlan_ops;
#endif