diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 505983f2..187c0794 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -1,5 +1,6 @@ | |||
1 | cmake_minimum_required(VERSION 2.6.0) | 1 | cmake_minimum_required(VERSION 2.6.0) |
2 | 2 | ||
3 | #MinGW prints more warnings for -Wall than gcc does, thus causing build to fail | ||
3 | if(NOT WIN32) | 4 | if(NOT WIN32) |
4 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) | 5 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) |
5 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") | 6 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") |
@@ -7,21 +8,10 @@ if(NOT WIN32) | |||
7 | endif() | 8 | endif() |
8 | endif() | 9 | endif() |
9 | 10 | ||
10 | if(WIN32) | ||
11 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) | ||
12 | endif() | ||
13 | |||
14 | set(core_sources | ||
15 | core/DHT.c | ||
16 | core/network.c | ||
17 | core/Lossless_UDP.c | ||
18 | core/net_crypto.c | ||
19 | core/Messenger.c) | ||
20 | |||
21 | add_library(core ${core_sources}) | ||
22 | |||
23 | macro(linkCoreLibraries exe_name) | 11 | macro(linkCoreLibraries exe_name) |
12 | add_dependencies(${exe_name} core) | ||
24 | if(WIN32) | 13 | if(WIN32) |
14 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) | ||
25 | target_link_libraries(${exe_name} core | 15 | target_link_libraries(${exe_name} core |
26 | ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a | 16 | ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a |
27 | ws2_32) | 17 | ws2_32) |
@@ -33,5 +23,6 @@ endmacro() | |||
33 | 23 | ||
34 | cmake_policy(SET CMP0011 NEW) | 24 | cmake_policy(SET CMP0011 NEW) |
35 | 25 | ||
36 | ADD_SUBDIRECTORY(testing) | 26 | add_subdirectory(core) |
37 | ADD_SUBDIRECTORY(other) \ No newline at end of file | 27 | add_subdirectory(testing) |
28 | add_subdirectory(other) \ No newline at end of file | ||