Skip to content

Commit

Permalink
protobuf merged
Browse files Browse the repository at this point in the history
  • Loading branch information
yedf committed Jun 16, 2015
1 parent 6f432a6 commit c1e8007
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ OPT ?= -g2
$(shell ./build_config 1>&2)
include config.mk

CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
CFLAGS += -I. $(PLATFORM_CCFLAGS) $(OPT)
CXXFLAGS += -I. $(PLATFORM_CXXFLAGS) $(OPT)

LDFLAGS += $(PLATFORM_LDFLAGS)
LIBS += $(PLATFORM_LIBS)
Expand Down Expand Up @@ -38,7 +38,7 @@ $(LIBRARY): $(HANDY_OBJECTS)
$(AR) -rs $@ $(HANDY_OBJECTS)

handy_test: $(TEST_OBJECTS) $(LIBRARY)
$(CXX) $^ -o $@ $(LDFLAGS) $(LIBRARY) $(LIBS)
$(CXX) $^ -o $@ $(LDFLAGS) $(LIBS)

.cc.o:
$(CXX) $(CXXFLAGS) -c $< -o $@
Expand Down
2 changes: 1 addition & 1 deletion build_config
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ case "$TARGET_OS" in
;;
Darwin)
PLATFORM=OS_MACOSX
COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX -Dthread_local=__thread"
COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX -Dthread_local=__thread -Wno-deprecated-declarations"
PLATFORM_SHARED_EXT=dylib
[ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name $INSTALL_PATH/"
Expand Down
16 changes: 14 additions & 2 deletions protobuf/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# OPT ?= -O2 -DNDEBUG
# (B) Debug mode, w/ full line-level debugging symbols
OPT ?= -g2
# (C) Profiling mode: opt, but w/debugging symbols
# OPT ?= -O2 -g2 -DNDEBUG
include ../config.mk

CFLAGS += -I.. $(PLATFORM_CCFLAGS) $(OPT)
CXXFLAGS += -I.. $(PLATFORM_CXXFLAGS) $(OPT)

LDFLAGS += $(PLATFORM_LDFLAGS)
LIBS += $(PLATFORM_LIBS)


SOURCES=proto_msg.cc test.cc

OBJS = $(SOURCES:.cc=.o)
Expand All @@ -8,8 +20,8 @@ PROGRAMS = test

default: $(PROGRAMS)

$(PROGRAMS): $(LIBFILE) $(OBJS)
$(CXX) -o $@ $(OBJS) msg.pb.cc $(LDFLAGS) `pkg-config --libs protobuf`
$(PROGRAMS): ../libhandy.a $(OBJS)
$(CXX) -o $@ $^ msg.pb.cc $(LDFLAGS) `pkg-config --libs protobuf`

$(OBJS): middle

Expand Down
1 change: 0 additions & 1 deletion protobuf/proto_msg.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "proto_msg.h"
#include "logging.h"
#include <string>
#include <google/protobuf/descriptor.h>

Expand Down
2 changes: 1 addition & 1 deletion protobuf/proto_msg.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <google/protobuf/message.h>
#include "conn.h"
#include <handy/conn.h>
#include <map>

namespace handy {
Expand Down
1 change: 0 additions & 1 deletion protobuf/test.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "proto_msg.h"
#include "logging.h"
#include "msg.pb.h"

using namespace std;
Expand Down

0 comments on commit c1e8007

Please sign in to comment.