From 4cb60b14e09bbd4a112cb5d8390b3952ab4c4566 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 14 Sep 2016 11:41:20 +0200 Subject: CMake changes for new macOS target 10.9 / libc++ libraries. Differential Revision: https://developer.blender.org/D2283 --- CMakeLists.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9331418e94e..64fd2c569ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -629,9 +629,21 @@ if(APPLE) set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT}) endif() - if(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - # 10.6 is our min. target, if you use higher sdk, weak linking happens - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE) + if(WITH_CXX11) + # 10.9 is our min. target, if you use higher sdk, weak linking happens + if(CMAKE_OSX_DEPLOYMENT_TARGET) + if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9) + message(STATUS "Setting deployment target to 10.9, lower versions are incompatible with WITH_CXX11") + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE) + endif() + else() + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE) + endif() + else() + if(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + # 10.6 is our min. target, if you use higher sdk, weak linking happens + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE) + endif() endif() if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode") -- cgit v1.2.3