Skip to content

Commit

Permalink
build debug protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinwilfong committed Jul 20, 2022
1 parent b67811c commit 9e989b9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]"
MACOS_DEPS="ninja flex bison cmake ccache icu4c boost gflags glog libevent lz4 lzo snappy xz zstd [email protected]"

function run_and_time {
time "$@"
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 9e989b9

Please sign in to comment.