|
|
|
@ -7,6 +7,7 @@ include(CheckLibraryExists)
|
|
|
|
|
|
|
|
|
|
add_definitions(-DUNIX)
|
|
|
|
|
add_definitions(-DPOSIX)
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix.c)
|
|
|
|
|
|
|
|
|
|
if (STATIC_LINK_RUNTIME OR STATIC_LINK)
|
|
|
|
|
set(LIBUV_USE_STATIC ON)
|
|
|
|
@ -30,7 +31,7 @@ endif()
|
|
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
|
set(FS_LIB stdc++fs)
|
|
|
|
|
get_filename_component(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-linux.c ABSOLUTE)
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-linux.c)
|
|
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
|
|
|
|
|
find_library(FS_LIB NAMES c++fs c++experimental stdc++fs)
|
|
|
|
|
if(FS_LIB STREQUAL FS_LIB-NOTFOUND)
|
|
|
|
@ -38,14 +39,14 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
|
|
|
|
|
add_definitions(-DLOKINET_USE_CPPBACKPORT)
|
|
|
|
|
set(FS_LIB cppbackport)
|
|
|
|
|
endif()
|
|
|
|
|
get_filename_component(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-linux.c ABSOLUTE)
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-linux.c)
|
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
|
|
|
|
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-openbsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-openbsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
|
|
|
|
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-netbsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-netbsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
|
|
|
|
|
find_library(FS_LIB NAMES c++experimental)
|
|
|
|
|
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-freebsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-freebsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "iOS")
|
|
|
|
|
find_library(FS_LIB NAMES c++fs c++experimental stdc++fs)
|
|
|
|
|
if(FS_LIB STREQUAL FS_LIB-NOTFOUND)
|
|
|
|
@ -53,9 +54,9 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "i
|
|
|
|
|
add_definitions(-DLOKINET_USE_CPPBACKPORT)
|
|
|
|
|
set(FS_LIB cppbackport)
|
|
|
|
|
endif()
|
|
|
|
|
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-darwin.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-darwin.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
|
|
|
|
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-sunos.c)
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-sunos.c)
|
|
|
|
|
# Apple C++ screws up name decorations in stdc++fs, causing link to fail
|
|
|
|
|
# Samsung does not build c++experimental or c++fs in their Apple libc++ pkgsrc build
|
|
|
|
|
if (LIBUV_USE_STATIC)
|
|
|
|
|