From 5f04b5420d16c67cfbc33780944f643f38c41ea8 Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Fri, 27 Mar 2026 00:10:04 +0900 Subject: [PATCH] [Build/MacOS] Add SDL2 framework --- third_party/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index b7b1d6e85..27d517ef0 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -431,6 +431,12 @@ if(WIN32) ) target_include_directories(SDL2 PUBLIC SDL2/include) target_link_libraries(SDL2 PRIVATE setupapi winmm imm32 version) +elseif(APPLE) + # Use system SDL2 framework on macOS + add_library(SDL2 INTERFACE) + find_library(SDL2_LIBRARY SDL2 REQUIRED) + target_include_directories(SDL2 INTERFACE "${SDL2_LIBRARY}/Headers") + target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") # Use system SDL2 on Linux add_library(SDL2 INTERFACE)