CMake: Additional fixes/tweaks for C++11 on macOS

The changes in 0a94c1890f where an
incomplete solution.
The apple compiler automatically choses libc++ if the deployment target
is >= 10.9. Lower deployment targets need explicit compiler options
to use libc++.
This commit is contained in:
Tobias Taschner
2018-02-08 10:59:39 +01:00
parent 0fe9d7c3bb
commit 7ce0a0a774
3 changed files with 20 additions and 15 deletions

View File

@@ -20,12 +20,7 @@ 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)
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")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "OS X Deployment Target")
endif()
project(wxWidgets)