Skip to content

vcpkg doesn't install CMake targets for RelWithDebInfo and MinSizeRel #5621

@SupSuper

Description

@SupSuper

For libraries that provide CMake targets when installed (eg. SDL2), vcpkg will only generate import files for Debug and Release (eg. SDL2Targets-debug.cmake and SDL2Targets-release.cmake). This leaves vcpkg/CMake to incorrectly default to Debug when using RelWithDebInfo and MinSizeRel, causing bugs like linking the wrong version or not copying the DLL (#2559 #3463).

One can workaround this at the project level, but this shouldn't be required:

set_target_properties(SDL2::SDL2 SDL2::SDL2main PROPERTIES
	MAP_IMPORTED_CONFIG_MINSIZEREL Release
	MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release
)

vcpkg should automatically support the RelWithDebInfo and MinSizeRel targets as Release, either by generating import files for all 3 or redirecting them like in the workaround above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions