summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-08-03 16:53:58 +0200
committerJo-Philipp Wich <jo@mein.io>2021-09-15 20:33:22 +0200
commitcbae3cba1964ebf367dd84524c6403a308302ace (patch)
treea48e590d190cf0a78b784c3ff337247fdf6faf05 /CMakeLists.txt
parente6dd389d06d9d33195afcf77a740df072298959e (diff)
lib: introduce Linux route netlink binding
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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)