From df5fbe6408e694987591a1c258af5aa330083963 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Thu, 25 Jun 2020 13:54:07 -0700 Subject: [PATCH] Portable backward compatibility with MacOS 10.12+ (#7016) Summary: When `PORTABLE=1` is set, RocksDB will now be built with backwards compatibility for MacOS as far back as 10.12 (i.e. 2016). Pull Request resolved: https://github.com/facebook/rocksdb/pull/7016 Reviewed By: ajkr Differential Revision: D22211312 Pulled By: pdillinger fbshipit-source-id: 7b0858d9b55d6265d3ea27bf5ea1673639b6538c --- build_tools/build_detect_platform | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform index 3610405a8..c5b7a2336 100755 --- a/build_tools/build_detect_platform +++ b/build_tools/build_detect_platform @@ -623,6 +623,13 @@ else if test "$USE_SSE"; then TRY_SSE_ETC="1" fi + + if [[ "${PLATFORM}" == "OS_MACOSX" ]]; then + # For portability compile for macOS 10.12 (2016) or newer + COMMON_FLAGS="$COMMON_FLAGS -mmacosx-version-min=10.12" + PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -mmacosx-version-min=10.12" + PLATFORM_SHARED_LDFLAGS="$PLATFORM_SHARED_LDFLAGS -mmacosx-version-min=10.12" + fi fi if test "$TRY_SSE_ETC"; then