-
Notifications
You must be signed in to change notification settings - Fork 430
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
Different behavior between extension and CMake cli, when choosing the default generator in presets #2734
Comments
vscode-cmake-tools/src/cmakeProject.ts Lines 558 to 572 in 01c4796
Which searches for alternatives in user configuration. If it is still not defined, the extension will uses |
What should be happening with presets is that if the generator is not defined somewhere in the inheritance, the preset should be considered invalid and not available for use. In that case, we shouldn't be hitting any fallback code. Are you seeing incorrect behavior done by the extension? And if so, can you share your repro? |
Thanks for your answers!
I think this is not correct, at least from what I got from the CMake docs. The generator field is optional...if it is missing and no generator is defined in the preset inheritance it is on the cmake command to figure out the generator.
... which explicitly uses |
Sorry, I mispoke. You are correct. The behavior changed in v3. We might not have fixed the extension to deal with that yet. I don't believe the extension has a path to correctly handle unset generators yet either. For the time being we recommend you set it explicitly if possible. |
Thanks... for my personal workflow, setting it explicitly would be fine, but we are recommending this extension in our project at https://github.com/CodeIntelligenceTesting/cifuzz and would like having consistent behavior for our users. Long story short: Would you prefer handling the issue yourself or would it be fine for you if I start working on a PR? |
We would accept a PR if you are willing to work on this. |
@bobbrow I am working on the PR (main...jochil:vscode-cmake-tools:v3-preset-default-generator) but I have a few questions:
|
|
Awesome! Thanks for the help! We'll try to take a look within the next few days. |
Brief Issue Summary
As the generator field is optional in a preset using CMake directly falls back to the default generator discovery procedure. I would expect the vscode extension to do the same... but it falls back to Ninja as generator, according to observed behavior and this code block:
vscode-cmake-tools/src/preset.ts
Lines 707 to 712 in 01c4796
From the CMake docs at https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html:
I would like to know if there is a reason (I might have overlooked) for this behavior... if not I would be happy to create a PR 🙂
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: