mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Makefile: Eagerly run pkg-config for protobuf
Protobuf added a dependency on absl and now pkg-config is incredibly slow. `pkg-config --libs protobuf` and `--cflags` each take around 1.5 seconds on my laptop. Running pkg-config only once reduces a 100% incremental build for 'make all' from 90 seconds to 3.2 seconds. Unfortunately we will pay the 3 seconds every time we execute make, even for something that doesn't need protobuf.
This commit is contained in:
4
Makefile
4
Makefile
@@ -138,12 +138,12 @@ PROTOS = \
|
||||
PROTO_HDRS = $(patsubst %.proto, $(OBJDIR)/%.pb.h, $(PROTOS))
|
||||
PROTO_SRCS = $(patsubst %.proto, $(OBJDIR)/%.pb.cc, $(PROTOS))
|
||||
PROTO_OBJS = $(patsubst %.cc, %.o, $(PROTO_SRCS))
|
||||
PROTO_CFLAGS = $(shell $(PKG_CONFIG) --cflags protobuf)
|
||||
PROTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags protobuf)
|
||||
$(PROTO_SRCS): | $(PROTO_HDRS)
|
||||
$(PROTO_OBJS): CFLAGS += $(PROTO_CFLAGS)
|
||||
PROTO_LIB = $(OBJDIR)/libproto.a
|
||||
$(PROTO_LIB): $(PROTO_OBJS)
|
||||
PROTO_LDFLAGS = $(shell $(PKG_CONFIG) --libs protobuf) -pthread
|
||||
PROTO_LDFLAGS := $(shell $(PKG_CONFIG) --libs protobuf) -pthread
|
||||
.PRECIOUS: $(PROTO_HDRS) $(PROTO_SRCS)
|
||||
|
||||
include dep/agg/build.mk
|
||||
|
||||
Reference in New Issue
Block a user