summaryrefslogtreecommitdiff
path: root/absl/flags/BUILD.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'absl/flags/BUILD.bazel')
-rw-r--r--absl/flags/BUILD.bazel195
1 files changed, 121 insertions, 74 deletions
diff --git a/absl/flags/BUILD.bazel b/absl/flags/BUILD.bazel
index cdb4e7e8..62fb9a8b 100644
--- a/absl/flags/BUILD.bazel
+++ b/absl/flags/BUILD.bazel
@@ -14,7 +14,7 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -24,29 +24,21 @@ load(
package(default_visibility = ["//visibility:public"])
-licenses(["notice"]) # Apache 2.0
+licenses(["notice"])
cc_library(
- name = "flag_internal",
- srcs = [
- "internal/flag.cc",
- ],
+ name = "path_util",
hdrs = [
- "internal/flag.h",
+ "internal/path_util.h",
],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
- visibility = ["//absl/base:__subpackages__"],
+ visibility = [
+ "//absl/flags:__pkg__",
+ ],
deps = [
- ":config",
- ":handle",
- ":registry",
- "//absl/base",
"//absl/base:config",
- "//absl/base:core_headers",
- "//absl/memory",
"//absl/strings",
- "//absl/synchronization",
],
)
@@ -73,22 +65,6 @@ cc_library(
)
cc_library(
- name = "path_util",
- hdrs = [
- "internal/path_util.h",
- ],
- copts = ABSL_DEFAULT_COPTS,
- linkopts = ABSL_DEFAULT_LINKOPTS,
- visibility = [
- "//absl/flags:__pkg__",
- ],
- deps = [
- "//absl/base:config",
- "//absl/strings",
- ],
-)
-
-cc_library(
name = "config",
srcs = [
"usage_config.cc",
@@ -129,34 +105,48 @@ cc_library(
)
cc_library(
- name = "handle",
+ name = "commandlineflag_internal",
+ srcs = [
+ "internal/commandlineflag.cc",
+ ],
hdrs = [
"internal/commandlineflag.h",
],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
- visibility = [
- "//absl/flags:__pkg__",
+ visibility = ["//visibility:private"],
+ deps = [
+ "//absl/base:config",
+ "//absl/base:fast_type_id",
+ ],
+)
+
+cc_library(
+ name = "commandlineflag",
+ srcs = [
+ "commandlineflag.cc",
+ ],
+ hdrs = [
+ "commandlineflag.h",
],
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
- ":config",
- ":marshalling",
+ ":commandlineflag_internal",
"//absl/base:config",
- "//absl/base:core_headers",
+ "//absl/base:fast_type_id",
"//absl/strings",
"//absl/types:optional",
],
)
cc_library(
- name = "registry",
+ name = "private_handle_accessor",
srcs = [
- "internal/registry.cc",
- "internal/type_erased.cc",
+ "internal/private_handle_accessor.cc",
],
hdrs = [
- "internal/registry.h",
- "internal/type_erased.h",
+ "internal/private_handle_accessor.h",
],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
@@ -164,13 +154,62 @@ cc_library(
"//absl/flags:__pkg__",
],
deps = [
+ ":commandlineflag",
+ ":commandlineflag_internal",
+ "//absl/base:config",
+ "//absl/strings",
+ ],
+)
+
+cc_library(
+ name = "reflection",
+ srcs = [
+ "reflection.cc",
+ ],
+ hdrs = [
+ "internal/registry.h",
+ "reflection.h",
+ ],
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ deps = [
+ ":commandlineflag",
+ ":commandlineflag_internal",
":config",
- ":handle",
+ ":private_handle_accessor",
"//absl/base:config",
"//absl/base:core_headers",
- "//absl/base:raw_logging_internal",
+ "//absl/container:flat_hash_map",
+ "//absl/strings",
+ "//absl/synchronization",
+ ],
+)
+
+cc_library(
+ name = "flag_internal",
+ srcs = [
+ "internal/flag.cc",
+ ],
+ hdrs = [
+ "internal/flag.h",
+ ],
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = ["//absl/base:__subpackages__"],
+ deps = [
+ ":commandlineflag",
+ ":commandlineflag_internal",
+ ":config",
+ ":marshalling",
+ ":reflection",
+ "//absl/base",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/memory",
+ "//absl/meta:type_traits",
"//absl/strings",
"//absl/synchronization",
+ "//absl/utility",
],
)
@@ -188,9 +227,7 @@ cc_library(
deps = [
":config",
":flag_internal",
- ":handle",
- ":marshalling",
- ":registry",
+ ":reflection",
"//absl/base",
"//absl/base:config",
"//absl/base:core_headers",
@@ -212,13 +249,14 @@ cc_library(
"//absl/flags:__pkg__",
],
deps = [
+ ":commandlineflag",
":config",
":flag",
":flag_internal",
- ":handle",
":path_util",
+ ":private_handle_accessor",
":program_name",
- ":registry",
+ ":reflection",
"//absl/base:config",
"//absl/base:core_headers",
"//absl/strings",
@@ -254,12 +292,14 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
+ ":commandlineflag",
+ ":commandlineflag_internal",
":config",
":flag",
":flag_internal",
- ":handle",
+ ":private_handle_accessor",
":program_name",
- ":registry",
+ ":reflection",
":usage",
":usage_internal",
"//absl/base:config",
@@ -276,15 +316,17 @@ cc_test(
name = "commandlineflag_test",
size = "small",
srcs = [
- "internal/commandlineflag_test.cc",
+ "commandlineflag_test.cc",
],
copts = ABSL_TEST_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
+ ":commandlineflag",
+ ":commandlineflag_internal",
":config",
":flag",
- ":handle",
- ":registry",
+ ":private_handle_accessor",
+ ":reflection",
"//absl/memory",
"//absl/strings",
"@com_google_googletest//:gtest_main",
@@ -318,10 +360,12 @@ cc_test(
":config",
":flag",
":flag_internal",
- ":handle",
- ":registry",
+ ":marshalling",
+ ":reflection",
"//absl/base:core_headers",
+ "//absl/base:malloc_internal",
"//absl/strings",
+ "//absl/time",
"@com_google_googletest//:gtest_main",
],
)
@@ -337,6 +381,8 @@ cc_binary(
visibility = ["//visibility:private"],
deps = [
":flag",
+ ":marshalling",
+ "//absl/strings",
"//absl/time",
"//absl/types:optional",
"@com_github_google_benchmark//:benchmark_main",
@@ -358,35 +404,35 @@ cc_test(
)
cc_test(
- name = "path_util_test",
+ name = "parse_test",
size = "small",
srcs = [
- "internal/path_util_test.cc",
+ "parse_test.cc",
],
copts = ABSL_TEST_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
- ":path_util",
+ ":flag",
+ ":parse",
+ ":reflection",
+ "//absl/base:raw_logging_internal",
+ "//absl/base:scoped_set_env",
+ "//absl/strings",
+ "//absl/types:span",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
- name = "parse_test",
+ name = "path_util_test",
size = "small",
srcs = [
- "parse_test.cc",
+ "internal/path_util_test.cc",
],
copts = ABSL_TEST_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
- ":flag",
- ":parse",
- ":registry",
- "//absl/base:raw_logging_internal",
- "//absl/base:scoped_set_env",
- "//absl/strings",
- "//absl/types:span",
+ ":path_util",
"@com_google_googletest//:gtest_main",
],
)
@@ -407,19 +453,21 @@ cc_test(
)
cc_test(
- name = "type_erased_test",
+ name = "reflection_test",
size = "small",
srcs = [
- "internal/type_erased_test.cc",
+ "reflection_test.cc",
],
copts = ABSL_TEST_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
+ ":commandlineflag_internal",
":flag",
- ":handle",
":marshalling",
- ":registry",
+ ":reflection",
+ ":usage_internal",
"//absl/memory",
+ "//absl/strings",
"@com_google_googletest//:gtest_main",
],
)
@@ -455,10 +503,9 @@ cc_test(
":parse",
":path_util",
":program_name",
- ":registry",
+ ":reflection",
":usage",
":usage_internal",
- "//absl/memory",
"//absl/strings",
"@com_google_googletest//:gtest",
],