You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Extra link flags for Windows. They need to be set before the SDL/YAML link flags, otherwise you will get strange link errors ('Undefined reference to WinMain@16')
616
+
#Base Windows libs: use -lxxx style so it works on MinGW; MSVC doesn't care.
617
617
if ( WIN32 )
618
-
set ( basic_windows_libs advapi32.lib shell32.lib shlwapi.lib wininet.lib urlmon.lib )
618
+
set ( system_libs
619
+
advapi32
620
+
shell32
621
+
shlwapi
622
+
wininet
623
+
urlmon
624
+
)
625
+
626
+
# Tools (crash handler etc.)
627
+
set ( WIN32_LIBS imagehlp dbghelp )
628
+
629
+
# Export all symbols (as you had)
630
+
set ( CMAKE_EXE_LINKER_FLAGS"${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-all-symbols" )
631
+
632
+
# MinGW specific (MXE/WinXP build)
619
633
if ( MINGW )
620
-
set ( basic_windows_libs ${basic_windows_libs} mingw32 -mwindows )
621
-
set ( static_flags -static )
622
-
set ( SDLMIXER_LIBRARY "${SDLMIXER_LIBRARY} -lwinmm" )
623
-
endif ()
624
-
set ( system_libs ${basic_windows_libs} SDLmain ${static_flags} )
625
-
endif ()
634
+
# Use GUI subsystem + static link
635
+
set ( system_libs ${system_libs} mingw32 -mwindows -static )
626
636
627
-
# backtrace(3) requires libexecinfo on some *BSD systems
628
-
if (${CMAKE_SYSTEM_NAME}MATCHES FreeBSD OR${CMAKE_SYSTEM_NAME}MATCHES NetBSD OR${CMAKE_SYSTEM_NAME}MATCHES OpenBSD)
629
-
set ( system_libs -lexecinfo )
630
-
endif ()
637
+
# SDL_mixer uses winmm for MIDI on Windows
638
+
set ( system_libs ${system_libs} winmm )
639
+
640
+
# SDL (DirectX IDs) and SDL_net dependencies
641
+
set ( system_libs ${system_libs} dxguid ws2_32 iphlpapi )
0 commit comments