gpt4 book ai didi

c - VS 2017 + cmake + 忍者 + mingw

转载 作者:太空宇宙 更新时间:2023-11-04 03:18:57 26 4
gpt4 key购买 nike

我正在使用 VS 2017 的新“打开文件夹”功能,通过 CmakeSettings.json 自动构建 cmake。

代码是用C11写的,所以我需要用gcc(来自mingw-64)编译。我创建了一个新的 cmake 配置,如下所示:

{
"name": "GNU-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"variables": [
{
"name": "CMAKE_MAKE_PROGRAM",
"value": "C:\\msys64\\mingw64\\bin\\mingw32-make.exe"
},
{
"name": "CMAKE_C_COMPILER",
"value": "C:\\msys64\\mingw64\\bin\\gcc.exe"
},
{
"name": "CMAKE_CXX_COMPILER",
"value": "C:\\msys64\\mingw64\\bin\\g++.exe"
}
]
}

输出看起来像这样:

The detected version of Ninja (GNU Make 4.2.1 Built for x86_64-w64-mingw32 Copyright (C) 1988-2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.) is less than the version of Ninja required by CMake (1.3).

这很奇怪,考虑到检测到的忍者版本应该是一个数字。 VS 的 ninja 和 MinGW ninja 都是最新的 (1.8.2)。

有没有其他方法可以让 MinGW + CMake 在 VS 2017 中工作?

最佳答案

原来我不得不重新启动 VS...一切都按预期进行。

关于c - VS 2017 + cmake + 忍者 + mingw,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48407391/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com