microsoft / microsoft/vscode-cmake-tools
VS build environment is not set when using clang
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
So what is the trick to get VSCode to call vcvars?
My preset:
```
{
"name": "win-ninja-release",
"displayName": "win-ninja-release",
"description": "Ninja generator release",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/ninja/release",
"inherits": ["ninja-general" , "win-vcpkg_settings" ],
"cacheVariables": {
"CMAKE_C_COMPILER" : "$penv{LLVMInstallDir}/bin/clang-cl.exe",
"CMAKE_CXX_COMPILER" : "$penv{LLVMInstallDir}/bin/clang-cl.exe",
"CMAKE_BUILD_TYPE": "Release",
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [ "Windows" ],
"intelliSenseMode" : "windows-clang-x64",
"enableMicrosoftCodeAnalysis" : true
}
}
},
```
_Originally posted by @Neumann-A in https://github.com/microsoft/vscode-cmake-tools/issues/1885#issuecomment-991155721_
Contributor guide
Research direction
Start by reproducing the reported behavior with the win-ninja-release CMake preset and its clang-cl compiler settings on Windows. Determine whether the Visual Studio build environment is initialized, and define completion as the preset invoking the expected environment without requiring an undocumented manual step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, vscode
- Domain
- build-system, developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100