CMake: Fixes/Tweaks for macOS building with C++ 11

Make sure the deployment target is set to 10.9 when using C++11
Also ensure building C++11 on macOS for non Xcode builds
This commit is contained in:
Tobias Taschner 2018-02-06 10:24:48 +01:00
parent 89148ea72e
commit 0a94c1890f
No known key found for this signature in database
GPG key ID: AE6ECD71294F87FD
2 changed files with 14 additions and 3 deletions

View file

@ -20,7 +20,12 @@ endif()
if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET)
# If no deployment target has been set default to the minimum supported
# OS X version (this has to be set before the first project() call)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "OS X Deployment Target")
if(CMAKE_CXX_STANDARD EQUAL 11 OR CMAKE_CXX_STANDARD EQUAL 14)
set(OSX_DEFAULT_DEPLOYMENT_TARGET 10.9)
else()
set(OSX_DEFAULT_DEPLOYMENT_TARGET 10.7)
endif()
set(CMAKE_OSX_DEPLOYMENT_TARGET ${OSX_DEFAULT_DEPLOYMENT_TARGET} CACHE STRING "OS X Deployment Target")
endif()
project(wxWidgets)