Skip to content

[Bug] Select variant: does nothing on quickstart projects (Switching Debug & Release and other modes.) #4569

@SaladinAyyub

Description

@SaladinAyyub

Brief Issue Summary

I have a newly created cmake project created using cmake: Quickstart. And when choosing a preset it showed me GCC and Clang (I am on Linux and have both installed). Choosing either. After that it generates a CMakePresets.json with whichever compiler you chose and with the Debug Build type.

Now if i want to test a release build selecting a variant basically does nothing. It doesnt change either the CMakePresets.json and neither does it affect CMakeCache.txt inside the build directory . the CMAKE_BUILD_TYPE is still Debug. So it is really confusing. Also the chosen variant is not shown anywhere on the status bar or the cmake sidebar but the documentation states it is written there.

Here is the video ->

output.mp4

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.103.2",
  "cmtVersion": "1.21.36",
  "configurations": [
    {
      "folder": "/home/saladin/Repos/CppProjects",
      "cmakeVersion": "3.31.7",
      "configured": true,
      "generator": "Unix Makefiles",
      "usesPresets": true,
      "compilers": {
        "C": "/run/current-system/sw/bin/gcc",
        "CXX": "/run/current-system/sw/bin/g++"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 1,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "firstProj",
        "type": "EXECUTABLE"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Building folder: /home/saladin/Repos/CppProjects/out/build/Cmake 
[build] Starting build
[proc] Executing command: /run/current-system/sw/bin/cmake --build /home/saladin/Repos/CppProjects/out/build/Cmake --
[build] [100%] Built target firstProj
[driver] Build completed: 00:00:00.089
[build] Build finished with exit code 0

Additional Information

It would be great to improve the UX when it comes to selecting the variants, and easily switch or display it in the status bar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buga bug in the productmore info neededMore info is needed from the community for us to properly triage and investigate.

    Type

    No type

    Projects

    Status

    Blocked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions