-
Notifications
You must be signed in to change notification settings - Fork 468
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
Cache is not deleted when switching to kit with different target arch, but same host arch #2699
Comments
Thank you for reporting this issue. We may not be able to get to this issue immediately, however, we accept PRs from the community. Lines 1220 to 1226 in 86a48bf
|
I was able to repro this issue. Investigating a fix |
hey @TishSerg This issue should now be fixed in pre-release. If possible try it out and let me know if it works for you :) |
@Ashley-Li Thanks for confirming! |
Brief Issue Summary
The cache is not deleted when switching to a kit with a different target arch, but the same host arch. It results in error during building:
I detailed this in the Additional Info section.
If logs are still needed, let me know. I'll add them.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
I want to compile an MSVC project for x86 and x64. I do switch target arch by switching the kit in CMake Tools Statusbar:

As you can see, there are 4 compilers/kits available:
C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe
C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x86/cl.exe
C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.33.31629/bin/Hostx86/x86/cl.exe
C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.33.31629/bin/Hostx86/x64/cl.exe
The host arch is tagged with a green line in the picture, and the target arch is tagged with a cyan line.
When I switch between the kits with the different host arch, CMake Cache gets removed.
Example of switching from kit 1 to kit 3 (after successful build on kit 1):
Then on the build, CMake configures the folder and successfully builds an
exe
.But when switching kits with the same host arch, CMake doesn't remove the Cache.
Example of switching from kit 1 to kit 2 (after successful build on kit 1):
As you can see it lacks
Removing
Cache lines.Then on the build, CMake tries to configure the folder, but fails:
To fix that I have to execute in command palette
>CMake: Delete Cache and Reconfigure
. Only after this, I can successfully build with the new kit selected.Expected behavior:
Remove the Cache when the target arch is switched.
Albeit, I don't know if the Cache removal is necessary when only the host arch is switched (current behavior), i.e [kit 1] ↔ [kit 4] or [kit 2] ↔ [kit 3]. Maybe it's ok to not remove the Cache in this situation. Maybe it was intended behavior, but someone messed that up and set Cache removal on host arch switching instead of target arch switching?
The text was updated successfully, but these errors were encountered: