diff --git a/CMakeLists.txt b/CMakeLists.txt index e42527c7..c5e8294f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,9 @@ set(toxcore_PKGCONFIG_LIBS) add_module(toxcrypto toxcore/crypto_core.c) target_link_modules(toxcrypto ${LIBSODIUM_LIBRARIES}) +if(WIN32) + target_link_modules(toxcrypto ws2_32) # for htonl +endif() # LAYER 2: Basic networking # ------------------------- @@ -204,8 +207,9 @@ target_link_modules(toxencryptsave toxcore) # ################################################################################ -add_test(format_test - ${CMAKE_SOURCE_DIR}/other/astyle/format-source "${CMAKE_SOURCE_DIR}") +add_test( + NAME format_test + COMMAND ${CMAKE_SOURCE_DIR}/other/astyle/format-source "${CMAKE_SOURCE_DIR}") function(auto_test target) if(CHECK_FOUND) @@ -215,7 +219,7 @@ function(auto_test target) toxav toxencryptsave ${CHECK_LIBRARIES}) - add_test(${target} auto_${target}) + add_test(NAME ${target} COMMAND auto_${target}) endif() endfunction() diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c index 69e6033d..d08fc125 100644 --- a/auto_tests/tox_test.c +++ b/auto_tests/tox_test.c @@ -24,10 +24,12 @@ #include #include "../toxcore/tox.h" +#include "../toxcore/util.h" #include "helpers.h" #if defined(_WIN32) || defined(__WIN32__) || defined (WIN32) +#include #define c_sleep(x) Sleep(1*x) #else #include