Skip to content

Commit

Permalink
remove protobuf submodules (OpenAtomFoundation#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
Axlgrep authored Jun 12, 2019
1 parent 6928699 commit ee347ab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@
[submodule "third/pink"]
path = third/pink
url = https://github.com/Qihoo360/pink.git
[submodule "third/protobuf"]
path = third/protobuf
url = https://github.com/google/protobuf.git
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ language: cpp
os:
- linux

env:
global:
- PROTOBUF_VERSION=2.5.0

install:
- wget https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-$PROTOBUF_VERSION.tar.bz2
- tar xvf protobuf-$PROTOBUF_VERSION.tar.bz2
- ( cd protobuf-$PROTOBUF_VERSION && ./configure --prefix=/usr && make && sudo make install )

addons:
apt:
packages: ['libsnappy-dev', 'libprotobuf-dev', 'libgoogle-glog-dev']
Expand Down
21 changes: 6 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ BLACKWIDOW_PATH = $(THIRD_PATH)/blackwidow
endif
BLACKWIDOW = $(BLACKWIDOW_PATH)/lib/libblackwidow$(DEBUG_SUFFIX).a

ifndef PROTOBUF_PATH
PROTOBUF_PATH = $(THIRD_PATH)/protobuf
endif
PROTOBUF = $(PROTOBUF_PATH)/_install/lib/libprotobuf.a
PROTOC = $(PROTOBUF_PATH)/_install/bin/protoc

ifeq ($(360), 1)
GLOG := $(GLOG_PATH)/.libs/libglog.a
Expand All @@ -97,7 +92,6 @@ INCLUDE_PATH = -I. \
-I$(BLACKWIDOW_PATH)/include \
-I$(ROCKSDB_PATH) \
-I$(ROCKSDB_PATH)/include \
-I$(PROTOBUF_PATH)/_install/include

ifeq ($(360),1)
INCLUDE_PATH += -I$(GLOG_PATH)/src
Expand All @@ -119,6 +113,7 @@ LDFLAGS += $(LIB_PATH) \
-lblackwidow$(DEBUG_SUFFIX) \
-lrocksdb$(DEBUG_SUFFIX) \
-lglog \
-lprotobuf \

# ---------------End Dependences----------------

Expand All @@ -127,7 +122,7 @@ LIB_SOURCES := $(VERSION_CC) \
$(filter-out $(VERSION_CC), $(wildcard $(SRC_PATH)/*.cc))

PIKA_PROTO := $(wildcard $(SRC_PATH)/*.proto)
PIKA_PROTO_GENS:= $(PIKA_PROTO:%.proto=%.pb.cc) $(PIKA_PROTO:%.proto=%.pb.h)
PIKA_PROTO_GENS:= $(PIKA_PROTO:%.proto=%.pb.h) $(PIKA_PROTO:%.proto=%.pb.cc)


#-----------------------------------------------
Expand Down Expand Up @@ -203,19 +198,19 @@ BINARY = ${BINNAME}

.PHONY: distclean clean dbg all

%.pb.cc %.pb.h: %.proto $(PROTOC)
$(AM_V_CC)$(PROTOC) -I=$(SRC_PATH) --cpp_out=$(SRC_PATH) $<
%.pb.h %.pb.cc: %.proto
$(AM_V_GEN)protoc --proto_path=$(SRC_PATH) --cpp_out=$(SRC_PATH) $<

%.o: %.cc
$(AM_V_CC)$(CXX) $(CXXFLAGS) -c $< -o $@

proto : $(PIKA_PROTO_GENS)
proto: $(PIKA_PROTO_GENS)

all: $(BINARY)

dbg: $(BINARY)

$(BINARY): $(SLASH) $(PINK) $(ROCKSDB) $(BLACKWIDOW) $(GLOG) $(PROTOOBJECTS) $(PROTOBUF) $(LIBOBJECTS)
$(BINARY): $(SLASH) $(PINK) $(ROCKSDB) $(BLACKWIDOW) $(GLOG) $(PROTOOBJECTS) $(LIBOBJECTS)
$(AM_V_at)rm -f $@
$(AM_V_at)$(AM_LINK)
$(AM_V_at)rm -rf $(OUTPUT)
Expand All @@ -236,9 +231,6 @@ $(ROCKSDB):
$(BLACKWIDOW):
$(AM_V_at)make -C $(BLACKWIDOW_PATH) ROCKSDB_PATH=$(ROCKSDB_PATH) SLASH_PATH=$(SLASH_PATH) DEBUG_LEVEL=$(DEBUG_LEVEL)

$(PROTOBUF) $(PROTOC):
cd $(PROTOBUF_PATH); autoreconf -if; ./configure --prefix=$(PROTOBUF_PATH)/_install --disable-shared; make install; echo '*' > $(PROTOBUF_PATH)/.gitignore

$(GLOG):
cd $(THIRD_PATH)/glog; if [ ! -f ./Makefile ]; then ./configure --disable-shared; fi; make; echo '*' > $(CURDIR)/third/glog/.gitignore;

Expand All @@ -254,5 +246,4 @@ distclean: clean
make -C $(SLASH_PATH)/slash/ clean
make -C $(BLACKWIDOW_PATH)/ clean
make -C $(ROCKSDB_PATH)/ clean
make -C $(PROTOBUF_PATH)/ clean
# make -C $(GLOG_PATH)/ clean
1 change: 0 additions & 1 deletion third/protobuf
Submodule protobuf deleted from 774d63

0 comments on commit ee347ab

Please sign in to comment.