Skip to content

Ninja is used as a default generator #2598

@OleksandrKvl

Description

@OleksandrKvl

Brief Issue Summary

After recent VSCode update to 1.68.0 and CMake tools extension to v1.11.25 my configuration step stopped working. The problem is that now it passes -G Ninja option even though cmake.generator option is empty.

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.68.0",
  "cmtVersion": "1.11.25",
  "configurations": [
    {
      "folder": "/home/my/private/path",
      "cmakeVersion": "3.20.3",
      "configured": true,
      "generator": "Unix Makefiles",
      "usesPresets": false,
      "compilers": {
        "C": "/opt/gcc-6.3.0/bin/gcc",
        "CXX": "/opt/gcc-6.3.0/bin/g++"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

Debug Log

[main] Configuring folder: backend 
[main] Saving open files before configure/build
[driver] Start configure 
[driver] Running pre-configure checks and steps
[driver] Using compilers in GCC 6.3 for configure
[cmakefileapi-driver] Configuring using kit
[cmakefileapi-driver] Invoking CMake /home/user/bin/cmake with arguments ["--no-warn-unused-cli","-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE","-DCMAKE_BUILD_TYPE:STRING=Debug","-DCMAKE_C_COMPILER:FILEPATH=/opt/gcc-6.3.0/bin/gcc","-DCMAKE_CXX_COMPILER:FILEPATH=/opt/gcc-6.3.0/bin/g++","-S/home/my/private/dir","-B/home/my/private/dir/build_Debug","-G","Ninja"]
[proc] Executing command: /home/user/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/opt/gcc-6.3.0/bin/gcc -DCMAKE_CXX_COMPILER:FILEPATH=/opt/gcc-6.3.0/bin/g++ -S/home/my/private/dir -B/home/my/private/dir/build_Debug -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error: Error: generator : Ninja
[cmake] Does not match the generator used previously: Unix Makefiles
[cmake] Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
[extension] [1620] cmake.configure finished (returned 1)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions