Fix RelWithDebInfo / MinSizeRel when using find_package(SFML)#3685
Fix RelWithDebInfo / MinSizeRel when using find_package(SFML)#3685Krishnayan-Bhatt wants to merge 1 commit into
Conversation
Multi-config generators (e.g. Visual Studio) define RelWithDebInfo and MinSizeRel, but installed SFML package files only declare Debug and Release import locations. Set MAP_IMPORTED_CONFIG_* so those configurations use the Release libraries and avoid incorrect .lib selection and CRT mismatches at runtime. Fixes SFML#3424 Made-with: Cursor
|
If I understand this correctly, this merely maps MinSizeRel and RelWithDebInfo to Release, but doesn't actually provide the wanted configuration. Is that correct? |
|
Yes. SFML’s installed targets only expose Debug and Release import locations; we don’t build separate MinSizeRel/RelWithDebInfo SFML libraries. This sets CMake’s MAP_IMPORTED_CONFIG_* so that when a consumer uses those MSVC configurations, they link the Release SFML import libs (correct optimization + CRT pairing) instead of CMake picking the wrong mapping. If we ever shipped distinct RelWithDebInfo SFML binaries, we’d add those to the export; until then, mapping to Release is the intended fix for find_package consumers. |
|
What's stopping us from adding proper support for the configurations? |
|
For true proper support, the installed/exported SFML::... targets would need to include RelWithDebInfo and MinSizeRel import locations (i.e. config-specific exported artifacts). Right now the SFML package only declares Debug/Release import locations, so CMake has nothing to bind RelWithDebInfo/MinSizeRel to. Given what’s shipped, mapping RelWithDebInfo/MinSizeRel to Release is the correct fix; adding full support would require building and exporting those extra configurations in the packaging/CI workflow. |
04b4413 to
f55fa1d
Compare
Multi-config generators (e.g. Visual Studio) define RelWithDebInfo and MinSizeRel, but installed SFML package files only declare Debug and Release import locations. Set MAP_IMPORTED_CONFIG_* so those configurations use the Release libraries and avoid incorrect .lib selection and CRT mismatches at runtime.
Fixes #3424
Made-with: Cursor
Description
This PR is related to the issue #
Tasks
How to test this PR?