Skip to content

Commit

Permalink
fix: fixed protoc compile errors on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart authored and vfusco committed Jan 25, 2024
1 parent fadc3bc commit cbacc90
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ LUA_BIN?=lua5.4
GRPC_DIR:=../lib/grpc-interfaces

PROTOC:=$(shell which protoc)
PROTOC_FLAGS:=--experimental_allow_proto3_optional
GRPC_CPP_PLUGIN:=$(shell which grpc_cpp_plugin)

# Code instrumentation
Expand Down Expand Up @@ -70,8 +71,8 @@ CRYPTOPP_INC_Darwin:=-I$(BREW_PREFIX)/include
NLOHMANN_JSON_INC_Darwin:=-I$(BREW_PREFIX)/include
B64_LIB_Darwin:=-L$(BREW_PREFIX)/lib -lb64
B64_INC_Darwin:=-I$(BREW_PREFIX)/include
GRPC_INC_Darwin:=$(shell pkg-config --cflags-only-I grpc++)
GRPC_LIB_Darwin:=$(shell pkg-config --libs grpc++)
GRPC_INC_Darwin:=$(shell pkg-config --cflags-only-I grpc++ protobuf)
GRPC_LIB_Darwin:=$(shell pkg-config --libs grpc++ protobuf)
PROTOBUF_INC_Darwin:=$(shell pkg-config --cflags-only-I protobuf)
PROTOBUF_LIB_Darwin:=$(shell pkg-config --libs protobuf)
else ifneq (,$(shell which port)) # Macports installation
Expand Down Expand Up @@ -122,8 +123,8 @@ B64_LIB_Linux:=-lb64
B64_INC_Linux:=
CRYPTOPP_LIB_Linux:=-lcryptopp
CRYPTOPP_INC_Linux:=
GRPC_INC_Linux:=$(shell pkg-config --cflags-only-I grpc++)
GRPC_LIB_Linux:=$(shell pkg-config --libs grpc++)
GRPC_INC_Linux:=$(shell pkg-config --cflags-only-I grpc++ protobuf)
GRPC_LIB_Linux:=$(shell pkg-config --libs grpc++ protobuf)
PROTOBUF_INC_Linux:=$(shell pkg-config --cflags-only-I protobuf)
PROTOBUF_LIB_Linux:=$(shell pkg-config --libs protobuf)
LIBCARTESI_Linux=libcartesi-$(EMULATOR_VERSION_MAJOR).$(EMULATOR_VERSION_MINOR).so
Expand Down Expand Up @@ -725,10 +726,10 @@ tests/test-machine-c-api: $(TEST_MACHINE_C_API_OBJS) $(LIBCARTESI) $(LIBCARTESI_
.PRECIOUS: %.grpc.pb.cc %.grpc.pb.h %.pb.cc %.pb.h

%.grpc.pb.cc: $(GRPC_DIR)/%.proto
$(PROTOC) -I$(<D) --grpc_out=. --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN) $<
$(PROTOC) $(PROTOC_FLAGS) -I$(<D) --grpc_out=. --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN) $<

%.pb.cc: $(GRPC_DIR)/%.proto
$(PROTOC) -I$(GRPC_DIR) --cpp_out=. $<
$(PROTOC) $(PROTOC_FLAGS) -I$(GRPC_DIR) --cpp_out=. $<

machine-config.o protobuf-util.o: $(CARTESI_PROTOBUF_GEN_OBJS)

Expand Down

0 comments on commit cbacc90

Please sign in to comment.