CMake: MacOS cleanup

This commit is contained in:
Vicki Pfau 2021-06-13 00:32:35 -07:00
parent 74d12585a3
commit d70fbdc3a0
2 changed files with 6 additions and 5 deletions

View File

@ -229,7 +229,7 @@ endif()
if(APPLE) if(APPLE)
add_definitions(-D_DARWIN_C_SOURCE) add_definitions(-D_DARWIN_C_SOURCE)
list(APPEND OS_LIB "-framework Foundation") 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") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6")
endif() endif()
endif() endif()
@ -583,8 +583,7 @@ if(USE_FFMPEG)
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libavcodec-extra|libavcodec-ffmpeg-extra${LIBAVCODEC_VERSION_MAJOR}") set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libavcodec-extra|libavcodec-ffmpeg-extra${LIBAVCODEC_VERSION_MAJOR}")
endif() endif()
if(APPLE) if(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework VideoDecodeAcceleration -framework CoreVideo") list(APPEND DEPENDENCY_LIB "-framework VideoDecodeAcceleration" "-framework CoreVideo")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework VideoDecodeAcceleration -framework CoreVideo")
endif() endif()
endif() endif()

View File

@ -48,8 +48,10 @@ endif()
if(WIN32) if(WIN32)
list(APPEND SDL_LIBRARY imm32 setupapi version winmm) list(APPEND SDL_LIBRARY imm32 setupapi version winmm)
elseif(APPLE) elseif(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AppKit -framework AudioUnit -framework Carbon -framework CoreAudio -framework AudioToolbox -framework ForceFeedback -framework IOKit") list(APPEND SDL_LIBRARY "-framework AppKit" "-framework AudioUnit" "-framework Carbon" "-framework CoreAudio" "-framework AudioToolbox" "-framework ForceFeedback" "-framework IOKit")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" PARENT_SCOPE) if(NOT CMAKE_SYSTEM_VERSION VERSION_LESS "17.0") # Darwin 17.x is macOS 10.13
list(APPEND SDL_LIBRARY "-framework Metal")
endif()
endif() endif()
if(NOT SDLMAIN_LIBRARY) if(NOT SDLMAIN_LIBRARY)