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

Sources/mdnsd/CMakeLists.txt

  1 cmake_minimum_required(VERSION 2.6)
  2 
  3 PROJECT(umdns C)
  4 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
  5 
  6 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
  7 
  8 SET(SOURCES dns.c announce.c cache.c service.c util.c ubus.c interface.c)
  9 
 10 FIND_PATH(ubox_include_dir NAMES libubox/usock.h)
 11 FIND_PATH(ubus_include_dir NAMES libubus.h)
 12 INCLUDE_DIRECTORIES(${ubox_include_dir} ${ubus_include_dir})
 13 
 14 FIND_LIBRARY(ubox NAMES ubox)
 15 FIND_LIBRARY(ubus NAMES ubus)
 16 FIND_LIBRARY(blobmsg_json NAMES blobmsg_json)
 17 FIND_LIBRARY(json NAMES json json-c)
 18 
 19 SET(LIBS ${ubox} ${ubus} ${blobmsg_json} ${json} resolv)
 20 
 21 IF(DEBUG)
 22   ADD_DEFINITIONS(-DDEBUG -g3)
 23 ENDIF()
 24 
 25 ADD_LIBRARY(umdns-lib STATIC ${SOURCES})
 26 TARGET_LINK_LIBRARIES(umdns-lib ${LIBS})
 27 
 28 ADD_EXECUTABLE(umdns main.c)
 29 TARGET_LINK_LIBRARIES(umdns umdns-lib)
 30 
 31 IF(UNIT_TESTING)
 32   ENABLE_TESTING()
 33   ADD_SUBDIRECTORY(tests)
 34 
 35   IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
 36         ADD_LIBRARY(umdns-lib-san STATIC ${SOURCES})
 37         TARGET_COMPILE_OPTIONS(umdns-lib-san PRIVATE -g -fno-omit-frame-pointer -fsanitize=undefined,address,leak -fno-sanitize-recover=all)
 38     TARGET_LINK_OPTIONS(umdns-lib-san PRIVATE -fsanitize=undefined,address,leak)
 39         TARGET_LINK_LIBRARIES(umdns-lib-san ${LIBS})
 40 
 41     ADD_EXECUTABLE(umdns-san main.c ${SOURCES})
 42         TARGET_COMPILE_OPTIONS(umdns-san PRIVATE -g -fno-omit-frame-pointer -fsanitize=undefined,address,leak -fno-sanitize-recover=all)
 43     TARGET_LINK_OPTIONS(umdns-san PRIVATE -fsanitize=undefined,address,leak)
 44         TARGET_LINK_LIBRARIES(umdns-san umdns-lib-san)
 45   ENDIF()
 46 
 47 ENDIF()
 48 
 49 INSTALL(TARGETS umdns
 50         RUNTIME DESTINATION sbin
 51 )

This page was automatically generated by LXR 0.3.1.  •  OpenWrt