From 8f27869715803817cb25f81d98622186fe9b0c17 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 9 Oct 2022 04:00:26 +0000 Subject: [PATCH] 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 --- cmake/FindSDL2.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake index 0c383a86..3e0514b2 100644 --- a/cmake/FindSDL2.cmake +++ b/cmake/FindSDL2.cmake @@ -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