Fix $MACOSX_DEPLOYMENT_TARGET (#3337)

This commit is contained in:
Philipp Moritz 2018-11-21 10:56:17 -08:00 committed by Robert Nishihara
parent 686cf20951
commit 1a926c9b7c

View file

@ -125,9 +125,18 @@ if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES")
if (APPLE)
# Since 10.14, the XCode toolchain only accepts libc++ as the
# standard library. This should also work on macOS starting from 10.9.
# standard library. We set it only on 10.14, because on some
# configurations of older macOS, we get the following error
# with libc++:
# [...]/usr/bin/c++ '-stdlib=libc++' -isysroot [...] -mmacosx-version-min=10.6 [...]
# clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
message(STATUS "-- Darwin version = ${DARWIN_VERSION}")
if (DARWIN_VERSION GREATER 17)
set(pyarrow_ENV ${pyarrow_ENV} "CXXFLAGS='-stdlib=libc++'")
set(pyarrow_ENV ${pyarrow_ENV} "MACOSX_DEPLOYMENT_TARGET=10.7")
endif()
endif()
ExternalProject_Add(pyarrow_ext