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

@@ -23,6 +23,14 @@ include(CheckTypeSize)
include(CMakePushCheckState)
include(TestBigEndian)
if(
APPLE AND
CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.9 AND
(CMAKE_CXX_STANDARD EQUAL 11 OR CMAKE_CXX_STANDARD EQUAL 14)
)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-stdlib=libc++")
endif()
# Add a definition to setup.h and append it to a list of defines for
# for compile checks
macro(wx_setup_definition def)