Skip to content

Commit

Permalink
point to correct grpc_cpp_plugin when cross-compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Apr 14, 2023
1 parent 375625f commit a99c38f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions recipe/build-arrow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ else
EXTRA_CMAKE_ARGS=" ${EXTRA_CMAKE_ARGS} -DARROW_CUDA=OFF"
fi

if [[ "${target_platform}" == "osx-arm64" ]]; then
if [[ "${build_platform}" != "${target_platform}" ]]; then
# point to a usable protoc/grpc_cpp_plugin if we're cross-compiling
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc"
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCLANG_EXECUTABLE=${BUILD_PREFIX}/bin/clang -DLLVM_LINK_EXECUTABLE=${BUILD_PREFIX}/bin/llvm-link"
sed -ie "s;protoc-gen-grpc.*$;protoc-gen-grpc=${BUILD_PREFIX}/bin/grpc_cpp_plugin\";g" ../src/arrow/flight/CMakeLists.txt
sed -ie 's;"--with-jemalloc-prefix\=je_arrow_";"--with-jemalloc-prefix\=je_arrow_" "--with-lg-page\=14";g' ../cmake_modules/ThirdpartyToolchain.cmake
Expand All @@ -64,11 +66,6 @@ if [[ "${target_platform}" == "linux-aarch64" ]] || [[ "${target_platform}" == "
export CMAKE_BUILD_PARALLEL_LEVEL=3
fi

# point to a usable protoc if we're running on a different architecture than the target
if [[ "${build_platform}" != "${target_platform}" ]]; then
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc"
fi

# reusable variable for dependencies we cannot yet unvendor
export READ_RECIPE_META_YAML_WHY_NOT=OFF

Expand Down

0 comments on commit a99c38f

Please sign in to comment.