Skip to content

Commit 2238f98

Browse files
committed
Add -mwindows to link flags, correct wording
mwindows is not a library. Quoting from https://cygwin.com/ml/cygwin/2007-04/msg00027.html: > > What does -mwindows mean? > It just means to set a flag in the PE header that tells the OS not to > allocate a console for the program when started. This is usually the > desired behavior when the program has a GUI, because you don't want the > console window appearing in that case. It is really unfortunate that > somebody decided to call this "-mwindows", it should really be > -mno-console, which compliments its reciprocal option -mconsole (which > is the default.)
1 parent f9c536d commit 2238f98

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

FindSDL2.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,10 @@ IF(NOT APPLE)
118118
FIND_PACKAGE(Threads)
119119
ENDIF(NOT APPLE)
120120

121-
# MinGW needs an additional library, mwindows
122-
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
123-
# (Actually on second look, I think it only needs one of the m* libraries.)
121+
# MinGW needs an additional link flag, -mwindows
122+
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows
124123
IF(MINGW)
125-
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
124+
SET(MINGW32_LIBRARY mingw32 "-mwindows" CACHE STRING "mwindows for MinGW")
126125
ENDIF(MINGW)
127126

128127
IF(SDL2_LIBRARY_TEMP)
@@ -166,4 +165,3 @@ message("</FindSDL2.cmake>")
166165
INCLUDE(FindPackageHandleStandardArgs)
167166

168167
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
169-

0 commit comments

Comments
 (0)