diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-04 18:26:04 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-04 18:26:04 -0700 |
commit | c1e4365d1d39876f5cb088d7850ae6a3b53d9833 (patch) | |
tree | c4fc26c796dba87028f8d91c4d8df9e029d295d5 | |
parent | f6207efef1cf94b6373a5c55cc654deafe63459a (diff) | |
parent | f03dc44e97e993024e42b3a0915de6401d9cecb0 (diff) |
Merge pull request #330 from nurupo/master
Fixed Windows build
-rwxr-xr-x | CMakeLists.txt | 4 | ||||
-rw-r--r-- | cmake/FindSODIUM.cmake | 4 | ||||
-rw-r--r-- | core/CMakeLists.txt | 4 | ||||
-rw-r--r-- | testing/CMakeLists.txt | 5 |
4 files changed, 11 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 07098391..f2657fc5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -25,11 +25,11 @@ if(NOT WIN32) | |||
25 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") | 25 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") |
26 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") | 26 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") |
27 | endif() | 27 | endif() |
28 | find_package(SODIUM REQUIRED) | ||
29 | endif() | 28 | endif() |
30 | 29 | ||
31 | if(NOT USE_NACL) | 30 | if(NOT USE_NACL) |
32 | set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARY}) | 31 | find_package(SODIUM REQUIRED) |
32 | set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARY}) | ||
33 | endif() | 33 | endif() |
34 | 34 | ||
35 | macro(linkCoreLibraries exe_name) | 35 | macro(linkCoreLibraries exe_name) |
diff --git a/cmake/FindSODIUM.cmake b/cmake/FindSODIUM.cmake index fd6206ff..ff9bc27b 100644 --- a/cmake/FindSODIUM.cmake +++ b/cmake/FindSODIUM.cmake | |||
@@ -26,11 +26,12 @@ set(_SODIUM_ROOT_HINTS | |||
26 | 26 | ||
27 | set(_SODIUM_ROOT_PATHS | 27 | set(_SODIUM_ROOT_PATHS |
28 | "$ENV{PROGRAMFILES}/sodium" | 28 | "$ENV{PROGRAMFILES}/sodium" |
29 | "${CMAKE_SOURCE_DIR}/sodium" | ||
29 | ) | 30 | ) |
30 | 31 | ||
31 | find_path(SODIUM_ROOT_DIR | 32 | find_path(SODIUM_ROOT_DIR |
32 | NAMES | 33 | NAMES |
33 | include/cmocka.h | 34 | include/sodium.h |
34 | HINTS | 35 | HINTS |
35 | ${_SODIUM_ROOT_HINTS} | 36 | ${_SODIUM_ROOT_HINTS} |
36 | PATHS | 37 | PATHS |
@@ -48,6 +49,7 @@ find_path(SODIUM_INCLUDE_DIR | |||
48 | find_library(SODIUM_LIBRARY | 49 | find_library(SODIUM_LIBRARY |
49 | NAMES | 50 | NAMES |
50 | sodium | 51 | sodium |
52 | libsodium.a | ||
51 | PATHS | 53 | PATHS |
52 | ${SODIUM_ROOT_DIR}/lib | 54 | ${SODIUM_ROOT_DIR}/lib |
53 | ) | 55 | ) |
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 5bd496cb..c7016a49 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt | |||
@@ -18,3 +18,7 @@ set(core_sources | |||
18 | 18 | ||
19 | add_library(toxcore SHARED ${core_sources}) | 19 | add_library(toxcore SHARED ${core_sources}) |
20 | target_link_libraries(toxcore ${SODIUM_LIBRARY}) | 20 | target_link_libraries(toxcore ${SODIUM_LIBRARY}) |
21 | |||
22 | if(WIN32) | ||
23 | target_link_libraries(toxcore ws2_32) | ||
24 | endif() | ||
diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index abbc278e..f2a2e95e 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt | |||
@@ -8,11 +8,10 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/DHT_test.cmake) | |||
8 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testclient.cmake) | 8 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testclient.cmake) |
9 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testserver.cmake) | 9 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testserver.cmake) |
10 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Messenger_test.cmake) | 10 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Messenger_test.cmake) |
11 | |||
11 | if(WIN32) | 12 | if(WIN32) |
12 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox_win32.cmake) | 13 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox_win32.cmake) |
13 | endif() | 14 | else() |
14 | |||
15 | if(NOT WIN32) | ||
16 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox.cmake) | 15 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox.cmake) |
17 | add_subdirectory(toxic) | 16 | add_subdirectory(toxic) |
18 | endif() | 17 | endif() |