Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ COPTS = [
"-D__STDC_FORMAT_MACROS",
"-D__STDC_LIMIT_MACROS",
"-D__STDC_CONSTANT_MACROS",
"-DGFLAGS_NS=google",
] + select({
"//bazel/config:brpc_with_glog": ["-DBRPC_WITH_GLOG=1"],
"//conditions:default": ["-DBRPC_WITH_GLOG=0"],
Expand Down Expand Up @@ -104,6 +103,11 @@ genrule(
"//conditions:default": "0",
}) +
"""

#ifndef GFLAGS_NS
#define GFLAGS_NS google
#endif

#endif // BUTIL_CONFIG_H
EOF
""",
Expand Down
4 changes: 4 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
#endif
#cmakedefine BRPC_WITH_GLOG @WITH_GLOG_VAL@

#ifndef GFLAGS_NS
#define GFLAGS_NS google
#endif

#endif // BUTIL_CONFIG_H
6 changes: 5 additions & 1 deletion config_brpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ fi
append_to_output "CPPFLAGS=${CPPFLAGS}"
append_to_output "# without the flag, linux+arm64 may crash due to folding on TLS.
ifeq (\$(CC),gcc)
ifeq (\$(shell uname -p),aarch64)
ifeq (\$(shell uname -p),aarch64)
CPPFLAGS+=-fno-gcse
endif
endif
Expand Down Expand Up @@ -585,6 +585,10 @@ cat << EOF > src/butil/config.h
#endif
#define BRPC_WITH_GLOG $WITH_GLOG

#ifndef GFLAGS_NS
#define GFLAGS_NS google
#endif

#endif // BUTIL_CONFIG_H
EOF

Expand Down
1 change: 0 additions & 1 deletion example/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ COPTS = [
"-fPIC",
"-Wno-unused-parameter",
"-fno-omit-frame-pointer",
"-DGFLAGS_NS=google",
] + select({
"//bazel/config:brpc_with_glog": ["-DBRPC_WITH_GLOG=1"],
"//conditions:default": ["-DBRPC_WITH_GLOG=0"],
Expand Down
1 change: 0 additions & 1 deletion test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ COPTS = [
"-fPIC",
"-Wno-unused-parameter",
"-fno-omit-frame-pointer",
"-DGFLAGS_NS=google",
"-fno-access-control",
"-DBAZEL_TEST=1",
"-DBVAR_NOT_LINK_DEFAULT_VARIABLES",
Expand Down