• 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 SET(LIBS
 28         ubox ubus uci json-c blobmsg_json)
 29 
 30 IF (NOT DEFINED LIBNL_LIBS)
 31         include(FindPkgConfig)
 32         pkg_search_module(LIBNL libnl-3.0 libnl-3 libnl nl-3 nl)
 33         IF (LIBNL_FOUND)
 34                 include_directories(${LIBNL_INCLUDE_DIRS})
 35                 SET(LIBNL_LIBS ${LIBNL_LIBRARIES})
 36         ENDIF()
 37 ENDIF()
 38 
 39 IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux" AND NOT DUMMY_MODE)
 40         SET(SOURCES ${SOURCES} system-linux.c)
 41         SET(LIBS ${LIBS} ${LIBNL_LIBS})
 42 ELSE()
 43         ADD_DEFINITIONS(-DDUMMY_MODE=1)
 44         SET(SOURCES ${SOURCES} system-dummy.c)
 45 ENDIF()
 46 
 47 IF(DEBUG)
 48   ADD_DEFINITIONS(-DDEBUG -g3)
 49   IF(NO_OPTIMIZE)
 50     ADD_DEFINITIONS(-O0)
 51   ENDIF()
 52 ENDIF()
 53 
 54 
 55 ADD_EXECUTABLE(netifd ${SOURCES})
 56 
 57 TARGET_LINK_LIBRARIES(netifd ${LIBS})
 58 
 59 INSTALL(TARGETS netifd
 60         RUNTIME DESTINATION sbin
 61 )

This page was automatically generated by LXR 0.3.1.  •  OpenWrt