Skip to content

Commit

Permalink
Allow generators to run on Apple chips
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro committed Dec 26, 2024
1 parent 63f6e7e commit 5fc8765
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,36 @@ PROTO_GEN_JS_DIR ?= proto-gen-js
PROTO_GEN_CPP_DIR ?= proto-gen-cpp
PROTO_GEN_CSHARP_DIR ?= proto-gen-csharp

PROTOC_WITHOUT_GRPC := $(PROTOC) \
# The jaegertracing/protobuf container image does not
# include Java/C#/C++ plugins for Apple Silicon (arm64).

PROTOC_WITHOUT_GRPC_common := $(PROTOC) \
$(PROTO_INCLUDES) \
--gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/${PROTO_GEN_GO_DIR} \
--java_out=${PROTO_GEN_JAVA_DIR} \
--python_out=${PROTO_GEN_PYTHON_DIR} \
--js_out=${PROTO_GEN_JS_DIR} \
--js_out=${PROTO_GEN_JS_DIR}

ifeq ($(shell uname -m),arm64)
PROTOC_WITHOUT_GRPC := $(PROTOC_WITHOUT_GRPC_common)
else
PROTOC_WITHOUT_GRPC := $(PROTOC_WITHOUT_GRPC_common) \
--java_out=${PROTO_GEN_JAVA_DIR} \
--cpp_out=${PROTO_GEN_CPP_DIR} \
--csharp_out=base_namespace:${PROTO_GEN_CSHARP_DIR}
endif

PROTOC_WITH_GRPC := $(PROTOC_WITHOUT_GRPC) \
--grpc-java_out=${PROTO_GEN_JAVA_DIR} \
PROTOC_WITH_GRPC_common := $(PROTOC_WITHOUT_GRPC) \
--grpc-python_out=${PROTO_GEN_PYTHON_DIR} \
--grpc-js_out=${PROTO_GEN_JS_DIR} \
--grpc-js_out=${PROTO_GEN_JS_DIR}

ifeq ($(shell uname -m),arm64)
PROTOC_WITH_GRPC := $(PROTOC_WITH_GRPC_common)
else
PROTOC_WITH_GRPC := $(PROTOC_WITH_GRPC_common) \
--grpc-java_out=${PROTO_GEN_JAVA_DIR} \
--grpc-cpp_out=${PROTO_GEN_CPP_DIR} \
--grpc-csharp_out=${PROTO_GEN_CSHARP_DIR}
endif

PROTOC_INTERNAL := $(PROTOC) \
$(PROTO_INCLUDES) \
Expand Down

0 comments on commit 5fc8765

Please sign in to comment.