mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
commit
c1e4365d1d
|
@ -25,11 +25,11 @@ if(NOT WIN32)
|
||||||
message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====")
|
message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
|
||||||
endif()
|
endif()
|
||||||
find_package(SODIUM REQUIRED)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT USE_NACL)
|
if(NOT USE_NACL)
|
||||||
set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARY})
|
find_package(SODIUM REQUIRED)
|
||||||
|
set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
macro(linkCoreLibraries exe_name)
|
macro(linkCoreLibraries exe_name)
|
||||||
|
|
|
@ -26,11 +26,12 @@ set(_SODIUM_ROOT_HINTS
|
||||||
|
|
||||||
set(_SODIUM_ROOT_PATHS
|
set(_SODIUM_ROOT_PATHS
|
||||||
"$ENV{PROGRAMFILES}/sodium"
|
"$ENV{PROGRAMFILES}/sodium"
|
||||||
|
"${CMAKE_SOURCE_DIR}/sodium"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_path(SODIUM_ROOT_DIR
|
find_path(SODIUM_ROOT_DIR
|
||||||
NAMES
|
NAMES
|
||||||
include/cmocka.h
|
include/sodium.h
|
||||||
HINTS
|
HINTS
|
||||||
${_SODIUM_ROOT_HINTS}
|
${_SODIUM_ROOT_HINTS}
|
||||||
PATHS
|
PATHS
|
||||||
|
@ -48,6 +49,7 @@ find_path(SODIUM_INCLUDE_DIR
|
||||||
find_library(SODIUM_LIBRARY
|
find_library(SODIUM_LIBRARY
|
||||||
NAMES
|
NAMES
|
||||||
sodium
|
sodium
|
||||||
|
libsodium.a
|
||||||
PATHS
|
PATHS
|
||||||
${SODIUM_ROOT_DIR}/lib
|
${SODIUM_ROOT_DIR}/lib
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,3 +18,7 @@ set(core_sources
|
||||||
|
|
||||||
add_library(toxcore SHARED ${core_sources})
|
add_library(toxcore SHARED ${core_sources})
|
||||||
target_link_libraries(toxcore ${SODIUM_LIBRARY})
|
target_link_libraries(toxcore ${SODIUM_LIBRARY})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(toxcore ws2_32)
|
||||||
|
endif()
|
||||||
|
|
|
@ -8,11 +8,10 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/DHT_test.cmake)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testclient.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testclient.cmake)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testserver.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testserver.cmake)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Messenger_test.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Messenger_test.cmake)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox_win32.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox_win32.cmake)
|
||||||
endif()
|
else()
|
||||||
|
|
||||||
if(NOT WIN32)
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox.cmake)
|
||||||
add_subdirectory(toxic)
|
add_subdirectory(toxic)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user