Browse Source
Merge pull request #2307 from ideal/master
fix cmake build on macOS
pull/2310/head
Max Lv
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
14 additions and
0 deletions
-
cmake/configure.cmake
-
src/CMakeLists.txt
|
@ -18,6 +18,9 @@ include(CheckCSourceCompiles) |
|
|
set(CONNECT_IN_PROGRESS "EINPROGRESS") |
|
|
set(CONNECT_IN_PROGRESS "EINPROGRESS") |
|
|
set(CONNECT_IN_PROGRESS "EINPROGRESS" CACHE STRING "") |
|
|
set(CONNECT_IN_PROGRESS "EINPROGRESS" CACHE STRING "") |
|
|
|
|
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL Darwin) |
|
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "/usr/local/include" "/usr/include") |
|
|
|
|
|
endif () |
|
|
|
|
|
|
|
|
check_include_files(dlfcn.h HAVE_DLFCN_H) |
|
|
check_include_files(dlfcn.h HAVE_DLFCN_H) |
|
|
check_include_files(ev.h HAVE_EV_H) |
|
|
check_include_files(ev.h HAVE_EV_H) |
|
|
|
@ -86,6 +86,17 @@ set(SS_REDIR_SOURCE |
|
|
${SS_PLUGIN_SOURCE} |
|
|
${SS_PLUGIN_SOURCE} |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL Darwin) |
|
|
|
|
|
find_path(LIBSODIUM_INCLUDE_DIR sodium.h |
|
|
|
|
|
PATHS |
|
|
|
|
|
$ENV{LIBSODIUM_INCLUDE_DIR} |
|
|
|
|
|
$ENV{LIBSODIUM_DIR}/include |
|
|
|
|
|
/usr/local/libsodium/include |
|
|
|
|
|
/opt/libsodium/include |
|
|
|
|
|
/usr/local/include |
|
|
|
|
|
) |
|
|
|
|
|
include_directories(${LIBSODIUM_INCLUDE_DIR}) |
|
|
|
|
|
endif () |
|
|
|
|
|
|
|
|
if (WITH_STATIC) |
|
|
if (WITH_STATIC) |
|
|
find_library(LIBSODIUM libsodium.a) |
|
|
find_library(LIBSODIUM libsodium.a) |
|
|