-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for clang compilers to be set in presets without full path #1922
Comments
What is the cmake command generated by the extension when configuring? Set "cmake.loggingLevel" to "Debug" in your .vscode/settings.json and share with us the "CMake/Build" output channel. |
First thing I notice is that you define CMAKE_BUILD_TYPE instead of CMAKE_CONFIGURATION_TYPES for "Ninja Multi-Config" generator. I am not done analyzing this end to end, but in the meantime you can review The Ninja Multi-Config Documentation to double check your presets (especially the cache variables). |
@andreeis I'm so sorry that's really embracing. I was experimenting and changed my presets file and I didn't notice I did set Ninja Multi Config {
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"hidden": true,
"binaryDir": "${sourceDir}/../../__build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/../../__install/${presetName}"
}
},
{
"name": "default-x64-windows-ninja",
"inherits": [
"default"
],
"generator": "Ninja",
"architecture": {
"value": "x64",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
}
]
} I opened the folder with the above preset. On configure I got an error message that compiler was not configured. So I executed:
The clicked on
|
The Hello World toy source code: |
What I understood from the above text is that it should have worked after I executed And this which I added with the help of the command palette works: {
"name": "vs2019",
"displayName": "Visual Studio Community 2019 Release - amd64",
"description": "Using compilers for Visual Studio 16 2019 (x64 architecture)",
"inherits": [
"default"
],
"generator": "Visual Studio 16 2019",
"toolset": "host=x64",
"architecture": "x64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
} |
I got a success when I launched from the VS developer prompt, deleted the build directory and reconfigured. |
Can you add:
to your |
This works, thank you. I expected that this is covered automatically by adding:
Shouldn't we have the option to select the compiler in a similar fashion as when using kits?
|
BTW. In a few places I notice the word "kit" where with the current command "Scan for compilers", "compiler" may be a more appropriate word, like in the compiler quick pick, the scanning message, etc. |
@Zingam please feel free to open issues or send us a PR for the cases where "kit" is incorrectly used. @esweet431 What do you think about us defaulting to pick "cl.exe" by default on Windows if the generator is "Ninja" and the CMAKE_CXX_COMPILER variable is not set? Is CMake or VS doing anything fancy here? |
Can we have the shortcut version like with
|
What could be the reason why the above "clang.exe" configures but "clang-cl.exe" fails:
There is no such issue in VS2019 with the same preset settings. |
Two issues here:
|
This fix is included in the 1.9.0 CMake Tools release. Please upgrade your extension in VSCode and let us know if you encounter any other issues. |
With the following "preset" I can configure and build the "Hello World" application in VS2019 successfully. In VSCode I get linker errors:
There is no issue if the build generator is Visual Studio. Is there anything else necessary to configure for Ninja I am not seeing anything about that in the documentation and I expect for it to just work as in VS2019.
The text was updated successfully, but these errors were encountered: