From 7ffba976c663fa5d8897e2d29b04b0c50ba6b011 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Fri, 22 Dec 2023 12:09:37 +0100 Subject: [PATCH 1/2] windows mono_time hotfix --- external/toxcore/c-toxcore/toxcore/mono_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/toxcore/c-toxcore/toxcore/mono_time.c b/external/toxcore/c-toxcore/toxcore/mono_time.c index 2ce817f6..bd17d522 100644 --- a/external/toxcore/c-toxcore/toxcore/mono_time.c +++ b/external/toxcore/c-toxcore/toxcore/mono_time.c @@ -161,7 +161,7 @@ Mono_Time *mono_time_new(const Memory *mem, mono_time_current_time_cb *current_t #endif mono_time->cur_time = 0; -#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) || defined(OS_WIN32) // Maximum reproducibility. Never return time = 0. mono_time->base_time = 1; #else From b29e6f8f6d8dde8e3dee969d1ccdf1ed6051aa1f Mon Sep 17 00:00:00 2001 From: Green Sky Date: Fri, 22 Dec 2023 17:40:14 +0100 Subject: [PATCH 2/2] build toxcore shared --- external/toxcore/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/external/toxcore/CMakeLists.txt b/external/toxcore/CMakeLists.txt index 9fea9344..fae83720 100644 --- a/external/toxcore/CMakeLists.txt +++ b/external/toxcore/CMakeLists.txt @@ -5,7 +5,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(TOX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/c-toxcore/") # TODO: shared -add_library(toxcore STATIC +add_library(toxcore SHARED ${TOX_DIR}third_party/cmp/cmp.c ${TOX_DIR}third_party/cmp/cmp.h @@ -168,6 +168,8 @@ target_compile_definitions(toxcore PUBLIC USE_IPV6=1) #target_compile_definitions(toxcore PUBLIC MIN_LOGGER_LEVEL=LOGGER_LEVEL_DEBUG) target_compile_definitions(toxcore PUBLIC MIN_LOGGER_LEVEL=LOGGER_LEVEL_INFO) +set_target_properties(toxcore PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + find_package(unofficial-sodium CONFIG QUIET) find_package(sodium QUIET) if(unofficial-sodium_FOUND) # vcpkg