-
Notifications
You must be signed in to change notification settings - Fork 454
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
Support launching cmake.exe from a VS dev environment even when not using CL #3497
Comments
Thanks @tristanlabelle! I'll mark this appropriately and put this on our backlog to prioritize for upcoming releases. |
We are not going to be able to solve this in 1.17, so I am moving this to 1.18. However, we have a proposal, please @tristanlabelle let us know what you think. We would propose that we, rather than doing the "magic" that we currently do, will expose a setting that, by default, disables the use of a VS dev environment. However, this would then allow users to enable this setting, which would introduce a dev environment so that your scenario is supported. What do you think? |
@gcampbell-msft Yes, that's what we need. We'd also like to control the target architecture and windows sdk version to be used when setting up the vs dev environment on a per-configuration level, either because CMake Tools would deduce it from standard CMake cache variables from that configuration, or by having a specific override property in CMakePresets.json. |
Moved this to "On Deck" as we aren't likely to make it into the official 1.18 release. We do hope to merge this into pre-release (after releasing 1.18) as soon as we can. Thank you. |
Hi @tristanlabelle! Could you please test this version of cmaketools: cmake-tools-1.13.0.zip and let us know if it fixes your issue? Please make sure to change the extension from |
@qarni it worked for CMake configure but the build (as invoked through a task with type: "cmake" and command: "build") fails to find link.exe and other tools that should be in the vsdevenv path. |
@tristanlabelle I'm investigating getting a fix for you, and I'm wondering if you can provide a small repro for the case you want to support and the issue you're seeing? As an initial fix we're trying to simply improve our "magic" such that it applies to the case where the ninja generator is missing, even if you have cl on path. Thanks |
@tristanlabelle Additionally, to understand your scenario better, are you only using the Ninja generator? Are there scenarios in which you are using Visual Studio generators? Also, switching from |
@tristanlabelle Pending your answers to the above questions, I'm expecting there to be more code changes and investigation, but I have a vsix here that I'm curious as to whether it address your fix: |
@tristanlabelle I investigated further and tested out implementing a setting like the one you originally suggested, could you test it out? |
Thanks for #3892 ! When should we expect to see this in a release? (and meanwhile, in a pre-release?) @gcampbell-msft |
@tristanlabelle You should see the changes in pre-release now. As for an official release, we try our best to follow the schedule we set here: https://github.com/microsoft/vscode-cmake-tools/wiki/Release-schedule |
Maybe this feature should be more versatile? like |
@OkazakiNagisa , if this were implemented as a script to be invoked, we'd have to hardcode the path to the vsdevcmd batch file, and it couldn't rely on detecting the architectures and toolsets from the presets. I think it needs special support. |
MSVC indeed requires special handling by vswhere👀 I mean cmake-tools can support environment setup mechanism for preset by calling vswhere, or a script (cmake toolchain is unnecessary since it can be assigned in cmake preset file), like cmake-kits schema. This would be useful when using EWDK toolchain, which is not detectable by vswhere but by design |
Brief Issue Summary
Switching the CMake compiler from cl to clang will make the CMake Tools extension stop launching
cmake.exe
from within a VS dev environment. This is problematic when relying onninja
from the VS installation or if usingmidlrt.exe
from the Windows SDK, which fails if it cannot findcl.exe
as a C preprocessor.CMake Tools Diagnostics
Debug Log
No response
Additional Information
One solution could be to add a
"cmake.alwaysUseVSEnvironment"
setting.This is related to #1836 as per discussion #3486.
The text was updated successfully, but these errors were encountered: