microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 449 forks source link

Disable or Remove the [scan for tools] function #2859

Closed ZZH-Finalize closed 1 year ago

ZZH-Finalize commented 1 year ago

Type: Bug

I have a lot of toolchains in my cmake-tools-kits.json file, all of them are configured by my self, but, I don`t know why the cmake tools just scan tools automaticly today, that action destroy all my tools configurations. now I have nothing in my cmake-tools-kits.json

Extension version: 1.12.27 VS Code version: Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T04:27:29.066Z) OS version: Windows_NT x64 10.0.22623 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-1255U (12 x 2611)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|39.68GB (23.89GB free)| |Process Argv|D:\\proj\\signal-test-box\\tiny-signal-box.code-workspace| |Screen Reader|no| |VM|0%|
bobbrow commented 1 year ago

I'm sorry if you lost your kits. We tried to document it here: https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/kits.md. I think it would be better to warn if kits will be deleted.

It is intended that you create a local kits file in your .vscode folder for the workspace. Those are safe from scans.

ZZH-Finalize commented 1 year ago

Another problem is that dose the cmake tools support define RC compiler manually? I know it can define C and CXX compilers, if I need to using RC files to add an icon for my binary file,so I need to tell cmake where to find the correct version of RC compiler. Because every kit will contains a RC compiler, but cmake will use the first one it find in the PATH variable, that one may not match the C/CXX compiler, so i have to define CMAKE_RC_COMPILER variable in my CMakeLists.txt file, this will cause a problem when I switching to another kit.

bobbrow commented 1 year ago

You can set everything you want if you use CMakePresets.json instead of Kits. (Official Documentation)

ZZH-Finalize commented 1 year ago

Thanks, it is helpful to me