mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2025-09-04 07:20:15 +02:00
Mingw build: static link, posix g++, SDL2 list order.
This commit is contained in:
parent
ac289c7f48
commit
69027eca53
3 changed files with 10 additions and 4 deletions
|
@ -14,6 +14,11 @@ if(WIN32)
|
|||
list(APPEND SDL2_MIXER_PATH "${CMAKE_CURRENT_LIST_DIR}/Libs/SDL2_mixer")
|
||||
endif()
|
||||
|
||||
# Link mingw libs static
|
||||
if(MINGW)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
|
||||
endif()
|
||||
|
||||
# SDL2main is not needed
|
||||
set(SDL2_BUILDING_LIBRARY ON)
|
||||
|
||||
|
@ -195,8 +200,8 @@ target_link_libraries(SpaceCadetPinball ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY})
|
|||
|
||||
# On Windows, copy DLL to output
|
||||
if(WIN32)
|
||||
list(POP_BACK SDL2_LIBRARY SDL2_DLL_PATH)
|
||||
list(POP_BACK SDL2_MIXER_LIBRARY SDL2_MIXER_DLL_PATH)
|
||||
list(GET SDL2_LIBRARY -1 SDL2_DLL_PATH)
|
||||
list(GET SDL2_MIXER_LIBRARY -1 SDL2_MIXER_DLL_PATH)
|
||||
get_filename_component(SDL2_DLL_PATH ${SDL2_DLL_PATH} DIRECTORY)
|
||||
get_filename_component(SDL2_MIXER_DLL_PATH ${SDL2_MIXER_DLL_PATH} DIRECTORY)
|
||||
if(MINGW)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue