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

mingw workaround, -static doesn't work

mingw workaround, -static doesn't work, copy the needed dlls
parent 5c136b1c
No related branches found
No related tags found
No related merge requests found
...@@ -132,11 +132,15 @@ add_custom_target(_SRB2_reconf ALL ...@@ -132,11 +132,15 @@ add_custom_target(_SRB2_reconf ALL
) )
add_dependencies(SRB2SDL2 _SRB2_reconf) add_dependencies(SRB2SDL2 _SRB2_reconf)
if("${CMAKE_COMPILER_IS_GNUCC}" AND "${CMAKE_SYSTEM_NAME}" MATCHES "Windows") if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
target_link_options(SRB2SDL2 PRIVATE "-Wl,--disable-dynamicbase") target_link_options(SRB2SDL2 PRIVATE "-Wl,--disable-dynamicbase")
if("${SRB2_CONFIG_STATIC_STDLIB}") if("${SRB2_CONFIG_STATIC_STDLIB}")
# On MinGW with internal libraries, link the standard library statically # On MinGW with internal libraries, link the standard library statically
MESSAGE(STATUS "Forcing static libstdc++ on MinGW?")
target_link_options(SRB2SDL2 PRIVATE "-static") target_link_options(SRB2SDL2 PRIVATE "-static")
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
target_link_libraries(SRB2SDL2 PRIVATE Threads::Threads)
endif() endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 4) if(CMAKE_SIZEOF_VOID_P EQUAL 4)
target_link_options(SRB2SDL2 PRIVATE "-Wl,--large-address-aware") target_link_options(SRB2SDL2 PRIVATE "-Wl,--large-address-aware")
...@@ -492,7 +496,7 @@ if((CMAKE_COMPILER_IS_GNUCC) AND NOT ("${CMAKE_SYSTEM_NAME}" MATCHES Darwin)) ...@@ -492,7 +496,7 @@ if((CMAKE_COMPILER_IS_GNUCC) AND NOT ("${CMAKE_SYSTEM_NAME}" MATCHES Darwin))
endif() 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}" AND "${SRB2_CONFIG_SHARED_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)
# also copy implicitly linked system libraries # also copy implicitly linked system libraries
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment