-
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
CMakeCache.txt removed when switching kit but cmake.buildDirectory depends on ${buildKitVendor} #2546
Comments
We should be able to detect a change in the build directory when changing the kit. We may not be able to get to this immediately, but we would accept a PR from the community. |
I did some reading. The code that removes the cache file is at src/drivers/cmakeDriver.ts:395 ( The relevant call to that function is the one at src/drivers/cmakeFileApiDriver.ts:180 ( Which is called at src/drivers/cmakeDriver.ts:515 ( Now here's something surprising- the check for change in binaryDir is already written! The bug is that (at line 512) it takes the current The solution is to make it so that all variables related to build kits get properly used to calculate the new binaryDir. Possible fixes:
I can make a PR to examplify what I'm imagining for option 3. But I have no experience with vscode extension development and local-testing of extensions. Unless someone wants to guide me through that I won't be able to test it locally myself. |
A relevant past PR: #2335 which added the call to refreshExpansions in the setKit callback |
Fixed by #2551 :) |
Brief Issue Summary
Severity (from my POV): minor bug
When I do the
select kit
action and change between kits, the extension deletes theCMakeCache.txt
andCMakeFiles.txt
files from the build directory. In my project's settings.json, I have setcmake.buildDirectory
to"${workspaceFolder}/build/${buildKitVendor}"
. due to the file removal, when I try to runcmake --build
in the switched-from (the previous) kit's build directory, I get an error saying the cache file is gone.I think I can fix this by just running the cmake configure command manually in the switched-from kit's folder to recreate the cmake cache file (in which case, do I need to copy the exact command that the extension uses to create the same cmake cache file contents?).
EDIT: see my below comment for the description of the bug.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
I set up my project in this way because I want to be able to easily and quickly test my project locally with GCC, Clang, and (on my windows machine) MSVC, and also be able to compare the build artifact symbol maps and sizes. (Maybe there's a better way to setup my project to achieve this?)
The text was updated successfully, but these errors were encountered: