This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 8681303a2696267378a00034e0ad1178529eb63a
Author: NJrslv <[email protected]>
AuthorDate: Thu Mar 26 11:21:35 2026 +0300

    [gp_stats_collector] Simplify Makefile and add -Wno-unused-but-set-variable
---
 gpcontrib/gp_stats_collector/Makefile | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/gpcontrib/gp_stats_collector/Makefile 
b/gpcontrib/gp_stats_collector/Makefile
index c8f7b3c30fe..43255ca1955 100644
--- a/gpcontrib/gp_stats_collector/Makefile
+++ b/gpcontrib/gp_stats_collector/Makefile
@@ -10,13 +10,8 @@ C_OBJS   = $(patsubst %.c,%.o,$(wildcard src/*.c src/*/*.c))
 CPP_OBJS = $(patsubst %.cpp,%.o,$(wildcard src/*.cpp src/*/*.cpp))
 OBJS     = $(C_OBJS) $(CPP_OBJS) $(PROTO_OBJS)
 
-override CXXFLAGS = -Werror -fPIC -g3 -Wall -Wpointer-arith -Wendif-labels \
-       -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing 
-fwrapv \
-       -Wno-unused-but-set-variable -Wno-address -Wno-format-truncation \
-       -Wno-stringop-truncation -g -ggdb -std=c++17 -Iinclude -Isrc/protos 
-Isrc -DGPBUILD
-
-PG_CXXFLAGS += -Isrc -Iinclude
-SHLIB_LINK += -lprotobuf -lpthread -lstdc++
+PG_CXXFLAGS += -Werror -Wall -Wno-unused-but-set-variable -std=c++17 
-Isrc/protos -Isrc -Iinclude -DGPBUILD
+SHLIB_LINK += -lprotobuf -lstdc++
 EXTRA_CLEAN = src/protos
 
 ifdef USE_PGXS
@@ -30,10 +25,11 @@ include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
 endif
 
-src/protos/%.pb.cpp src/protos/%.pb.h: protos/%.proto
+src/protos/.done: $(wildcard protos/*.proto)
        @mkdir -p src/protos
        protoc -I /usr/include -I /usr/local/include -I . --cpp_out=src $^
-       mv src/protos/$*.pb.cc src/protos/$*.pb.cpp
+       for f in src/protos/*.pb.cc; do mv "$$f" "$${f%.cc}.cpp"; done
+       touch $@
 
-$(CPP_OBJS): src/protos/gpsc_metrics.pb.h src/protos/gpsc_plan.pb.h 
src/protos/gpsc_set_service.pb.h
-src/protos/gpsc_set_service.pb.o: src/protos/gpsc_metrics.pb.h
+src/protos/%.pb.cpp src/protos/%.pb.h: src/protos/.done ;
+$(CPP_OBJS): src/protos/.done


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to