summaryrefslogtreecommitdiff
path: root/Modules/FindSDL.cmake
diff options
context:
space:
mode:
authorEmil Laine <emil.laine@cs.helsinki.fi>2016-09-15 15:29:33 +0300
committerBrad King <brad.king@kitware.com>2016-10-12 08:49:16 -0400
commit632326a7c762aa039d245a506553c9f06d23cd10 (patch)
tree4af552be5ff92286244de6d05a2437ae899b6f74 /Modules/FindSDL.cmake
parent2fb8e5b1c46ea586233b19e612ba174aa74d004c (diff)
downloadcmake-632326a7c762aa039d245a506553c9f06d23cd10.tar.gz
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
Diffstat (limited to 'Modules/FindSDL.cmake')
-rw-r--r--Modules/FindSDL.cmake7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index c0cdd98518..4e4411ffb0 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)