Repository: godot
Issue: Build error with MSYS2/mingw64, uses wrong path to windres.exe
Labels: bug,platform:windows,topic:buildsystem

<!-- Please search existing issues for potential duplicates before filing yours:	
https://github.com/godotengine/godot/issues?q=is%3Aissue	
-->


**Godot version:**
<!-- Specify commit hash if using non-official build. -->
git master branch。

**OS/device including version:**
<!-- Specify GPU model, drivers, and the backend (GLES2, GLES3, Vulkan) if graphics-related. -->
windows 1903; msys2 - mingw64;
```
$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-10.1.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --disable-plugin --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.1.0 (Rev3, Built by MSYS2 project)
```
```
$ scons -v
SCons by Steven Knight et al.:
        script: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
        engine: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
        engine path: ['/usr/lib/python3.8/site-packages/SCons']
Copyright (c) 2001 - 2019 The SCons Foundation
```

```
$ python --version
Python 3.8.3
```

**Issue description:**
<!-- What happened, and what was expected. -->
build error.

**Steps to reproduce:**

```
$ scons platform=windows use_mingw=yes
scons: Reading SConscript files ...
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Configuring for Windows: target=debug, bits=default
Using MinGW
Checking for C header file mntent.h... no
scons: done reading SConscript files.
scons: Building targets ...
[Initial build] Compiling ==> platform/windows/godot_windows.cpp
[Initial build] Compiling ==> platform/windows/crash_handler_windows.cpp
[Initial build] Compiling ==> platform/windows/os_windows.cpp
[Initial build] Compiling ==> platform/windows/display_server_windows.cpp
platform/windows/display_server_windows.cpp:432:2: warning: #warning touchscreen not working [-Wcpp]
  432 | #warning touchscreen not working
      |  ^~~~~~~
[Initial build] Compiling ==> platform/windows/key_mapping_windows.cpp
[Initial build] Compiling ==> platform/windows/joypad_windows.cpp
[Initial build] Compiling ==> platform/windows/windows_terminal_logger.cpp
[Initial build] Compiling ==> platform/windows/vulkan_context_win.cpp
[Initial build] Compiling ==> platform/windows/context_gl_windows.cpp
[Initial build] build_res_file(["platform/windows/godot_res.windows.tools.64.o"], ["platform/windows/godot_res.rc"])
scons: *** [platform/windows/godot_res.windows.tools.64.o] Error 1
scons: building terminated because of errors.
```
**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->