diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 03dbfbcd5..9e60bdd53 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -469,7 +469,11 @@ endif() if(TARGET miniupnpc::miniupnpc) if("${VCPKG_TARGET_TRIPLET}" MATCHES "-mingw-static$") target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MINIUPNPC -DMINIUPNP_STATICLIB) - target_link_libraries(SRB2SDL2 PRIVATE miniupnpc::miniupnpc iphlpapi) + if("${VCPKG_HOST_TRIPLET}" MATCHES "-mingw-static$") + target_link_libraries(SRB2SDL2 PRIVATE miniupnpc::miniupnpc iphlpapi) + else() + target_link_libraries(SRB2SDL2 PRIVATE miniupnpc::miniupnpc) + endif() else() target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MINIUPNPC) target_link_libraries(SRB2SDL2 PRIVATE miniupnpc::miniupnpc) @@ -498,7 +502,7 @@ endif() # copy DLLs to bin/ directory if building internal shared on windows if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows AND NOT "${SRB2_CONFIG_INTERNAL_LIBRARIES}") set(ADDITIONAL_DLLS "") - if("${CMAKE_C_COMPILER_ID}" STREQUAL GNU) + if("${CMAKE_C_COMPILER_ID}" STREQUAL GNU AND "${VCPKG_HOST_TRIPLET}" MATCHES "-mingw-static$") # also copy implicitly linked system libraries get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH) list(APPEND ADDITIONAL_DLLS