{"id":20355815,"url":"https://github.com/davidingplus/mine-sweeper","last_synced_at":"2026-06-05T08:31:31.975Z","repository":{"id":247724549,"uuid":"826674292","full_name":"DavidingPlus/mine-sweeper","owner":"DavidingPlus","description":"经典扫雷游戏，用 Qt 5 实现。","archived":false,"fork":false,"pushed_at":"2024-12-07T16:26:35.000Z","size":1348,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-15T01:07:54.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidingPlus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-10T06:53:02.000Z","updated_at":"2024-12-07T16:26:40.000Z","dependencies_parsed_at":"2024-12-07T17:31:54.406Z","dependency_job_id":null,"html_url":"https://github.com/DavidingPlus/mine-sweeper","commit_stats":null,"previous_names":["davidingplus/mine-sweeper"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidingPlus%2Fmine-sweeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidingPlus%2Fmine-sweeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidingPlus%2Fmine-sweeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidingPlus%2Fmine-sweeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidingPlus","download_url":"https://codeload.github.com/DavidingPlus/mine-sweeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241889485,"owners_count":20037517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T23:14:08.499Z","updated_at":"2026-06-05T08:31:31.960Z","avatar_url":"https://github.com/DavidingPlus.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mine-sweeper\n\n经典扫雷游戏，用 Qt 5 实现。\n\n目前使用 XMake 进行构建编译。\n\nXMake 工具太牛逼了，比 CMake 的配置和构建要方便一些，可以学一下。\n\n# 构建流程\n\n安装教程请自行参考[官方文档](https://xmake.io/)，这里假设已经安装好 XMake 工具。\n\nXMake 默认会自动探测 Qt 环境，当然也可以指定 Qt SDK 环境目录：\n\n\u003e 注：以下的命令均在项目根目录执行，XMake 帮我们处理好了目录管理，会自动创建配置缓存目录，例如 .xmake 和 build，不用我们担心。\n\n这里以 Debug 构建模式为例。\n\n```bash\nxmake f -m debug --qt=D:\\Qt\\5.15.2\\\n```\n\n如果想要使用 Windows 下 MingW 的 Qt 环境，可以切到 mingw 的平台配置，并且指定下 mingw 编译环境的 sdk 路径即可，例如：\n\n```bash\nxmake f -m debug -p mingw --sdk=D:\\Qt\\Tools\\mingw810_64\\\n```\n\n当然我的机器上只安装了 Qt 5.15.2 版本的 Mingw 环境，因此我选择第二个。\n\n另外，xmake f 对应命令 xmake config，代表对当前项目进行配置。如果想要使用全局配置可使用 xmake g，即 xmake global。\n\n全局配置的文件在 Windows 下在 ~\\AppData\\Local\\.xmake\\xmake.conf，在 Linux 下在 ~/.xmake/xmake.conf。\n\n配置完毕以后，就可以进行编译构建了。\n\n```bash\nxmake build \u003ctarget\u003e\n```\n\n如果没有编译或者依赖错误，就能得到可执行文件了。\n\n```bash\nxmake run \u003ctarget\u003e\n```\n\n如果不加 target 参数代表编译和运行所有的 target。\n\n然后，就能看到一个 Qt Widget 程序正确的运行了，比使用 Qt Creator 不知道轻量了多少倍。\n\n# 更多细节\n\nTODO：目前仅放出参考链接，后续继续研究并形成总结文档。\n\n## 使用 Vscode + Qt + Terminal 开发\n\n参考：[https://xmake.io/#/plugin/more_plugins?id=configure-intellsence](https://xmake.io/#/plugin/more_plugins?id=configure-intellsence)\n\n## Windows 无法向控制台输出文字内容\n\n参考：[https://github.com/xmake-io/xmake/issues/3371](https://github.com/xmake-io/xmake/issues/3371)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidingplus%2Fmine-sweeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidingplus%2Fmine-sweeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidingplus%2Fmine-sweeper/lists"}