Merge pull request #330 from nurupo/master

Fixed Windows build
This commit is contained in:
irungentoo 2013-08-04 18:26:04 -07:00
commit c1e4365d1d
4 changed files with 11 additions and 6 deletions

View File

@ -25,10 +25,10 @@ if(NOT WIN32)
message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
endif()
find_package(SODIUM REQUIRED)
endif()
if(NOT USE_NACL)
find_package(SODIUM REQUIRED)
set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARY})
endif()

View File

@ -26,11 +26,12 @@ set(_SODIUM_ROOT_HINTS
set(_SODIUM_ROOT_PATHS
"$ENV{PROGRAMFILES}/sodium"
"${CMAKE_SOURCE_DIR}/sodium"
)
find_path(SODIUM_ROOT_DIR
NAMES
include/cmocka.h
include/sodium.h
HINTS
${_SODIUM_ROOT_HINTS}
PATHS
@ -48,6 +49,7 @@ find_path(SODIUM_INCLUDE_DIR
find_library(SODIUM_LIBRARY
NAMES
sodium
libsodium.a
PATHS
${SODIUM_ROOT_DIR}/lib
)

View File

@ -18,3 +18,7 @@ set(core_sources
add_library(toxcore SHARED ${core_sources})
target_link_libraries(toxcore ${SODIUM_LIBRARY})
if(WIN32)
target_link_libraries(toxcore ws2_32)
endif()

View File

@ -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_testserver.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Messenger_test.cmake)
if(WIN32)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox_win32.cmake)
endif()
if(NOT WIN32)
else()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox.cmake)
add_subdirectory(toxic)
endif()