VS 2017 + cmake + ninja + mingw

I'm using VS 2017's new "open folder" feature with automatic cmake builds via CmakeSettings.json.

The code is written in C11, so I need to compile it with gcc (from mingw-64). I created a new cmake configuration that looks like this:

{
  "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:msys64mingw64binmingw32-make.exe"
    },
    {
      "name": "CMAKE_C_COMPILER",
      "value": "C:msys64mingw64bingcc.exe"
    },
    {
      "name": "CMAKE_CXX_COMPILER",
      "value": "C:msys64mingw64bing++.exe"
    }
  ]
}

The output looks like this:

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).

Which is very weird, considering the detected version of ninja is supposed to be a number. Both VS' ninja and MinGW ninja are up to date (1.8.2).

Is there any other way to have MinGW + CMake working inside VS 2017?


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

链接地址: http://www.djcxy.com/p/53398.html

上一篇: phonegap 1.0 android facebook插件登录失败

下一篇: VS 2017 + cmake + ninja + mingw