Skip to content

Commit

Permalink
port: osx: set minimum OS version to 11 for arm64 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsfdsfgs committed Nov 23, 2024
1 parent df3e035 commit 563e8f9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -181,7 +187,6 @@ add_compile_options(
-Wno-unused-but-set-variable
-Wno-unused-value
-Wno-unused-variable
-Wno-format-truncation
)

# C specific flags
Expand All @@ -194,6 +199,9 @@ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-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
Expand Down

0 comments on commit 563e8f9

Please sign in to comment.