CMake: Fix macOS version detection

This commit is contained in:
Vicki Pfau 2021-06-12 22:17:26 -07:00
parent b97f97159d
commit 9cddd4d006
2 changed files with 2 additions and 2 deletions

View File

@ -229,7 +229,7 @@ endif()
if(APPLE)
add_definitions(-D_DARWIN_C_SOURCE)
list(APPEND OS_LIB "-framework Foundation")
if(CMAKE_SYSTEM_VERSION VERSION_GREATER "10.5.8")
if(NOT CMAKE_SYSTEM_VERSION VERSION_LESS "10.0") # Darwin 10.x is Mac OS X 10.6
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6")
endif()
endif()

View File

@ -49,7 +49,7 @@ if(WIN32)
list(APPEND SDL_LIBRARY imm32 setupapi version winmm)
elseif(APPLE)
list(APPEND SDL_LIBRARY "-framework AppKit" "-framework AudioUnit" "-framework Carbon" "-framework CoreAudio" "-framework AudioToolbox" "-framework ForceFeedback" "-framework IOKit")
if(NOT CMAKE_SYSTEM_VERSION VERSION_LESS "10.13")
if(NOT CMAKE_SYSTEM_VERSION VERSION_LESS "17.0") # Darwin 17.x is macOS 10.13
list(APPEND SDL_LIBRARY "-framework Metal")
endif()
endif()