From 563e8f9f646195a551f7492f6608e720c592ecd3 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sat, 23 Nov 2024 19:36:38 +0100 Subject: [PATCH] port: osx: set minimum OS version to 11 for arm64 builds --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be0126dc4..440e899e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,13 @@ cmake_minimum_required(VERSION 3.16) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) if(APPLE) - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version") + if(CMAKE_OSX_ARCHITECTURES MATCHES "arm64") + # ARM Macs start at OS 11. + set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment version") + else() + # SDL2 requires at least this version for everything to work properly. + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version") + endif() endif() project(pd C CXX) @@ -181,7 +187,6 @@ add_compile_options( -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-variable - -Wno-format-truncation ) # C specific flags @@ -194,6 +199,9 @@ add_compile_options($<$:-Wno-unused-function>) if (APPLE) # Make it look for libs in the executable folder manually since CMake's rpath system is wack set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rpath @executable_path") +else() + # This warning is not recognized by XCode/Clang for some reason. + add_compile_options(-Wno-format-truncation) endif() # Dependencies