Simplify helloworld makefile

Use pkg-config to automatically find grpc as a dependency of grpc++.
pull/20211/head
Zack Galbreath 5 years ago
parent d249dc9cf3
commit 17f95ab1f5
  1. 4
      examples/cpp/helloworld/Makefile

@ -20,12 +20,12 @@ CXX = g++
CPPFLAGS += `pkg-config --cflags protobuf grpc` CPPFLAGS += `pkg-config --cflags protobuf grpc`
CXXFLAGS += -std=c++11 CXXFLAGS += -std=c++11
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++ grpc`\ LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++`\
-pthread\ -pthread\
-lgrpc++_reflection\ -lgrpc++_reflection\
-ldl -ldl
else else
LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++ grpc`\ LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++`\
-pthread\ -pthread\
-Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\
-ldl -ldl

Loading…
Cancel
Save