Skip to content

Commit bfd06f9

Browse files
authored
Replace Abseil extension with bazel_dep and eliminate source patching
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 9174376 commit bfd06f9

5 files changed

Lines changed: 11 additions & 55 deletions

File tree

.bazelrc.absl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
# This bazelrc defines the `DD_USE_ABSEIL_FOR_ENVOY` preprocessor macro, and so
88
# the resulting library will use `absl::string_view` and `absl::optional`
99
# instead of their standard (`std`) equivalents.
10+
#
11+
# Additionally, we configure Abseil to not use std library types by setting
12+
# the appropriate ABSL_OPTION_* macros, replacing the need for patching.
1013

1114
build --enable_platform_specific_config
1215

13-
build:linux --cxxopt='-std=c++17' --cxxopt='-Wall' --cxxopt='-Wextra' --cxxopt='-pedantic' --cxxopt='-DDD_USE_ABSEIL_FOR_ENVOY'
14-
build:macos --cxxopt='-std=c++17' --cxxopt='-Wall' --cxxopt='-Wextra' --cxxopt='-pedantic' --cxxopt='-DDD_USE_ABSEIL_FOR_ENVOY'
15-
build:windows --cxxopt='/std:c++17' --cxxopt='/DDD_USE_ABSEIL_FOR_ENVOY' --linkopt='ws2_32.lib'
16+
build:linux --cxxopt='-std=c++17' --cxxopt='-Wall' --cxxopt='-Wextra' --cxxopt='-pedantic' --cxxopt='-DDD_USE_ABSEIL_FOR_ENVOY' --cxxopt='-DABSL_OPTION_USE_STD_OPTIONAL=0' --cxxopt='-DABSL_OPTION_USE_STD_STRING_VIEW=0' --cxxopt='-DABSL_OPTION_USE_STD_VARIANT=0'
17+
build:macos --cxxopt='-std=c++17' --cxxopt='-Wall' --cxxopt='-Wextra' --cxxopt='-pedantic' --cxxopt='-DDD_USE_ABSEIL_FOR_ENVOY' --cxxopt='-DABSL_OPTION_USE_STD_OPTIONAL=0' --cxxopt='-DABSL_OPTION_USE_STD_STRING_VIEW=0' --cxxopt='-DABSL_OPTION_USE_STD_VARIANT=0'
18+
build:windows --cxxopt='/std:c++17' --cxxopt='/DDD_USE_ABSEIL_FOR_ENVOY' --cxxopt='/DABSL_OPTION_USE_STD_OPTIONAL=0' --cxxopt='/DABSL_OPTION_USE_STD_STRING_VIEW=0' --cxxopt='/DABSL_OPTION_USE_STD_VARIANT=0' --linkopt='ws2_32.lib'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/bazel-*
22
/.build/
33
/.coverage/
4+
build/
45

56
dist/
67
out/

MODULE.bazel

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ bazel_dep(
1111
name = "rules_cc",
1212
version = "0.0.9",
1313
)
14-
# -- bazel_dep definitions -- #
15-
16-
non_module_dependencies = use_extension("//:extensions.bzl", "non_module_dependencies")
17-
use_repo(
18-
non_module_dependencies,
19-
"com_google_absl",
14+
bazel_dep(
15+
name = "abseil-cpp",
16+
version = "20230125.3",
17+
repo_name = "com_google_absl",
2018
)

abseil.patch

Lines changed: 0 additions & 31 deletions
This file was deleted.

extensions.bzl

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)