From 5c03377a53b137d647f1e485cd89e57f358ee3e9 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 9 Sep 2022 10:19:56 +0200 Subject: [PATCH 1/2] Fix mingw static library name on mingw and Emscripten They build code in a UNIX like environment but CMake doesn't set UNIX for it. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b412dc7..3f42869 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,10 +163,10 @@ if(NOT CYGWIN) set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) endif() -if(UNIX) +if(UNIX OR MINGW OR EMSCRIPTEN) # On unix-like platforms the library is almost always called libz set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) - if(NOT APPLE) + if(NOT APPLE AND NOT MINGW AND NOT EMSCRIPTEN) set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") endif() elseif(BUILD_SHARED_LIBS AND WIN32) -- 2.37.3.windows.1