Qt: Fix minimum macOS version setting

This commit is contained in:
Vicki Pfau 2023-12-10 21:29:31 -08:00
parent a874450c1a
commit c7240b0e8e
1 changed files with 9 additions and 10 deletions

View File

@ -10,9 +10,6 @@ if(BUILD_SDL)
add_definitions(-DBUILD_SDL) add_definitions(-DBUILD_SDL)
if(SDL2_FOUND) if(SDL2_FOUND)
link_directories(${SDL2_LIBDIR}) link_directories(${SDL2_LIBDIR})
if(APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.7")
endif()
endif() endif()
list(APPEND PLATFORM_LIBRARY ${SDL_LIBRARY}) list(APPEND PLATFORM_LIBRARY ${SDL_LIBRARY})
list(APPEND PLATFORM_SRC ${PLATFORM_SRC} ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-events.c ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-audio.c) list(APPEND PLATFORM_SRC ${PLATFORM_SRC} ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-events.c ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-audio.c)
@ -51,20 +48,22 @@ if(APPLE)
endif() endif()
if(Qt6Widgets_VERSION) if(Qt6Widgets_VERSION)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.14") set(MIN_VER 10.14)
elseif(Qt5Widgets_VERSION MATCHES "^5.15") elseif(Qt5Widgets_VERSION MATCHES "^5.15")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.13") set(MIN_VER 10.13)
elseif(Qt5Widgets_VERSION MATCHES "^5.1[234]") elseif(Qt5Widgets_VERSION MATCHES "^5.1[234]")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.12") set(MIN_VER 10.12)
elseif(Qt5Widgets_VERSION MATCHES "^5.11") elseif(Qt5Widgets_VERSION MATCHES "^5.11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.11") set(MIN_VER 10.11)
elseif(Qt5Widgets_VERSION MATCHES "^5.(9|10)") elseif(Qt5Widgets_VERSION MATCHES "^5.(9|10)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.10") set(MIN_VER 10.10)
elseif(Qt5Widgets_VERSION MATCHES "^5.8") elseif(Qt5Widgets_VERSION MATCHES "^5.8")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9") set(MIN_VER 10.9)
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.8") set(MIN_VER 10.8)
endif() endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${MIN_VER}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${MIN_VER}")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif() endif()