Skip to content

Improve behavior on multi-config generators - #1384

Open
Frank Richter (res2k) wants to merge 2 commits into
microsoft:dev3from
res2k:dev3-multi-config
Open

Improve behavior on multi-config generators#1384
Frank Richter (res2k) wants to merge 2 commits into
microsoft:dev3from
res2k:dev3-multi-config

Conversation

@res2k

Copy link
Copy Markdown
Contributor

The current CMakeLists.txt is generally assumes CMAKE_BUILD_TYPE is 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_TYPE with generator expressions where sensible. In the case of the MI_DEBUG option, the default case will choose different flags depending on whether Release or Debug configurations are build.
If some non-default MI_DEBUG was chosen it will have precedence.

I made this PR against dev3 mainly to simplify things for me. If these changes are deemed desirable, I can look into porting them to the other dev branches later.

@res2k
Frank Richter (res2k) marked this pull request as ready for review August 30, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant