aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/cpp
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2016-07-21 14:28:55 -0700
committerGravatar GitHub <noreply@github.com>2016-07-21 14:28:55 -0700
commit7645fdc4f0f7fa9d0f2eaf6e3edb8b9595ece7a6 (patch)
treee20e057d94ba1be958c23281d2fd55185dcf52b7 /examples/cpp
parent593fdab4804fafe769bb3874783169ef5580f8d0 (diff)
parent1c58bd221da3f67cc612149b99a7efe49bb884cb (diff)
Merge pull request #7393 from y-zeng/example_makefile
Enable server reflection in c++ examples
Diffstat (limited to 'examples/cpp')
-rw-r--r--examples/cpp/helloworld/Makefile4
-rw-r--r--examples/cpp/route_guide/Makefile4
2 files changed, 6 insertions, 2 deletions
diff --git a/examples/cpp/helloworld/Makefile b/examples/cpp/helloworld/Makefile
index b45b3c7ee0..b80515abb0 100644
--- a/examples/cpp/helloworld/Makefile
+++ b/examples/cpp/helloworld/Makefile
@@ -32,7 +32,9 @@
CXX = g++
CPPFLAGS += -I/usr/local/include -pthread
CXXFLAGS += -std=c++11
-LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++ grpc` -lprotobuf -lpthread -ldl
+LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++ grpc` \
+ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed \
+ -lprotobuf -lpthread -ldl
PROTOC = protoc
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)`
diff --git a/examples/cpp/route_guide/Makefile b/examples/cpp/route_guide/Makefile
index 50ecf041f5..9ee5119509 100644
--- a/examples/cpp/route_guide/Makefile
+++ b/examples/cpp/route_guide/Makefile
@@ -32,7 +32,9 @@
CXX = g++
CPPFLAGS += -I/usr/local/include -pthread
CXXFLAGS += -std=c++11
-LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++` -lprotobuf -lpthread -ldl
+LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++` \
+ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed \
+ -lprotobuf -lpthread -ldl
PROTOC = protoc
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)`