From 632326a7c762aa039d245a506553c9f06d23cd10 Mon Sep 17 00:00:00 2001 From: Emil Laine Date: Thu, 15 Sep 2016 15:29:33 +0300 Subject: FindSDL: Add -mwindows to link flags for MinGW, correct wording The `-mwindows` flag is needed to avoid creating an additional console window when starting SDL applications built with MinGW. There is no `mwindows` library. See also https://cygwin.com/ml/cygwin/2007-04/msg00027.html --- Modules/FindSDL.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index c0cdd98..4e4411f 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -122,11 +122,10 @@ if(NOT APPLE) find_package(Threads) endif() -# MinGW needs an additional library, mwindows -# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows -# (Actually on second look, I think it only needs one of the m* libraries.) +# MinGW needs an additional link flag, -mwindows +# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -mwindows if(MINGW) - set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") + set(MINGW32_LIBRARY mingw32 "-mwindows" CACHE STRING "link flags for MinGW") endif() if(SDL_LIBRARY_TEMP) -- cgit v0.12