From 67de8bf964a5759798c2d5b575fcd9bfdb83a6cc Mon Sep 17 00:00:00 2001 From: Mahadevuni Naveen Kumar Date: Tue, 30 May 2023 17:29:03 +0530 Subject: [PATCH] Correct INSTALL_PREFIX for arm64 target --- scripts/setup-helper-functions.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/setup-helper-functions.sh b/scripts/setup-helper-functions.sh index 8076edc4a1850..a8a1082cd2525 100644 --- a/scripts/setup-helper-functions.sh +++ b/scripts/setup-helper-functions.sh @@ -15,6 +15,9 @@ # github_checkout $REPO $VERSION $GIT_CLONE_PARAMS clones or re-uses an existing clone of the # specified repo, checking out the requested version. + +OS=$(uname) + function github_checkout { local REPO=$1 shift @@ -55,8 +58,6 @@ function github_checkout { function get_cxx_flags { local CPU_ARCH=$1 - local OS - OS=$(uname) local MACHINE MACHINE=$(uname -m) ADDITIONAL_FLAGS="" @@ -129,6 +130,11 @@ function cmake_install { CPU_TARGET="${CPU_TARGET:-unknown}" COMPILER_FLAGS=$(get_cxx_flags $CPU_TARGET) + if [[ "$OS" == "Darwin" && "${CPU_TARGET}" == "arm64" ]]; then + INSTALL_PREFIX="${INSTALL_PREFIX:-/opt/homebrew}" + fi + + # CMAKE_POSITION_INDEPENDENT_CODE is required so that Velox can be built into dynamic libraries \ cmake -Wno-dev -B"${BINARY_DIR}" \ -GNinja \