From ed268102527414a602e5f29d0c9b6138ed6e278b Mon Sep 17 00:00:00 2001 From: GH Cao Date: Mon, 22 Apr 2024 16:28:38 +0800 Subject: [PATCH] Fix MinGW build by exporting all the symbols, like on MSVC --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35d576d51..b7f3289fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -525,6 +525,9 @@ add_library(gmssl ${src}) if (WIN32) target_link_libraries(gmssl -lws2_32) + if (MINGW) + target_link_options(gmssl PRIVATE -Wl,--export-all-symbols) + endif() elseif (APPLE) if (ENABLE_SDF) target_link_libraries(gmssl dl) @@ -534,9 +537,7 @@ elseif (APPLE) # FIXME: different rules for cl and OpenCL framework target_link_libraries(gmssl "-framework OpenCL") endif() - #target_link_libraries(gmssl "-framework CoreFoundation") # rand_apple.c CFRelease() -elseif (MINGW) - target_link_libraries(gmssl PRIVATE wsock32) + #target_link_libraries(gmssl "-framework CoreFoundation") # rand_apple.c CFRelease() else() if (ENABLE_SDF) target_link_libraries(gmssl dl)