CMake: Set minimum deployment target for darwin platforms
Same value as QMAKE_IOS_DEPLOYMENT_TARGET in mkspecs/macx-ios-clang/qmake.conf, etc. Change-Id: I1f6a07d73c2126d0286e8d26f7e61a690607c8ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
This commit is contained in:
parent
344eb0d29d
commit
627351f561
@ -175,16 +175,30 @@ endfunction()
|
|||||||
|
|
||||||
function(qt_auto_detect_darwin)
|
function(qt_auto_detect_darwin)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
# If no CMAKE_OSX_DEPLOYMENT_TARGET is provided, default
|
# If no CMAKE_OSX_DEPLOYMENT_TARGET is provided, default to a value that Qt defines.
|
||||||
# to a value that we choose. This replicates the behavior
|
# This replicates the behavior in mkspecs/common/macx.conf where
|
||||||
# in mkspecs/common/macx.conf where
|
|
||||||
# QMAKE_MACOSX_DEPLOYMENT_TARGET is set.
|
# QMAKE_MACOSX_DEPLOYMENT_TARGET is set.
|
||||||
# Currently only set for macOS, and not the mobile platforms.
|
set(description
|
||||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET AND NOT CMAKE_SYSTEM_NAME)
|
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING
|
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
|
if(NOT CMAKE_SYSTEM_NAME)
|
||||||
|
# macOS
|
||||||
|
set(version "10.14")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL iOS)
|
||||||
|
set(version "12.0")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS)
|
||||||
|
set(version "5.0")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS)
|
||||||
|
set(version "12.0")
|
||||||
|
endif()
|
||||||
|
if(version)
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "${version}" CACHE STRING "${description}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
|
message(STATUS
|
||||||
|
"CMAKE_OSX_DEPLOYMENT_TARGET set to: \"${CMAKE_OSX_DEPLOYMENT_TARGET}\".")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET set to: \"${CMAKE_OSX_DEPLOYMENT_TARGET}\".")
|
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user