From 616923c1b0e1e5a90fbb1922ed59da97a4300653 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 18 Jul 2024 20:24:54 +0200
Subject: [PATCH] cmake: fix building UWP with non-MSVC generator
(cherry picked from commit 7fb8b62a4d3f75137e00ddc09239f47c4b8b0305)
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f93eff534add9..0a292e0e82bfa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,8 +33,8 @@ set(PKGCONFIG_DEPENDS)
add_library(sdl-build-options INTERFACE)
if(WINDOWS_STORE)
- target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1")
- target_compile_options(sdl-build-options INTERFACE "-ZW")
+ target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1" "WINAPI_FAMILY=WINAPI_FAMILY_APP")
+ target_compile_options(sdl-build-options INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-ZW>" "$<$<COMPILE_LANGUAGE:CXX>:-EHsc>")
endif()
# CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"