mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-20 09:11:01 +00:00
Update CMakeLists.txt
only link iphlpapi if on Windows host only copy MinGW DLLs if on Windows host
This commit is contained in:
parent
ae0afa9d52
commit
e5c4924e7a
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue