|
|
|
@ -29,21 +29,11 @@ if(EMBEDDED_CFG OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
|
link_libatomic()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
function(use_vendored_filesystem)
|
|
|
|
|
include_directories("${CMAKE_CURRENT_LIST_DIR}/../vendor/ghc-filesystem/include")
|
|
|
|
|
add_definitions(-DLOKINET_USE_GHC_FILESYSTEM)
|
|
|
|
|
set(FS_LIB "" PARENT_SCOPE)
|
|
|
|
|
message(STATUS "Using vendored ghc::filesystem")
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
|
set(FS_LIB stdc++fs)
|
|
|
|
|
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)
|
|
|
|
|
use_vendored_filesystem()
|
|
|
|
|
endif()
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-linux.c)
|
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-openbsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
@ -54,9 +44,6 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "
|
|
|
|
|
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)
|
|
|
|
|
use_vendored_filesystem()
|
|
|
|
|
endif()
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-darwin.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
|
|
|
|
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-unix-sunos.c)
|
|
|
|
@ -65,19 +52,10 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
|
|
|
|
if (LIBUV_USE_STATIC)
|
|
|
|
|
link_libraries(-lkstat -lsendfile)
|
|
|
|
|
endif()
|
|
|
|
|
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
|
use_vendored_filesystem()
|
|
|
|
|
else()
|
|
|
|
|
set(FS_LIB stdc++fs)
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
|
|
|
|
message(FATAL_ERROR "Your operating system - ${CMAKE_SYSTEM_NAME} is not supported yet")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(FS_LIB AND USE_VENDORED_FILESYSTEM)
|
|
|
|
|
use_vendored_filesystem()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(EXE_LIBS ${STATIC_LIB})
|
|
|
|
|
|
|
|
|
|
if(RELEASE_MOTTO)
|
|
|
|
|