build: fix finding static vcpkg SDL2

The static lib is now called `SDL2-static.lib` and the debug version is
called `SDL2-staticd.lib`.

Adjust our `cmake/FindSDL2.cmake` for the new vcpkg naming convention.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2022-10-09 04:00:26 +00:00
parent eed171aac0
commit 8f27869715
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 8 additions and 2 deletions

View File

@ -110,8 +110,14 @@ if(SDL2_STATIC)
endif()
unset(lib_suffix)
if(MSVC AND CMAKE_BUILD_TYPE MATCHES "^(Debug|RelWithDebInfo)$")
set(lib_suffix d)
if(MSVC)
if(VCPKG_TARGET_TRIPLET MATCHES "-static$")
set(lib_suffix "${lib_suffix}-static")
endif()
if(CMAKE_BUILD_TYPE MATCHES "^(Debug|RelWithDebInfo)$")
set(lib_suffix "${lib_suffix}d")
endif()
endif()
FIND_LIBRARY(SDL2_LIBRARY_TEMP