Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for windows dynamic libraries. #142

Merged
merged 1 commit into from
Sep 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
# -------------------------
Expand Down Expand Up @@ -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)
Expand All @@ -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()

Expand Down
2 changes: 2 additions & 0 deletions auto_tests/tox_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down