• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/netifd/CMakeLists.txt

  1 cmake_minimum_required(VERSION 2.6)
  2 
  3 PROJECT(netifd C)
  4 
  5 IF(NOT ${CMAKE_VERSION} LESS 3.0)
  6   include(CheckCCompilerFlag)
  7   check_c_compiler_flag(-Wimplicit-fallthrough HAS_IMPLICIT_FALLTHROUGH)
  8 ENDIF()
  9 
 10 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-unknown-warning-option -Wno-format-truncation)
 11 
 12 IF(HAS_IMPLICIT_FALLTHROUGH)
 13   ADD_DEFINITIONS(-Wimplicit-fallthrough)
 14 ENDIF()
 15 
 16 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 17 
 18 SET(SOURCES
 19         main.c utils.c system.c tunnel.c handler.c
 20         interface.c interface-ip.c interface-event.c
 21         iprule.c proto.c proto-static.c proto-shell.c
 22         config.c device.c bridge.c veth.c vlan.c alias.c
 23         macvlan.c ubus.c vlandev.c wireless.c
 24         extdev.c bonding.c)
 25 
 26 
 27 FIND_LIBRARY(uci NAMES uci)
 28 FIND_LIBRARY(ubox NAMES ubox)
 29 FIND_LIBRARY(ubus NAMES ubus)
 30 FIND_LIBRARY(json NAMES json-c json)
 31 FIND_LIBRARY(blobmsg_json NAMES blobmsg_json)
 32 
 33 SET(LIBS ${ubox} ${ubus} ${uci} ${json} ${blobmsg_json})
 34 
 35 FIND_PATH(ubox_include_dir libubox/usock.h)
 36 INCLUDE_DIRECTORIES(${ubox_include_dir})
 37 
 38 IF (NOT DEFINED LIBNL_LIBS)
 39         include(FindPkgConfig)
 40         pkg_search_module(LIBNL libnl-3.0 libnl-3 libnl nl-3 nl)
 41         IF (LIBNL_FOUND)
 42                 include_directories(${LIBNL_INCLUDE_DIRS})
 43                 SET(LIBNL_LIBS ${LIBNL_LIBRARIES})
 44         ENDIF()
 45 ENDIF()
 46 
 47 IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux" AND NOT DUMMY_MODE)
 48         SET(SOURCES ${SOURCES} system-linux.c)
 49         SET(LIBS ${LIBS} ${LIBNL_LIBS})
 50 ELSE()
 51         ADD_DEFINITIONS(-DDUMMY_MODE=1)
 52         SET(SOURCES ${SOURCES} system-dummy.c)
 53 ENDIF()
 54 
 55 IF(DEBUG)
 56   ADD_DEFINITIONS(-DDEBUG -g3)
 57   IF(NO_OPTIMIZE)
 58     ADD_DEFINITIONS(-O0)
 59   ENDIF()
 60 ENDIF()
 61 
 62 
 63 ADD_EXECUTABLE(netifd ${SOURCES})
 64 
 65 TARGET_LINK_LIBRARIES(netifd ${LIBS})
 66 
 67 INSTALL(TARGETS netifd
 68         RUNTIME DESTINATION sbin
 69 )

This page was automatically generated by LXR 0.3.1.  •  OpenWrt