You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/vendor/CMakeLists.txt

29 lines
1.4 KiB
CMake

add_library(tuntap OBJECT
libtuntap-master/tuntap.cpp
libtuntap-master/tuntap_log.cpp)
get_target_property(nlohmann_inc nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(tuntap PRIVATE ../llarp ../include ${nlohmann_inc})
if(WIN32)
target_sources(tuntap PRIVATE libtuntap-master/tuntap-windows.c)
else()
target_sources(tuntap PRIVATE libtuntap-master/tuntap-unix.c)
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
target_sources(tuntap PRIVATE libtuntap-master/tuntap-unix-linux.c)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
target_sources(tuntap PRIVATE libtuntap-master/tuntap-unix-openbsd.c libtuntap-master/tuntap-unix-bsd.c)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
target_sources(tuntap PRIVATE libtuntap-master/tuntap-unix-netbsd.c libtuntap-master/tuntap-unix-bsd.c)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|DragonFly")
target_sources(tuntap PRIVATE libtuntap-master/tuntap-unix-freebsd.c libtuntap-master/tuntap-unix-bsd.c)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|iOS")
target_sources(tuntap PRIVATE libtuntap-master/tuntap-unix-darwin.c libtuntap-master/tuntap-unix-bsd.c)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
target_sources(tuntap PRIVATE libtuntap-master/tuntap-unix-sunos.c)
else()
message(FATAL_ERROR "Your operating system - ${CMAKE_SYSTEM_NAME} is not supported yet for libtuntap")
endif()
endif()