summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-09-19 11:18:19 +0200
committerGitHub <noreply@github.com>2021-09-19 11:18:19 +0200
commit0ea5ee8d78454191eb32251fce1b77b1a4c41c77 (patch)
tree5cdad08b66b6aae878eb0f236c79f9dc79a6248f /CMakeLists.txt
parent64e4f68cc70466f736b6ba98c5ec8c9800bee351 (diff)
parentdd86e1dadab228c1a20bdb5504d216706cdd8624 (diff)
Merge pull request #20 from jow-/lib-add-rtnl
lib: introduce Linux route netlink binding
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f8171d..935df68 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ 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)
+OPTION(RTNL_SUPPORT "Route Netlink plugin support" ON)
OPTION(LEGACY_SUPPORT "Support deprecated syntax features" ON)
@@ -114,6 +115,16 @@ IF(UCI_SUPPORT)
TARGET_LINK_LIBRARIES(uci_lib ${uci} ${ubox})
ENDIF()
+IF(RTNL_SUPPORT)
+ FIND_LIBRARY(nl NAMES nl-tiny)
+ FIND_PATH(nl_include_dir NAMES netlink/msg.h PATH_SUFFIXES libnl-tiny)
+ INCLUDE_DIRECTORIES(${nl_include_dir})
+ SET(LIBRARIES ${LIBRARIES} rtnl_lib)
+ ADD_LIBRARY(rtnl_lib MODULE lib/rtnl.c)
+ SET_TARGET_PROPERTIES(rtnl_lib PROPERTIES OUTPUT_NAME rtnl PREFIX "")
+ TARGET_LINK_LIBRARIES(rtnl_lib ${nl})
+ENDIF()
+
IF(UNIT_TESTING)
ENABLE_TESTING()
ADD_DEFINITIONS(-DUNIT_TESTING)