Skip to content

Commit 29cbcc6

Browse files
Use CMake's MINGW variable instead of checking generator name (#720)
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 add MSYS environment detection for completeness.
1 parent dba599c commit 29cbcc6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,11 @@ 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")
176+
if(MSYS)
177+
message(" in MSYS environment")
178+
endif()
176179
set(MINGW_BUILD TRUE CACHE INTERNAL "Building with MinGW")
177180
endif()
178181

0 commit comments

Comments
 (0)