Improve behavior on multi-config generators - #1384
Open
Frank Richter (res2k) wants to merge 2 commits into
Open
Conversation
Frank Richter (res2k)
force-pushed
the
dev3-multi-config
branch
from
August 30, 2026 17:44
28e9c0d to
9b6a914
Compare
Frank Richter (res2k)
marked this pull request as ready for review
August 30, 2026 17:46
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.
The current
CMakeLists.txtis generally assumesCMAKE_BUILD_TYPEis set at configure time, however, on multi-config generators (such as Visual Studio generators), this is typically not the case. Instead, the configuration can be changed at build time, and anything configuration-dependent needs to utilize generator expressions. (Thankfully, generator expressions using the configuration will also work fine for single-configuration generators.)These changes try to replace use of
CMAKE_BUILD_TYPEwith generator expressions where sensible. In the case of theMI_DEBUGoption, the default case will choose different flags depending on whether Release or Debug configurations are build.If some non-default
MI_DEBUGwas chosen it will have precedence.I made this PR against
dev3mainly to simplify things for me. If these changes are deemed desirable, I can look into porting them to the otherdevbranches later.