| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- include_directories(${CMAKE_CURRENT_BINARY_DIR})
- set(NCD_ADDITIONAL_SOURCES)
- if (BADVPN_USE_LINUX_RFKILL)
- list(APPEND NCD_ADDITIONAL_SOURCES
- NCDRfkillMonitor.c
- modules/net_backend_rfkill.c
- )
- endif ()
- if (BADVPN_USE_LINUX_INPUT)
- list(APPEND NCD_ADDITIONAL_SOURCES
- modules/sys_evdev.c
- )
- endif ()
- if (BADVPN_USE_INOTIFY)
- list(APPEND NCD_ADDITIONAL_SOURCES
- modules/sys_watch_directory.c
- )
- endif ()
- add_library(ncdtokenizer
- NCDConfigTokenizer.c
- )
- target_link_libraries(ncdtokenizer base)
- add_library(ncdvalue
- NCDValue.c
- )
- add_library(ncdval
- NCDVal.c
- )
- target_link_libraries(ncdval base)
- add_library(ncdvalcompat
- NCDValCompat.c
- )
- target_link_libraries(ncdvalcompat ncdvalue ncdval)
- add_library(ncdvaluegenerator
- NCDValueGenerator.c
- )
- target_link_libraries(ncdvaluegenerator base ncdvalue ncdval)
- add_library(ncdvalueparser
- NCDValueParser.c
- )
- target_link_libraries(ncdvalueparser base ncdvalue ncdval ncdtokenizer ncdvalcompat)
- add_library(ncdast
- NCDAst.c
- )
- target_link_libraries(ncdast ncdvalue)
- add_library(ncdconfigparser
- NCDConfigParser.c
- )
- target_link_libraries(ncdconfigparser base ncdtokenizer ncdast)
- add_library(ncdsugar
- NCDSugar.c
- )
- target_link_libraries(ncdsugar ncdast)
- add_library(ncdrequest
- NCDRequestClient.c
- )
- target_link_libraries(ncdrequest base system ncdvalue ncdvaluegenerator ncdvalueparser)
- add_library(ncdinterfacemonitor
- NCDInterfaceMonitor.c
- )
- target_link_libraries(ncdinterfacemonitor base system)
- add_executable(badvpn-ncd
- ncd.c
- NCDModule.c
- NCDModuleIndex.c
- NCDIfConfig.c
- NCDObject.c
- NCDInterpProcess.c
- NCDInterpProg.c
- NCDPlaceholderDb.c
- NCDMethodIndex.c
- BEventLock.c
- modules/command_template.c
- modules/event_template.c
- modules/var.c
- modules/list.c
- modules/depend.c
- modules/multidepend.c
- modules/dynamic_depend.c
- modules/concat.c
- modules/concatv.c
- modules/if.c
- modules/strcmp.c
- modules/regex_match.c
- modules/logical.c
- modules/sleep.c
- modules/print.c
- modules/blocker.c
- modules/run.c
- modules/runonce.c
- modules/daemon.c
- modules/spawn.c
- modules/call.c
- modules/imperative.c
- modules/ref.c
- modules/index.c
- modules/alias.c
- modules/process_manager.c
- modules/ondemand.c
- modules/foreach.c
- modules/choose.c
- modules/from_string.c
- modules/to_string.c
- modules/value.c
- modules/try.c
- modules/net_backend_waitdevice.c
- modules/net_backend_waitlink.c
- modules/net_backend_badvpn.c
- modules/net_backend_wpa_supplicant.c
- modules/net_up.c
- modules/net_dns.c
- modules/net_iptables.c
- modules/net_ipv4_addr.c
- modules/net_ipv4_route.c
- modules/net_ipv4_dhcp.c
- modules/net_ipv4_arp_probe.c
- modules/net_watch_interfaces.c
- modules/sys_watch_input.c
- modules/sys_watch_usb.c
- modules/sys_request_server.c
- modules/net_ipv6_wait_dynamic_addr.c
- modules/sys_request_client.c
- modules/exit.c
- modules/getargs.c
- modules/arithmetic.c
- modules/parse.c
- modules/valuemetic.c
- modules/file.c
- modules/netmask.c
- modules/implode.c
- modules/call2.c
- modules/assert.c
- modules/reboot.c
- modules/explode.c
- modules/net_ipv6_addr.c
- modules/net_ipv6_route.c
- modules/net_ipv4_addr_in_network.c
- modules/net_ipv6_addr_in_network.c
- ${NCD_ADDITIONAL_SOURCES}
- )
- target_link_libraries(badvpn-ncd system flow flowextra dhcpclient arpprobe ncdvalue ncdval ncdvalcompat ncdvaluegenerator ncdvalueparser ncdconfigparser ncdsugar udevmonitor ncdinterfacemonitor ncdrequest)
- if (BADVPN_USE_LINUX_INPUT)
- string(REPLACE " " ";" FLAGS_LIST "${CMAKE_C_FLAGS}")
- execute_process(COMMAND ${CMAKE_C_COMPILER} ${FLAGS_LIST} -E ${CMAKE_CURRENT_SOURCE_DIR}/include_linux_input.c
- RESULT_VARIABLE LINUX_INPUT_PREPROCESS_RESULT
- OUTPUT_VARIABLE LINUX_INPUT_PREPROCESS_OUTPUT)
- if (NOT LINUX_INPUT_PREPROCESS_RESULT EQUAL 0)
- message(FATAL_ERROR "failed to preprocess linux/input.h include")
- endif ()
- string(REGEX MATCH "\"(/[^\"]+/linux/input.h)\"" LINUX_INPUT_MATCH ${LINUX_INPUT_PREPROCESS_OUTPUT})
- if (NOT LINUX_INPUT_MATCH)
- message(FATAL_ERROR "failed to match preprocessor output for path of linux/input.h")
- endif ()
- set(LINUX_INPUT_H_PATH ${CMAKE_MATCH_1})
- message(STATUS "Generating linux_input_names.h from ${LINUX_INPUT_H_PATH}")
- execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/parse_linux_input.sh
- ${LINUX_INPUT_H_PATH}
- ${CMAKE_CURRENT_BINARY_DIR}/linux_input_names.h
- RESULT_VARIABLE LINUX_INPUT_PARSE_RESULT)
- if (NOT LINUX_INPUT_PARSE_RESULT EQUAL 0)
- message(FATAL_ERROR "failed to generate linux_input_names.h")
- endif ()
- endif ()
- install(
- TARGETS badvpn-ncd
- RUNTIME DESTINATION bin
- )
|