1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-09-20 02:30:40 +03:00
SoftEtherVPN/src/Mayaqua/CMakeLists.txt

48 lines
1.1 KiB
CMake
Raw Normal View History

file(GLOB SOURCES_MAYAQUA "*.c")
file(GLOB HEADERS_MAYAQUA "*.h")
add_library(mayaqua STATIC ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
target_include_directories(mayaqua PUBLIC .)
set_target_properties(mayaqua
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
)
find_package(OpenSSL REQUIRED)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
# In some cases libiconv is not included in libc
find_library(LIB_ICONV iconv)
2018-10-11 23:03:12 +03:00
if(HAVE_SYS_AUXV)
add_subdirectory(cpu_features)
endif()
target_include_directories(mayaqua PRIVATE cpu_features/include)
2018-10-11 23:03:12 +03:00
target_link_libraries(mayaqua OpenSSL::SSL OpenSSL::Crypto Threads::Threads ZLIB::ZLIB)
if(HAVE_SYS_AUXV)
target_link_libraries(mayaqua cpu_features)
else()
add_definitions(-DSKIP_CPU_FEATURES)
endif()
find_library(LIB_RT rt)
if(LIB_RT)
target_link_libraries(mayaqua rt)
endif()
if(LIB_ICONV)
target_link_libraries(mayaqua ${LIB_ICONV})
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
target_link_libraries(mayaqua nsl socket)
endif()