diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 6ddd5b9b..420308d8 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -6,12 +6,12 @@ if(WIN32) endif() set(core_sources - DHT.c - network.c - Lossless_UDP.c - net_crypto.c - friend_requests.c - LAN_discovery.c - Messenger.c) + DHT.c + network.c + Lossless_UDP.c + net_crypto.c + friend_requests.c + LAN_discovery.c + Messenger.c) add_library(core ${core_sources}) diff --git a/core/network.c b/core/network.c index 3cd53ef7..a7a4efcd 100644 --- a/core/network.c +++ b/core/network.c @@ -169,7 +169,7 @@ void shutdown_networking() address should represent IPv4, IPv6 or a hostname on success returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i on failure returns -1 */ -int resolve_addr(char *address) +int resolve_addr(const char *address) { struct addrinfo hints; memset(&hints, 0, sizeof(hints)); diff --git a/core/network.h b/core/network.h index aaaaa409..8af4b32f 100644 --- a/core/network.h +++ b/core/network.h @@ -125,7 +125,7 @@ void shutdown_networking(); address should represent IPv4, IPv6 or a hostname on success returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i on failure returns -1 */ -int resolve_addr(char *address); +int resolve_addr(const char *address); #ifdef __cplusplus } diff --git a/other/bootstrap_serverdaemon/CMakeLists.txt b/other/bootstrap_serverdaemon/CMakeLists.txt index 6aa4dbee..57ba4841 100644 --- a/other/bootstrap_serverdaemon/CMakeLists.txt +++ b/other/bootstrap_serverdaemon/CMakeLists.txt @@ -4,7 +4,9 @@ project(DHT_bootstrap_daemon C) set(exe_name DHT_bootstrap_daemon) add_executable(${exe_name} - DHT_bootstrap_daemon.c) + DHT_bootstrap_daemon.c) + +target_link_libraries(${exe_name} + config) -target_link_libraries(${exe_name} config) linkCoreLibraries(${exe_name}) diff --git a/other/cmake/DHT_bootstrap.cmake b/other/cmake/DHT_bootstrap.cmake index e2b164ba..403522ab 100644 --- a/other/cmake/DHT_bootstrap.cmake +++ b/other/cmake/DHT_bootstrap.cmake @@ -4,6 +4,7 @@ project(DHT_bootstrap C) set(exe_name DHT_bootstrap) add_executable(${exe_name} - DHT_bootstrap.c ../testing/misc_tools.c) + DHT_bootstrap.c + ../testing/misc_tools.c) linkCoreLibraries(${exe_name}) diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 988efe42..af771085 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -9,10 +9,11 @@ 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) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox_win32.cmake) endif() -if(NOT WIN32) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/toxic.cmake) +if(NOT WIN32) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox.cmake) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/toxic.cmake) + add_subdirectory(other) endif() diff --git a/testing/cmake/DHT_cryptosendfiletest.cmake b/testing/cmake/DHT_cryptosendfiletest.cmake index c98a2bcd..5470d02a 100644 --- a/testing/cmake/DHT_cryptosendfiletest.cmake +++ b/testing/cmake/DHT_cryptosendfiletest.cmake @@ -4,6 +4,7 @@ project(DHT_cryptosendfiletest C) set(exe_name DHT_cryptosendfiletest) add_executable(${exe_name} - DHT_cryptosendfiletest.c misc_tools.c) + DHT_cryptosendfiletest.c + misc_tools.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/DHT_sendfiletest.cmake b/testing/cmake/DHT_sendfiletest.cmake index 93737914..298db46c 100644 --- a/testing/cmake/DHT_sendfiletest.cmake +++ b/testing/cmake/DHT_sendfiletest.cmake @@ -4,6 +4,6 @@ project(DHT_sendfiletest C) set(exe_name DHT_sendfiletest) add_executable(${exe_name} - DHT_sendfiletest.c) + DHT_sendfiletest.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/DHT_test.cmake b/testing/cmake/DHT_test.cmake index 74fdf35d..bb5bf05f 100644 --- a/testing/cmake/DHT_test.cmake +++ b/testing/cmake/DHT_test.cmake @@ -4,6 +4,7 @@ project(DHT_test C) set(exe_name DHT_test) add_executable(${exe_name} - DHT_test.c misc_tools.c) + DHT_test.c + misc_tools.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/Lossless_UDP_testclient.cmake b/testing/cmake/Lossless_UDP_testclient.cmake index e894d228..5f651807 100644 --- a/testing/cmake/Lossless_UDP_testclient.cmake +++ b/testing/cmake/Lossless_UDP_testclient.cmake @@ -4,6 +4,6 @@ project(Lossless_UDP_testclient C) set(exe_name Lossless_UDP_testclient) add_executable(${exe_name} - Lossless_UDP_testclient.c) + Lossless_UDP_testclient.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/Lossless_UDP_testserver.cmake b/testing/cmake/Lossless_UDP_testserver.cmake index 04306c1a..26f9302e 100644 --- a/testing/cmake/Lossless_UDP_testserver.cmake +++ b/testing/cmake/Lossless_UDP_testserver.cmake @@ -4,6 +4,6 @@ project(Lossless_UDP_testserver C) set(exe_name Lossless_UDP_testserver) add_executable(${exe_name} - Lossless_UDP_testserver.c) + Lossless_UDP_testserver.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/Messenger_test.cmake b/testing/cmake/Messenger_test.cmake index b2f54d0a..15fcd77b 100644 --- a/testing/cmake/Messenger_test.cmake +++ b/testing/cmake/Messenger_test.cmake @@ -4,6 +4,6 @@ project(Messenger_test C) set(exe_name Messenger_test) add_executable(${exe_name} - Messenger_test.c misc_tools.c) + Messenger_test.c misc_tools.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/nTox.cmake b/testing/cmake/nTox.cmake index 4c6905e5..44476b8f 100644 --- a/testing/cmake/nTox.cmake +++ b/testing/cmake/nTox.cmake @@ -4,8 +4,9 @@ project(nTox C) set(exe_name nTox) add_executable(${exe_name} - nTox.c misc_tools.c) - -target_link_libraries(${exe_name} ncurses) + nTox.c misc_tools.c) + +target_link_libraries(${exe_name} + ncurses) linkCoreLibraries(${exe_name}) diff --git a/testing/toxic/CMakeLists.txt b/testing/toxic/CMakeLists.txt new file mode 100644 index 00000000..43eb379a --- /dev/null +++ b/testing/toxic/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 2.6.0) +project(toxic C) + +set(exe_name toxic) + +add_executable(${exe_name} + toxic/main.c + toxic/prompt.c) + +target_link_libraries(${exe_name} + curses) + +linkCoreLibraries(${exe_name})