Skip to content

Commit 0f0ecfd

Browse files
luciddream-tsinTheMostDiligent
authored andcommitted
Use CMake's MINGW variable instead of checking generator name
The generator name check was unreliable - CMake already detects MinGW properly via the MINGW variable. This works regardless of which generator (Makefiles/Ninja/etc) is being used. Also added MSYS environment detection for completeness.
1 parent dba599c commit 0f0ecfd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,13 @@ if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS)
171171
endif()
172172
endif()
173173

174-
if(${CMAKE_GENERATOR} MATCHES "MinGW")
174+
if(MINGW)
175175
message("Building with MinGW")
176176
set(MINGW_BUILD TRUE CACHE INTERNAL "Building with MinGW")
177+
178+
if(MSYS)
179+
message(" in MSYS environment")
180+
endif()
177181
endif()
178182

179183
if(PLATFORM_WIN32)

0 commit comments

Comments
 (0)