fix: CMakeRun defaults to Debug configuration regardless of build type.#318
Merged
Civitasv merged 1 commit intoCivitasv:masterfrom May 17, 2025
Merged
fix: CMakeRun defaults to Debug configuration regardless of build type.#318Civitasv merged 1 commit intoCivitasv:masterfrom
Civitasv merged 1 commit intoCivitasv:masterfrom
Conversation
…instead of always Debug
Owner
|
Thank you for addressing this! The root cause was indeed a compatibility issue with Multi-Configuration Generators (e.g., Visual Studio, Xcode, and Ninja Multi-Config). While the plugin currently lacks full support for these workflows. If you encounter similar issues, I’d greatly appreciate if you could report them here. Your contributions help improve the tool for everyone! 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When executing a :CMakeRun with the build type of "Release", the target is attempted to be executed from the nonexistent "\Release\Debug" directory.
After looking into it, it seems that the function Config:get_codemodel_targets() contains the bug producing this error.
The file (path_to_cmake)/out/(Release/Debug/etc)/.cmake/api/v1/replycodmodel.....json contains a key "configurations" whose value is an array of configurations for different build types (Release, Debug, etc).
Inside of Config:get_codemodel_targets() is this line:
codemodel_json["configurations"][1]This simply grabs the first configuration in the array regardless of the build type (in my case it seems to always be Debug).I replaced the above line of code with the snippet below:
This simply loops through the array of configurations, checking its name against the currently selected build type.
I'm not sure if it's possible for the current build type to not be in the codemodel file, so I added a error at the end.
After changes:
main.cpp