Skip to content
Snippets Groups Projects
Commit e5c4924e authored by Logan Aerl Arias's avatar Logan Aerl Arias
Browse files

Update CMakeLists.txt

only link iphlpapi if on Windows host
only copy MinGW DLLs if on Windows host
parent ae0afa9d
Branches
No related tags found
1 merge request!2427Draft: ACS and special activation
Pipeline #7222 failed
...@@ -469,7 +469,11 @@ endif() ...@@ -469,7 +469,11 @@ endif()
if(TARGET miniupnpc::miniupnpc) if(TARGET miniupnpc::miniupnpc)
if("${VCPKG_TARGET_TRIPLET}" MATCHES "-mingw-static$") if("${VCPKG_TARGET_TRIPLET}" MATCHES "-mingw-static$")
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MINIUPNPC -DMINIUPNP_STATICLIB) 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() else()
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MINIUPNPC) target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MINIUPNPC)
target_link_libraries(SRB2SDL2 PRIVATE miniupnpc::miniupnpc) target_link_libraries(SRB2SDL2 PRIVATE miniupnpc::miniupnpc)
...@@ -498,7 +502,7 @@ endif() ...@@ -498,7 +502,7 @@ endif()
# copy DLLs to bin/ directory if building internal shared on windows # copy DLLs to bin/ directory if building internal shared on windows
if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows AND NOT "${SRB2_CONFIG_INTERNAL_LIBRARIES}") if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows AND NOT "${SRB2_CONFIG_INTERNAL_LIBRARIES}")
set(ADDITIONAL_DLLS "") 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 # also copy implicitly linked system libraries
get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH) get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
list(APPEND ADDITIONAL_DLLS list(APPEND ADDITIONAL_DLLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment