summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 9 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 505983f2..c16ce6fe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
1cmake_minimum_required(VERSION 2.6.0) 1cmake_minimum_required(VERSION 2.6.0)
2 2
3#MinGW prints more warnings for -Wall than gcc does, thus causing build to fail
3if(NOT WIN32) 4if(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,31 +8,21 @@ if(NOT WIN32)
7 endif() 8 endif()
8endif() 9endif()
9 10
10if(WIN32)
11 include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/)
12endif()
13
14set(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
21add_library(core ${core_sources})
22
23macro(linkCoreLibraries exe_name) 11macro(linkCoreLibraries exe_name)
12 add_dependencies(${exe_name} core)
24 if(WIN32) 13 if(WIN32)
25 target_link_libraries(${exe_name} core 14 include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/)
26 ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a 15 target_link_libraries(${exe_name} core
16 ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a
27 ws2_32) 17 ws2_32)
28 else() 18 else()
29 target_link_libraries(${exe_name} core 19 target_link_libraries(${exe_name} core
30 sodium) 20 sodium)
31 endif() 21 endif()
32endmacro() 22endmacro()
33 23
34cmake_policy(SET CMP0011 NEW) 24cmake_policy(SET CMP0011 NEW)
35 25
36ADD_SUBDIRECTORY(testing) 26add_subdirectory(core)
37ADD_SUBDIRECTORY(other) \ No newline at end of file 27add_subdirectory(testing)
28add_subdirectory(other) \ No newline at end of file