Skip to content
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

[feature] include CMAKE_<LANG>_COMPILER in generated CMakePresets.json #17543

Open
1 task done
melak47 opened this issue Dec 31, 2024 · 2 comments
Open
1 task done

[feature] include CMAKE_<LANG>_COMPILER in generated CMakePresets.json #17543

melak47 opened this issue Dec 31, 2024 · 2 comments
Assignees

Comments

@melak47
Copy link
Contributor

melak47 commented Dec 31, 2024

What is your suggestion?

Currently, VSCode's cmake-tools extension seems to check for "CMAKE_<C/CXX>_COMPILER": "cl" being present in the preset to determine if it should set up the vcvars environment for your build tasks.

When using the CMakeDeps + CMakeToolchain generators (with the Ninja CMake generator),
the preset generated by conan does not set those cache variables (because they are set in the toolchain file).

As a result, cmake-tools does not set up the environment, meaning you have to activate the environment manually before starting VSCode, or write another preset inheriting from the conan generated preset to add the variables.

I was wondering if these variables could just be included in the preset to avoid this?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Jan 7, 2025
@memsharded
Copy link
Member

Hi @melak47

Thanks for your feedback.

This was tried in the past in:

and it had to be reverted. See:

It is pending to try again and do further investigation if this can be done, but it is not as trivial as it seems

@melak47
Copy link
Contributor Author

melak47 commented Jan 7, 2025

I see, thanks for finding that.
For now there is a workaround for the vscode/cmake-tools issue, and it might get solved on their side eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants