cmake: Fix build on newer macOS

This commit is contained in:
TellowKrinkle 2020-10-21 20:43:25 -05:00 committed by tellowkrinkle
parent a29a4d69d9
commit 16750c19ce
1 changed files with 7 additions and 0 deletions

View File

@ -441,6 +441,13 @@ string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
if (APPLE AND ${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.14)
# Older versions of the macOS stdlib don't have operator new(size_t, align_val_t)
# Disable use of them with this flag
# Not great, but also no worse that what we were getting before we turned on C++17
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-aligned-allocation")
endif()
# CMake defaults the suffix for modules to .so on macOS but wx tells us that the
# extension is .dylib (so that's what we search for)
if(APPLE)