Skip to content

Commit

Permalink
[Cpp]: Add make proto
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby committed Jan 12, 2024
1 parent 641e4fd commit 844093a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 37 deletions.
5 changes: 5 additions & 0 deletions cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ build:
mkdir -p build && cd build && \
conan install .. --build=missing && \
conan build ..

debug:
mkdir -p build && cd build && \
conan install .. --build=missing -s build_type=Debug && \
conan build ..

clean:
rm -rf build

Expand All @@ -34,3 +36,6 @@ check-tidy:

fix-tidy:
python3 ./scripts/run-clang-tidy.py -fix -p build/Release

proto:
protoc -I="src/proto" --cpp_out="src/proto" src/proto/*.proto
42 changes: 6 additions & 36 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
.EXPORT_ALL_VARIABLES:
.PHONY: proto

define HELP_INFO
Usage:
make <Target>

Target:
all build all executables (default)
protos compile server protobuf files
prepare prepare dependencies
clean clean artifacts
endef


.PHONY: all
all: prepare\
protos \

.PHONY: prepare
prepare:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest


.PHONY: protos
protos:
$(MAKE) -C proto/mainfest
$(MAKE) -C proto/scheme

.PHONY: clean-protos
clean-protos:
$(MAKE) -C proto/mainfest clean
$(MAKE) -C proto/scheme clean


.PHONY: clean
clean: clean-protos \
proto:
mkdir -p proto/manifest_proto
mkdir -p proto/schema_proto
protoc -I="proto" --go_out=paths=source_relative:./proto/manifest_proto proto/manifest.proto
protoc -I="proto" --go_out=paths=source_relative:./proto/schema_proto proto/storage_schema.proto

2 changes: 1 addition & 1 deletion go/proto/manifest.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
import "schema.proto";
import "storage_schema.proto";
package manifest_proto;
option go_package = "github.com/milvus-io/milvus-storage/go/proto/manifest_proto";

Expand Down

0 comments on commit 844093a

Please sign in to comment.