diff options
author | Stefan Werner <stewreo@gmail.com> | 2020-07-16 10:25:55 +0300 |
---|---|---|
committer | Stefan Werner <stewreo@gmail.com> | 2020-07-16 10:37:38 +0300 |
commit | 9715ad5acad9a42b65efd64b6c7fbe157f949bfb (patch) | |
tree | 9a68c332ede76d239ee45e970171df6864bf4633 | |
parent | ad4928a1710fe96749484b3823513d3f7c5624aa (diff) |
macOS: Support arm64 architecture.
Enabling all `make deps` dependencies with the exception of Embree and OIDN.
After that, Blender can be compiled on an Apple Silicon Mac just like on any
Intel based Mac. There are still compiler warnings that need to be
investigated and there are probably a couple of bug still to be discovered
and to be fixed.
Most patches to the dependencies are simple and are about disabling SSE and
setting the proper architecture to compiile for. Notable exception is Python,
where I back ported a yet to be accepted PR for upstream Python:
https://github.com/python/cpython/pull/21249
Cross compiling or buliding a Universal Binary is not supported yet.
The minimum macOS target version for x86_64 remains at 10.13, the target
for arm64 is 11.00.
Differential Revision: https://developer.blender.org/D8236
27 files changed, 597 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 149b7d93aed..824f635e2b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -900,7 +900,7 @@ if(MSVC) # endianess-detection and auto-setting is counterproductive # so we just set endianness according CMAKE_OSX_ARCHITECTURES -elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64) +elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64 OR CMAKE_OSX_ARCHITECTURES MATCHES arm64) add_definitions(-D__LITTLE_ENDIAN__) elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64) add_definitions(-D__BIG_ENDIAN__) diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt index 7e7c5d58d71..276311fe2d8 100644 --- a/build_files/build_environment/CMakeLists.txt +++ b/build_files/build_environment/CMakeLists.txt @@ -94,9 +94,11 @@ if(UNIX) else() include(cmake/pugixml.cmake) endif() -include(cmake/ispc.cmake) -include(cmake/openimagedenoise.cmake) -include(cmake/embree.cmake) +if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")) + include(cmake/ispc.cmake) + include(cmake/openimagedenoise.cmake) + include(cmake/embree.cmake) +endif() if(NOT APPLE) include(cmake/xr_openxr.cmake) endif() diff --git a/build_files/build_environment/cmake/clang.cmake b/build_files/build_environment/cmake/clang.cmake index f7dfd434d4a..8b928f968fd 100644 --- a/build_files/build_environment/cmake/clang.cmake +++ b/build_files/build_environment/cmake/clang.cmake @@ -30,6 +30,11 @@ else() set(CLANG_GENERATOR "Unix Makefiles") endif() +if(APPLE) + set(CLANG_EXTRA_ARGS ${CLANG_EXTRA_ARGS} + -DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a + ) +endif() ExternalProject_Add(external_clang URL ${CLANG_URI} diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index 33b7f9db192..f860778a6a1 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -132,8 +132,12 @@ harvest(openimageio/bin openimageio/bin "maketx") harvest(openimageio/bin openimageio/bin "oiiotool") harvest(openimageio/include openimageio/include "*") harvest(openimageio/lib openimageio/lib "*.a") -harvest(openimagedenoise/include openimagedenoise/include "*") -harvest(openimagedenoise/lib openimagedenoise/lib "*.a") +if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")) + harvest(openimagedenoise/include openimagedenoise/include "*") + harvest(openimagedenoise/lib openimagedenoise/lib "*.a") + harvest(embree/include embree/include "*.h") + harvest(embree/lib embree/lib "*.a") +endif() harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h") harvest(openjpeg/lib openjpeg/lib "*.a") harvest(opensubdiv/include opensubdiv/include "*.h") @@ -168,8 +172,6 @@ harvest(vpx/lib ffmpeg/lib "*.a") harvest(webp/lib ffmpeg/lib "*.a") harvest(x264/lib ffmpeg/lib "*.a") harvest(xvidcore/lib ffmpeg/lib "*.a") -harvest(embree/include embree/include "*.h") -harvest(embree/lib embree/lib "*.a") harvest(usd/include usd/include "*.h") harvest(usd/lib/usd usd/lib/usd "*") harvest(usd/plugin usd/plugin "*") diff --git a/build_files/build_environment/cmake/llvm.cmake b/build_files/build_environment/cmake/llvm.cmake index 981db9c72b7..8c9a6076068 100644 --- a/build_files/build_environment/cmake/llvm.cmake +++ b/build_files/build_environment/cmake/llvm.cmake @@ -16,11 +16,17 @@ # # ***** END GPL LICENSE BLOCK ***** +if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") + set(LLVM_TARGETS AArch64) +else() + set(LLVM_TARGETS X86) +endif() + set(LLVM_EXTRA_ARGS -DLLVM_USE_CRT_RELEASE=MD -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_INCLUDE_TESTS=OFF - -DLLVM_TARGETS_TO_BUILD=X86 + -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS} -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_BUILD_LLVM_C_DYLIB=OFF diff --git a/build_files/build_environment/cmake/numpy.cmake b/build_files/build_environment/cmake/numpy.cmake index abf2464e88c..03316a8fc63 100644 --- a/build_files/build_environment/cmake/numpy.cmake +++ b/build_files/build_environment/cmake/numpy.cmake @@ -38,6 +38,7 @@ ExternalProject_Add(external_numpy PREFIX ${BUILD_DIR}/numpy PATCH_COMMAND ${NUMPY_PATCH} CONFIGURE_COMMAND "" + PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff LOG_BUILD 1 BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable INSTALL_COMMAND "" diff --git a/build_files/build_environment/cmake/opencolorio.cmake b/build_files/build_environment/cmake/opencolorio.cmake index 502e9a6c03b..e8b0043edf7 100644 --- a/build_files/build_environment/cmake/opencolorio.cmake +++ b/build_files/build_environment/cmake/opencolorio.cmake @@ -30,6 +30,13 @@ set(OPENCOLORIO_EXTRA_ARGS -DOCIO_STATIC_JNIGLUE=OFF ) +if(APPLE AND NOT("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")) + set(OPENCOLORIO_EXTRA_ARGS + ${OPENCOLORIO_EXTRA_ARGS} + -DOCIO_USE_SSE=OFF + ) +endif() + if(WIN32) set(OCIO_PATCH opencolorio_win.diff) set(OPENCOLORIO_EXTRA_ARGS diff --git a/build_files/build_environment/cmake/openmp.cmake b/build_files/build_environment/cmake/openmp.cmake index 05b590e4926..ec0756a6693 100644 --- a/build_files/build_environment/cmake/openmp.cmake +++ b/build_files/build_environment/cmake/openmp.cmake @@ -22,6 +22,7 @@ ExternalProject_Add(external_openmp DOWNLOAD_DIR ${DOWNLOAD_DIR} URL_HASH MD5=${OPENMP_HASH} PREFIX ${BUILD_DIR}/openmp + PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS} INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @executable_path/../Resources/lib/libomp.dylib runtime/src/libomp.dylib && make install INSTALL_DIR ${LIBDIR}/openmp diff --git a/build_files/build_environment/cmake/options.cmake b/build_files/build_environment/cmake/options.cmake index 39334af0bcf..fe2f1fa34e5 100644 --- a/build_files/build_environment/cmake/options.cmake +++ b/build_files/build_environment/cmake/options.cmake @@ -117,16 +117,28 @@ else() COMMAND xcodebuild -version -sdk macosx SDKVersion OUTPUT_VARIABLE MACOSX_SDK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - set(OSX_ARCHITECTURES x86_64) - set(OSX_DEPLOYMENT_TARGET 10.13) + if(NOT CMAKE_OSX_ARCHITECTURES) + execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) + message(STATUS "Detected native architecture ${ARCHITECTURE}.") + set(CMAKE_OSX_ARCHITECTURES "${ARCHITECTURE}") + endif() + if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64") + set(OSX_DEPLOYMENT_TARGET 10.13) + else() + set(OSX_DEPLOYMENT_TARGET 11.00) + endif() set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk) - set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}") - set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++") - set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}") - set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13 + set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}") + set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}") + set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}") + if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64") + set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13 + else() + set(PLATFORM_BUILD_TARGET --build=aarch64-apple-darwin20.0.0) # macOS 11.00 + endif() set(PLATFORM_CMAKE_FLAGS - -DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT} ) diff --git a/build_files/build_environment/cmake/png.cmake b/build_files/build_environment/cmake/png.cmake index 8dd3c25b88b..9f8641873e6 100644 --- a/build_files/build_environment/cmake/png.cmake +++ b/build_files/build_environment/cmake/png.cmake @@ -22,6 +22,10 @@ set(PNG_EXTRA_ARGS -DPNG_STATIC=ON ) +if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")) + set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=on -DCMAKE_SYSTEM_PROCESSOR="aarch64") +endif() + ExternalProject_Add(external_png URL ${PNG_URI} DOWNLOAD_DIR ${DOWNLOAD_DIR} diff --git a/build_files/build_environment/cmake/python.cmake b/build_files/build_environment/cmake/python.cmake index 681b20577d6..9cd56423941 100644 --- a/build_files/build_environment/cmake/python.cmake +++ b/build_files/build_environment/cmake/python.cmake @@ -69,12 +69,17 @@ else() export ac_cv_header_libintl_h=no && export ac_cv_lib_intl_textdomain=no ) + if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") + set(PYTHON_FUNC_CONFIGS ${PYTHON_FUNC_CONFIGS} && export PYTHON_DECIMAL_WITH_MACHINE=ansi64) + endif() set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && ${PYTHON_FUNC_CONFIGS}) set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe) + set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_macos.diff) else() set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV}) set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python) - endif() + set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff) + endif() set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl") set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include") @@ -84,7 +89,6 @@ else() export CPPFLAGS=${PYTHON_CFLAGS} && export LDFLAGS=${PYTHON_LDFLAGS} && export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig) - set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff) ExternalProject_Add(external_python URL ${PYTHON_URI} diff --git a/build_files/build_environment/cmake/sqlite.cmake b/build_files/build_environment/cmake/sqlite.cmake index 9fa2fa7c708..90330c68811 100644 --- a/build_files/build_environment/cmake/sqlite.cmake +++ b/build_files/build_environment/cmake/sqlite.cmake @@ -51,7 +51,7 @@ ExternalProject_Add(external_sqlite DOWNLOAD_DIR ${DOWNLOAD_DIR} URL_HASH SHA1=${SQLITE_HASH} PREFIX ${BUILD_DIR}/sqlite - PATCH_COMMAND ${SQLITE_PATCH_CMD} + PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/sqlite/src/external_sqlite < ${PATCH_DIR}/sqlite.diff CONFIGURE_COMMAND ${SQLITE_CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/sqlite ${SQLITE_CONFIGURATION_ARGS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && make -j${MAKE_THREADS} INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && make install diff --git a/build_files/build_environment/cmake/ssl.cmake b/build_files/build_environment/cmake/ssl.cmake index 6d81c6c9a26..e1c168817f4 100644 --- a/build_files/build_environment/cmake/ssl.cmake +++ b/build_files/build_environment/cmake/ssl.cmake @@ -20,7 +20,7 @@ set(SSL_CONFIGURE_COMMAND ./Configure) set(SSL_PATCH_CMD echo .) if(APPLE) - set(SSL_OS_COMPILER "blender-darwin-x86_64") + set(SSL_OS_COMPILER "blender-darwin-${CMAKE_OSX_ARCHITECTURES}") else() if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128) diff --git a/build_files/build_environment/cmake/ssl.conf b/build_files/build_environment/cmake/ssl.conf index 818e5a625ab..8a9c9dcab4c 100644 --- a/build_files/build_environment/cmake/ssl.conf +++ b/build_files/build_environment/cmake/ssl.conf @@ -12,4 +12,9 @@ my %targets = ( inherit_from => [ "darwin64-x86_64-cc" ], cflags => add("-fPIC"), }, + "blender-darwin-arm64" => { + inherit_from => [ "darwin-common" ], + cxxflags => add("-fPIC -arch arm64"), + cflags => add("-fPIC -arch arm64"), + }, ); diff --git a/build_files/build_environment/cmake/theora.cmake b/build_files/build_environment/cmake/theora.cmake index b1352c40e37..b6f9c589423 100644 --- a/build_files/build_environment/cmake/theora.cmake +++ b/build_files/build_environment/cmake/theora.cmake @@ -27,6 +27,7 @@ ExternalProject_Add(external_theora DOWNLOAD_DIR ${DOWNLOAD_DIR} URL_HASH SHA256=${THEORA_HASH} PREFIX ${BUILD_DIR}/theora + PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/theora/src/external_theora < ${PATCH_DIR}/theora.diff CONFIGURE_COMMAND ${THEORA_CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/theora --disable-shared --enable-static diff --git a/build_files/build_environment/cmake/vpx.cmake b/build_files/build_environment/cmake/vpx.cmake index 741493859e2..799dea0189c 100644 --- a/build_files/build_environment/cmake/vpx.cmake +++ b/build_files/build_environment/cmake/vpx.cmake @@ -24,7 +24,11 @@ if(WIN32) endif() else() if(APPLE) - set(VPX_EXTRA_FLAGS --target=x86_64-darwin13-gcc) + if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") + set(VPX_EXTRA_FLAGS --target=generic-gnu) + else() + set(VPX_EXTRA_FLAGS --target=x86_64-darwin17-gcc) + endif() else() set(VPX_EXTRA_FLAGS --target=generic-gnu) endif() diff --git a/build_files/build_environment/cmake/x264.cmake b/build_files/build_environment/cmake/x264.cmake index 96bf031ce83..993e4591cb7 100644 --- a/build_files/build_environment/cmake/x264.cmake +++ b/build_files/build_environment/cmake/x264.cmake @@ -22,9 +22,14 @@ endif() if(APPLE) - set(X264_CONFIGURE_ENV - export AS=${LIBDIR}/nasm/bin/nasm - ) + if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") + set(X264_EXTRA_ARGS ${X264_EXTRA_ARGS} "--disable-asm") + set(X264_CONFIGURE_ENV echo .) + else() + set(X264_CONFIGURE_ENV + export AS=${LIBDIR}/nasm/bin/nasm + ) + endif() else() set(X264_CONFIGURE_ENV echo .) endif() diff --git a/build_files/build_environment/patches/blosc.diff b/build_files/build_environment/patches/blosc.diff index ee5826a2e98..0080694fae1 100644 --- a/build_files/build_environment/patches/blosc.diff +++ b/build_files/build_environment/patches/blosc.diff @@ -91,3 +91,41 @@ diff -Naur external_blosc.orig/blosc/blosc.c external_blosc/blosc/blosc.c /* Some useful units */ + diff --git a/blosc/shuffle.c b/blosc/shuffle.c + index 84b5095..23053b4 100644 + --- a/blosc/shuffle.c + +++ b/blosc/shuffle.c + @@ -490,12 +490,12 @@ void unshuffle(size_t bytesoftype, size_t blocksize, + #else /* no __SSE2__ available */ + + void shuffle(size_t bytesoftype, size_t blocksize, + - uint8_t* _src, uint8_t* _dest) { + + const uint8_t* _src, uint8_t* _dest) { + _shuffle(bytesoftype, blocksize, _src, _dest); + } + + void unshuffle(size_t bytesoftype, size_t blocksize, + - uint8_t* _src, uint8_t* _dest) { + + const uint8_t* _src, uint8_t* _dest) { + _unshuffle(bytesoftype, blocksize, _src, _dest); + } + --- a/cmake/FindSSE.cmake + +++ b/cmake/FindSSE.cmake + @@ -49,6 +49,17 @@ + set(AVX_FOUND false CACHE BOOL "AVX available on host") + ENDIF (AVX_TRUE) + ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") + + execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) + + message(STATUS "Detected architecture ${ARCHITECTURE}") + + IF("${ARCHITECTURE}" STREQUAL "arm64") + + set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") + + set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") + + set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") + + set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") + + set(AVX_FOUND false CACHE BOOL "AVX available on host") + + return() + + ENDIF() + + + EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE + CPUINFO) +
\ No newline at end of file diff --git a/build_files/build_environment/patches/numpy.diff b/build_files/build_environment/patches/numpy.diff new file mode 100644 index 00000000000..a9b783dd856 --- /dev/null +++ b/build_files/build_environment/patches/numpy.diff @@ -0,0 +1,27 @@ +diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py +index ba2b1f4..b10f7df 100644 +--- a/numpy/distutils/system_info.py ++++ b/numpy/distutils/system_info.py +@@ -2164,8 +2164,8 @@ class accelerate_info(system_info): + 'accelerate' in libraries): + if intel: + args.extend(['-msse3']) +- else: +- args.extend(['-faltivec']) ++# else: ++# args.extend(['-faltivec']) + args.extend([ + '-I/System/Library/Frameworks/vecLib.framework/Headers']) + link_args.extend(['-Wl,-framework', '-Wl,Accelerate']) +@@ -2174,8 +2174,8 @@ class accelerate_info(system_info): + 'veclib' in libraries): + if intel: + args.extend(['-msse3']) +- else: +- args.extend(['-faltivec']) ++# else: ++# args.extend(['-faltivec']) + args.extend([ + '-I/System/Library/Frameworks/vecLib.framework/Headers']) + link_args.extend(['-Wl,-framework', '-Wl,vecLib']) + diff --git a/build_files/build_environment/patches/opencollada.diff b/build_files/build_environment/patches/opencollada.diff index cd4cc2c1652..e8efc1a6909 100644 --- a/build_files/build_environment/patches/opencollada.diff +++ b/build_files/build_environment/patches/opencollada.diff @@ -86,3 +86,47 @@ index 1f9a3ee..d151e9a 100644 return isnan( value ); #else return std::isnan(value); + + +diff --git a/DAEValidator/library/src/Dae.cpp b/DAEValidator/library/src/Dae.cpp +index 9256ee1..241ad67 100644 +--- a/DAEValidator/library/src/Dae.cpp ++++ b/DAEValidator/library/src/Dae.cpp +@@ -304,7 +304,7 @@ namespace opencollada + if (auto root_node = root()) + { + const auto & nodes = root_node.selectNodes("//*[@id]"); +- for (const auto & node : nodes) ++ for (const auto node : nodes) + { + string id = node.attribute("id").value(); + mIdCache.insert(id); +@@ -312,4 +312,4 @@ namespace opencollada + } + } + } +-} +\ No newline at end of file ++} +diff --git a/DAEValidator/library/src/DaeValidator.cpp b/DAEValidator/library/src/DaeValidator.cpp +index 715d903..24423ce 100644 +--- a/DAEValidator/library/src/DaeValidator.cpp ++++ b/DAEValidator/library/src/DaeValidator.cpp +@@ -162,7 +162,7 @@ namespace opencollada + + // Find xsi:schemaLocation attributes in dae and try to validate against specified xsd documents + const auto & elements = dae.root().selectNodes("//*[@xsi:schemaLocation]"); +- for (const auto & element : elements) ++ for (const auto element : elements) + { + if (auto schemaLocation = element.attribute("schemaLocation")) + { +@@ -274,7 +274,7 @@ namespace opencollada + int result = 0; + map<string, size_t> ids; + const auto & nodes = dae.root().selectNodes("//*[@id]"); +- for (const auto & node : nodes) ++ for (const auto node : nodes) + { + string id = node.attribute("id").value(); + size_t line = node.line(); diff --git a/build_files/build_environment/patches/openmp.diff b/build_files/build_environment/patches/openmp.diff new file mode 100644 index 00000000000..201ab5c7713 --- /dev/null +++ b/build_files/build_environment/patches/openmp.diff @@ -0,0 +1,23 @@ +diff --git a/runtime/src/z_Linux_asm.S b/runtime/src/z_Linux_asm.S +index 0d8885e..42aa5ad 100644 +--- a/runtime/src/z_Linux_asm.S ++++ b/runtime/src/z_Linux_asm.S +@@ -1540,10 +1540,12 @@ __kmp_unnamed_critical_addr: + .comm .gomp_critical_user_,32,8 + .data + .align 8 +- .global __kmp_unnamed_critical_addr +-__kmp_unnamed_critical_addr: ++ .global ___kmp_unnamed_critical_addr ++___kmp_unnamed_critical_addr: + .8byte .gomp_critical_user_ +- .size __kmp_unnamed_critical_addr,8 ++# if !(KMP_OS_DARWIN) ++ .size ___kmp_unnamed_critical_addr,8 ++# endif + #endif /* KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 */ + + #if KMP_OS_LINUX + + + diff --git a/build_files/build_environment/patches/python_macos.diff b/build_files/build_environment/patches/python_macos.diff new file mode 100644 index 00000000000..22ccbebee2f --- /dev/null +++ b/build_files/build_environment/patches/python_macos.diff @@ -0,0 +1,289 @@ +diff -ru a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst +--- a/Doc/library/ctypes.rst 2020-03-10 07:11:12.000000000 +0100 ++++ b/Doc/library/ctypes.rst 2020-07-14 08:10:10.000000000 +0200 +@@ -1551,6 +1551,13 @@ + value usable as argument (integer, string, ctypes instance). This allows + defining adapters that can adapt custom objects as function parameters. + ++ .. attribute:: variadic ++ ++ Assign a boolean to specify that the function takes a variable number of ++ arguments. This does not matter on most platforms, but for Apple arm64 ++ platforms variadic functions have a different calling convention than ++ normal functions. ++ + .. attribute:: errcheck + + Assign a Python function or another callable to this attribute. The +diff -ru a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c +--- a/Modules/_ctypes/_ctypes.c 2020-03-10 07:11:12.000000000 +0100 ++++ b/Modules/_ctypes/_ctypes.c 2020-07-14 08:14:41.000000000 +0200 +@@ -3175,6 +3175,35 @@ + } + + static int ++PyCFuncPtr_set_variadic(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) ++{ ++ StgDictObject *dict = PyObject_stgdict((PyObject *)self); ++ assert(dict); ++ int r = PyObject_IsTrue(ob); ++ if (r == 1) { ++ dict->flags |= FUNCFLAG_VARIADIC; ++ return 0; ++ } else if (r == 0) { ++ dict->flags &= ~FUNCFLAG_VARIADIC; ++ return 0; ++ } else { ++ return -1; ++ } ++} ++ ++static PyObject * ++PyCFuncPtr_get_variadic(PyCFuncPtrObject *self, void *Py_UNUSED(ignored)) ++{ ++ StgDictObject *dict = PyObject_stgdict((PyObject *)self); ++ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */ ++ if (dict->flags & FUNCFLAG_VARIADIC) ++ Py_RETURN_TRUE; ++ else ++ Py_RETURN_FALSE; ++} ++ ++ ++static int + PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored)) + { + PyObject *converters; +@@ -5632,6 +5661,7 @@ + PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO)); + PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR)); + PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI)); ++ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyLong_FromLong(FUNCFLAG_VARIADIC)); + PyModule_AddStringConstant(m, "__version__", "1.1.0"); + + PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove)); +diff -ru a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c +--- a/Modules/_ctypes/callproc.c 2020-03-10 07:11:12.000000000 +0100 ++++ b/Modules/_ctypes/callproc.c 2020-07-14 08:18:33.000000000 +0200 +@@ -767,7 +767,8 @@ + ffi_type **atypes, + ffi_type *restype, + void *resmem, +- int argcount) ++ int argcount, ++ int argtypecount) + { + PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */ + PyObject *error_object = NULL; +@@ -793,15 +794,38 @@ + if ((flags & FUNCFLAG_CDECL) == 0) + cc = FFI_STDCALL; + #endif +- if (FFI_OK != ffi_prep_cif(&cif, +- cc, +- argcount, +- restype, +- atypes)) { +- PyErr_SetString(PyExc_RuntimeError, +- "ffi_prep_cif failed"); +- return -1; +- } ++#if HAVE_FFI_PREP_CIF_VAR ++ /* Everyone SHOULD set f.variadic=True on variadic function pointers, but ++ * lots of existing code will not. If there's at least one arg and more ++ * args are passed than are defined in the prototype, then it must be a ++ * variadic function. */ ++ if ((flags & FUNCFLAG_VARIADIC) || ++ (argtypecount != 0 && argcount > argtypecount)) ++ { ++ if (FFI_OK != ffi_prep_cif_var(&cif, ++ cc, ++ argtypecount, ++ argcount, ++ restype, ++ atypes)) { ++ PyErr_SetString(PyExc_RuntimeError, ++ "ffi_prep_cif_var failed"); ++ return -1; ++ } ++ } else { ++#endif ++ if (FFI_OK != ffi_prep_cif(&cif, ++ cc, ++ argcount, ++ restype, ++ atypes)) { ++ PyErr_SetString(PyExc_RuntimeError, ++ "ffi_prep_cif failed"); ++ return -1; ++ } ++#if HAVE_FFI_PREP_CIF_VAR ++ } ++#endif + + if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) { + error_object = _ctypes_get_errobj(&space); +@@ -1185,9 +1209,8 @@ + + if (-1 == _call_function_pointer(flags, pProc, avalues, atypes, + rtype, resbuf, +- Py_SAFE_DOWNCAST(argcount, +- Py_ssize_t, +- int))) ++ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int), ++ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int))) + goto cleanup; + + #ifdef WORDS_BIGENDIAN +diff -ru a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h +--- a/Modules/_ctypes/ctypes.h 2020-03-10 07:11:12.000000000 +0100 ++++ b/Modules/_ctypes/ctypes.h 2020-07-14 08:30:53.000000000 +0200 +@@ -285,6 +285,7 @@ + #define FUNCFLAG_PYTHONAPI 0x4 + #define FUNCFLAG_USE_ERRNO 0x8 + #define FUNCFLAG_USE_LASTERROR 0x10 ++#define FUNCFLAG_VARIADIC 0x20 + + #define TYPEFLAG_ISPOINTER 0x100 + #define TYPEFLAG_HASPOINTER 0x200 +diff -ru a/configure b/configure +--- a/configure 2020-03-10 07:11:12.000000000 +0100 ++++ b/configure 2020-07-14 08:03:27.000000000 +0200 +@@ -3374,7 +3374,7 @@ + # has no effect, don't bother defining them + Darwin/[6789].*) + define_xopen_source=no;; +- Darwin/1[0-9].*) ++ Darwin/[12][0-9].*) + define_xopen_source=no;; + # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but + # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined +@@ -9251,6 +9251,9 @@ + ppc) + MACOSX_DEFAULT_ARCH="ppc64" + ;; ++ arm64) ++ MACOSX_DEFAULT_ARCH="arm64" ++ ;; + *) + as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 + ;; +diff -ru a/configure.ac b/configure.ac +--- a/configure.ac 2020-03-10 07:11:12.000000000 +0100 ++++ b/configure.ac 2020-07-14 08:03:27.000000000 +0200 +@@ -2456,6 +2456,9 @@ + ppc) + MACOSX_DEFAULT_ARCH="ppc64" + ;; ++ arm64) ++ MACOSX_DEFAULT_ARCH="arm64" ++ ;; + *) + AC_MSG_ERROR([Unexpected output of 'arch' on OSX]) + ;; +diff -ru a/setup.py b/setup.py +--- a/setup.py 2020-03-10 07:11:12.000000000 +0100 ++++ b/setup.py 2020-07-14 08:28:12.000000000 +0200 +@@ -141,6 +141,13 @@ + os.unlink(tmpfile) + + return MACOS_SDK_ROOT ++ ++def is_macosx_at_least(vers): ++ if host_platform == 'darwin': ++ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') ++ if dep_target: ++ return tuple(map(int, dep_target.split('.'))) >= vers ++ return False + + def is_macosx_sdk_path(path): + """ +@@ -150,6 +157,13 @@ + or path.startswith('/System/') + or path.startswith('/Library/') ) + ++def grep_headers_for(function, headers): ++ for header in headers: ++ with open(header, 'r') as f: ++ if function in f.read(): ++ return True ++ return False ++ + def find_file(filename, std_dirs, paths): + """Searches for the directory where a given file is located, + and returns a possibly-empty list of additional directories, or None +@@ -1972,7 +1986,11 @@ + return True + + def detect_ctypes(self, inc_dirs, lib_dirs): +- self.use_system_libffi = False ++ if not sysconfig.get_config_var("LIBFFI_INCLUDEDIR") and is_macosx_at_least((10,15)): ++ self.use_system_libffi = True ++ else: ++ self.use_system_libffi = '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS") ++ + include_dirs = [] + extra_compile_args = [] + extra_link_args = [] +@@ -2016,32 +2034,48 @@ + ext_test = Extension('_ctypes_test', + sources=['_ctypes/_ctypes_test.c'], + libraries=['m']) ++ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR") ++ ffi_lib = None ++ + self.extensions.extend([ext, ext_test]) + + if host_platform == 'darwin': +- if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"): ++ if not self.use_system_libffi: + return +- # OS X 10.5 comes with libffi.dylib; the include files are +- # in /usr/include/ffi +- inc_dirs.append('/usr/include/ffi') +- +- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")] +- if not ffi_inc or ffi_inc[0] == '': +- ffi_inc = find_file('ffi.h', [], inc_dirs) +- if ffi_inc is not None: +- ffi_h = ffi_inc[0] + '/ffi.h' ++ ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi") ++ if os.path.exists(ffi_in_sdk): ++ ffi_inc = ffi_in_sdk ++ ffi_lib = 'ffi' ++ else: ++ # OS X 10.5 comes with libffi.dylib; the include files are ++ # in /usr/include/ffi ++ ffi_inc_dirs.append('/usr/include/ffi') ++ ++ if not ffi_inc: ++ found = find_file('ffi.h', [], ffi_inc_dirs) ++ if found: ++ ffi_inc = found[0] ++ if ffi_inc: ++ ffi_h = ffi_inc + '/ffi.h' + if not os.path.exists(ffi_h): + ffi_inc = None + print('Header file {} does not exist'.format(ffi_h)) +- ffi_lib = None +- if ffi_inc is not None: ++ if ffi_lib is None and ffi_inc: + for lib_name in ('ffi', 'ffi_pic'): + if (self.compiler.find_library_file(lib_dirs, lib_name)): + ffi_lib = lib_name + break + + if ffi_inc and ffi_lib: +- ext.include_dirs.extend(ffi_inc) ++ ffi_headers = glob(os.path.join(ffi_inc, '*.h')) ++ if grep_headers_for('ffi_closure_alloc', ffi_headers): ++ try: ++ sources.remove('_ctypes/malloc_closure.c') ++ except ValueError: ++ pass ++ if grep_headers_for('ffi_prep_cif_var', ffi_headers): ++ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1") ++ ext.include_dirs.append(ffi_inc) + ext.libraries.append(ffi_lib) + self.use_system_libffi = True + diff --git a/build_files/build_environment/patches/sqlite.diff b/build_files/build_environment/patches/sqlite.diff new file mode 100644 index 00000000000..80f1384f9cf --- /dev/null +++ b/build_files/build_environment/patches/sqlite.diff @@ -0,0 +1,14 @@ +Only in external_sqlite_orig: config.log +diff -ru external_sqlite_orig/config.sub external_sqlite/config.sub +--- external_sqlite_orig/config.sub 2020-07-10 14:06:42.000000000 +0200 ++++ external_sqlite/config.sub 2020-07-10 14:10:24.000000000 +0200 +@@ -314,6 +314,7 @@ + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ ++ | aarch64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ +Only in external_sqlite: mksourceid +Only in external_sqlite: sqlite3session.h diff --git a/build_files/build_environment/patches/theora.diff b/build_files/build_environment/patches/theora.diff new file mode 100644 index 00000000000..3abadb66be9 --- /dev/null +++ b/build_files/build_environment/patches/theora.diff @@ -0,0 +1,18 @@ +--- config.sub ++++ config.sub +@@ -226,6 +226,7 @@ + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ ++ | aarch64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ +@@ -286,6 +287,7 @@ + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ ++ | aarch64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ diff --git a/build_files/build_environment/patches/usd.diff b/build_files/build_environment/patches/usd.diff index 8f457271a5c..fe767829a70 100644 --- a/build_files/build_environment/patches/usd.diff +++ b/build_files/build_environment/patches/usd.diff @@ -97,3 +97,36 @@ diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros endforeach() foreach(lib ${PXR_OBJECT_LIBS}) set(objects "${objects};\$<TARGET_OBJECTS:${lib}>") + +diff --git a/pxr/base/arch/align.h b/pxr/base/arch/align.h +index f3cabf4..ebc8a69 100644 +--- a/pxr/base/arch/align.h ++++ b/pxr/base/arch/align.h +@@ -77,7 +77,11 @@ ArchAlignMemory(void *base) + /// The size of a CPU cache line on the current processor architecture in bytes. + /// + /// \hideinitializer ++#if defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_ARM) ++#define ARCH_CACHE_LINE_SIZE 128 ++#else + #define ARCH_CACHE_LINE_SIZE 64 ++#endif + + ///@} + +diff --git a/pxr/base/arch/math.h b/pxr/base/arch/math.h +index 3e66c37..64a052c 100644 +--- a/pxr/base/arch/math.h ++++ b/pxr/base/arch/math.h +@@ -42,7 +42,7 @@ PXR_NAMESPACE_OPEN_SCOPE + /// \addtogroup group_arch_Math + ///@{ + +-#if defined (ARCH_CPU_INTEL) || defined(doxygen) ++#if defined (ARCH_CPU_INTEL) || defined(ARCH_CPU_ARM) || defined(doxygen) + + /// This is the smallest value e such that 1+e^2 == 1, using floats. + /// True for all IEEE754 chipsets. + + + diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake index b24d7734423..a80b0b56901 100644 --- a/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake @@ -20,7 +20,11 @@ # Libraries configuration for Apple. -set(MACOSX_DEPLOYMENT_TARGET "10.13") +if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") + set(MACOSX_DEPLOYMENT_TARGET 11.00) +else() + set(MACOSX_DEPLOYMENT_TARGET 10.13) +endif() macro(find_package_wrapper) # do nothing, just satisfy the macro @@ -378,6 +382,12 @@ if(WITH_CYCLES_OSL) endif() endif() +if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") + set(WITH_CYCLES_EMBREE OFF) + set(WITH_OPENIMAGEDENOISE OFF) + set(WITH_CPU_SSE OFF) +endif() + if(WITH_CYCLES_EMBREE) find_package(Embree 3.8.0 REQUIRED) set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000") @@ -439,8 +449,8 @@ if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES " set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller") endif() else() - set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing") - set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing") + set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -fno-strict-aliasing") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -fno-strict-aliasing") endif() if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5) diff --git a/build_files/cmake/platform/platform_apple_xcode.cmake b/build_files/cmake/platform/platform_apple_xcode.cmake index 434c2ee31b9..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() @@ -129,14 +131,21 @@ if(${CMAKE_GENERATOR} MATCHES "Xcode") endif() unset(OSX_SDKROOT) + # 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.13) - message(STATUS "Setting deployment target to 10.13, lower versions are not supported") - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" 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.13" CACHE STRING "" FORCE) + set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" FORCE) endif() if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode") |