Link against pthread in examples

pull/19182/head
Hao Nguyen 6 years ago
parent a03cc2c876
commit 7f787bd083
  1. 2
      examples/cpp/helloworld/Makefile
  2. 2
      examples/cpp/route_guide/Makefile

@ -21,10 +21,12 @@ 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++ grpc`\
-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++ grpc`\
-pthread\
-Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\
-ldl -ldl
endif endif

@ -21,10 +21,12 @@ 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++`\ LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++`\
-pthread\
-lgrpc++_reflection\ -lgrpc++_reflection\
-ldl -ldl
else else
LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++`\ LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++`\
-pthread\
-Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\
-ldl -ldl
endif endif

Loading…
Cancel
Save