diff options
author | Julian Eisel <julian@blender.org> | 2020-08-07 14:04:31 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-08-07 14:04:31 +0300 |
commit | 0d2d4a6d4a75ac38c41f872c88255eab70e88ab7 (patch) | |
tree | b7a7518af86dddba48e05a98b3c2be55e8804721 /build_files/cmake/platform/platform_apple_xcode.cmake | |
parent | 9b416c66fb714bdfd15a481489dbf650d0f389ea (diff) | |
parent | cfc6f9eb18e701f5be601b95c45004e8cf7fbc81 (diff) |
Merge branch 'master' into temp-ui-button-type-refactortemp-ui-button-type-refactor
Diffstat (limited to 'build_files/cmake/platform/platform_apple_xcode.cmake')
-rw-r--r-- | build_files/cmake/platform/platform_apple_xcode.cmake | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/build_files/cmake/platform/platform_apple_xcode.cmake b/build_files/cmake/platform/platform_apple_xcode.cmake index f1f02c151ee..3a43ca317dd 100644 --- a/build_files/cmake/platform/platform_apple_xcode.cmake +++ b/build_files/cmake/platform/platform_apple_xcode.cmake @@ -21,8 +21,10 @@ # Xcode and system configuration for Apple. if(NOT CMAKE_OSX_ARCHITECTURES) - set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING - "Choose the architecture you want to build Blender for: i386, x86_64 or ppc" + execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) + message(STATUS "Detected native architecture ${ARCHITECTURE}.") + set(CMAKE_OSX_ARCHITECTURES ${ARCHITECTURE} CACHE STRING + "Choose the architecture you want to build Blender for: arm64 or x86_64" FORCE) endif() @@ -65,13 +67,9 @@ endif() message(STATUS "Detected OS X ${OSX_SYSTEM} and Xcode ${XCODE_VERSION} at ${XCODE_BUNDLE}") -# Older Xcode versions had different approach to the directory hiearchy. -# Require newer Xcode which is also have better chances of being able to compile with the -# required deployment target. -# -# NOTE: Xcode version 8.2 is the latest one which runs on macOS 10.11. -if(${XCODE_VERSION} VERSION_LESS 8.2) - message(FATAL_ERROR "Only Xcode version 8.2 and newer is supported") +# Require a relatively recent Xcode version. +if(${XCODE_VERSION} VERSION_LESS 10.0) + message(FATAL_ERROR "Only Xcode version 10.0 and newer is supported") endif() # note: xcode-select path could be ambiguous, @@ -133,14 +131,21 @@ if(${CMAKE_GENERATOR} MATCHES "Xcode") endif() unset(OSX_SDKROOT) -# 10.11 is our min. target, if you use higher sdk, weak linking happens + +# 10.13 is our min. target, if you use higher sdk, weak linking happens +if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") + set(OSX_MIN_DEPLOYMENT_TARGET 11.00) +else() + set(OSX_MIN_DEPLOYMENT_TARGET 10.13) +endif() + if(CMAKE_OSX_DEPLOYMENT_TARGET) - if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.11) - message(STATUS "Setting deployment target to 10.11, lower versions are not supported") - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE) + if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS ${OSX_MIN_DEPLOYMENT_TARGET}) + message(STATUS "Setting deployment target to ${OSX_MIN_DEPLOYMENT_TARGET}, lower versions are not supported") + set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" FORCE) endif() else() - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE) + set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" FORCE) endif() if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode") |