Skip to content

Commit

Permalink
Fix MinGW build by exporting all the symbols, like on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
driver1998 committed Apr 22, 2024
1 parent bdd2149 commit 2c3a38a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -598,7 +599,7 @@ if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
add_executable(gmssl-bin ${tools})
target_link_libraries(gmssl-bin LINK_PUBLIC gmssl)
set_target_properties(gmssl-bin PROPERTIES RUNTIME_OUTPUT_NAME gmssl)
if (MINGW)
if (MINGW)
target_link_libraries(gmssl-bin PRIVATE Ws2_32)
endif()

Expand Down

0 comments on commit 2c3a38a

Please sign in to comment.