Fix for windows dynamic libraries.

This commit is contained in:
iphydf 2016-09-17 13:48:11 +01:00
parent 80cc32a79d
commit 5da85c582d
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 9 additions and 3 deletions

View File

@ -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()

View File

@ -24,10 +24,12 @@
#include <time.h>
#include "../toxcore/tox.h"
#include "../toxcore/util.h"
#include "helpers.h"
#if defined(_WIN32) || defined(__WIN32__) || defined (WIN32)
#include <windows.h>
#define c_sleep(x) Sleep(1*x)
#else
#include <unistd.h>