From 8b92044fd8c9a3b6b527a16f45e41aa3d8bbf3ef Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Fri, 19 Jan 2024 08:54:32 -0800 Subject: [PATCH] Feat: Protobuf compiled for host in OSX. Fix for arm64 OSX wallet-core --- build/OSX/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build/OSX/CMakeLists.txt b/build/OSX/CMakeLists.txt index 87121035..d2fdc0d0 100644 --- a/build/OSX/CMakeLists.txt +++ b/build/OSX/CMakeLists.txt @@ -144,6 +144,28 @@ set(_grpc_EXTRA_PARAM -DgRPC_BUILD_GRPC_CSHARP_PLUGIN:BOOL=OFF ) +# -------------------------------------------------------- +# Build protobuf project from the git submodule +set(PROTOBUF_SRC_DIR "${THIRDPARTY_DIR}/grpc/third_party/protobuf/cmake") + +# Build protobuf project from the git submodule. +ExternalProject_Add(protobuf + PREFIX protobuf + SOURCE_DIR "${PROTOBUF_SRC_DIR}" + CMAKE_CACHE_ARGS + -Dprotobuf_BUILD_TESTS:BOOL=OFF + -Dprotobuf_WITH_ZLIB:BOOL=OFF + -Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=OFF + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/protobuf + -Dprotobuf_BUILD_PROTOC_BINARIES:BOOL=ON +) + +set(PROTOC_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/protobuf/bin/protoc") +set(_PROTOBUF_TARGET protobuf) +set(_PROTOBUF_HOST_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf/lib/cmake/protobuf") +set(_PROTOBUF_HOST_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf/include") +set(_PROTOBUF_HOST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf/lib") + # -------------------------------------------------------- # set config for rocksdb set(_rocksdb_EXTRA_PARAM