summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 841b756a30b9d2ed3c2f4f3965cbd7c88f27038a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cmake_minimum_required(VERSION 2.6.0)
project(TOX C)

set(exe_name toxMessengerTest)

set(core_sources
        core/DHT.c
        core/network.c
        core/Lossless_UDP.c
        core/net_crypto.c
        core/Messenger.c)

set(test_sources
        testing/Messenger_test.c)

add_executable(${exe_name}
        ${core_sources}
        ${test_sources})

if(WIN32)
        include_directories(${TOX_SOURCE_DIR}/sodium/include/)
        target_link_libraries(${exe_name} ws2_32 
                ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a)
else()
        target_link_libraries(${exe_name} sodium)
endif()

if(CMAKE_COMPILER_IS_GNUCC)
        message(STATUS "==== GCC detected - Adding compiler flags ====")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
endif()