diff --git a/scripts/setup-macos.sh b/scripts/setup-macos.sh index bd0777b211071..1a246ddec66ea 100755 --- a/scripts/setup-macos.sh +++ b/scripts/setup-macos.sh @@ -37,7 +37,7 @@ NPROC=$(getconf _NPROCESSORS_ONLN) COMPILER_FLAGS=$(get_cxx_flags $CPU_TARGET) DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)} -MACOS_DEPS="ninja flex bison cmake ccache protobuf icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl@1.1" +MACOS_DEPS="ninja flex bison cmake ccache icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl@1.1" function run_and_time { time "$@" @@ -109,6 +109,16 @@ function install_re2 { cmake_install -DRE2_BUILD_TESTING=OFF } +function install_protobuf { + # Protobuf's optimized build and debug build are incompatible when linked with code from + # another type of build, so we have to build and install both. + github_checkout protocolbuffers/protobuf v3.21.2 + # Install debug build. + cmake_install -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_PROTOC_BINARIES=ON + # Install optimized build. + cmake_install -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_PROTOC_BINARIES=OFF +} + function install_velox_deps { if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then run_and_time install_build_prerequisites @@ -118,6 +128,7 @@ function install_velox_deps { run_and_time install_double_conversion run_and_time install_folly run_and_time install_re2 + run_and_time install_protobuf } (return 2> /dev/null) && return # If script was sourced, don't run commands.