Skip to content

Commit 0ac511e

Browse files
author
Leonid Borchuk
committed
Do not include protobuf files twice
We have two sections in a Makefile - one for CPP_OBJS and one for OBJS. CPP_OBJS use wildcards and src/protos includes bot in CPP_OBJS and in OBJS. So generated gcc string includes multiple items of proto *.o files. That leads to multiple definitions errors in linking time. Do not include proto files in CPP_OBJS macros and use it in OBJS macros.
1 parent dbfeb3d commit 0ac511e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

gpcontrib/gp_stats_collector/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PROTO_BASES = gpsc_plan gpsc_metrics gpsc_set_service
77
PROTO_OBJS = $(patsubst %,src/protos/%.pb.o,$(PROTO_BASES))
88

99
C_OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c src/*/*.c))
10-
CPP_OBJS = $(patsubst %.cpp,%.o,$(wildcard src/*.cpp src/*/*.cpp))
10+
CPP_OBJS = $(patsubst %.cpp,%.o,$(wildcard src/*.cpp src/log/*.cpp src/memory/*.cpp))
1111
OBJS = $(C_OBJS) $(CPP_OBJS) $(PROTO_OBJS)
1212

1313
PG_CXXFLAGS += -Werror -Wall -Wno-unused-but-set-variable -std=c++17 -Isrc/protos -Isrc -Iinclude -DGPBUILD

0 commit comments

Comments
 (0)