跳转至

MSYS2 与 MinGW

MSYS2 提供 windows-x64 preset 背后的 MinGW Windows lane。所选 MSYS2 subsystem、 compiler architecture、package set 与 shell 必须一致;混用 MSYS/MinGW library 会制造 误导性的 configure 或 runtime failure。

契约路径

打开匹配的 MinGW64 环境并检查仓库 preset:

cmake --list-presets
cmake --preset windows-x64
cmake --build --preset windows-x64

tiles+sound 使用 windows-tiles-sounds-x64。两者都是带 RelWithDebInfo build preset 的 multi-configuration Ninja 配置;不要另造会静默偏离 preset 的 build directory 或 configuration。

依赖与 shell 边界

doc/c++/COMPILING-MSYS.md 解释生态,实际契约由 CMakePresets.json、CMake configure error 和当前 CI 决定。为选定 MinGW architecture 安装依赖,在匹配 shell 运行 MinGW binary,并在不依赖开发 PATH 的环境检查打包 DLL 集合。

验证

  • configure/build 准确 preset;
  • 对相同 configuration 运行生成测试;
  • tiles/sound 从干净 shell 启动,验证 renderer、font、sound、translation,以及启用 SDL3 时的 shader artifact;
  • PR 记录 shell(MINGW64)、compiler/version、preset 与 configuration。

常见失败

错误 architecture package、PATH 中 MSYS compiler 位于 MinGW 前、旧 CMake cache、 缺失 runtime DLL、混用 slash/drive path 是不同故障。保留首个 configure/link error, 不要靠向源码树复制任意 DLL“修复”。