about summary refs log tree commit diff
path: root/absl/flags/BUILD.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'absl/flags/BUILD.bazel')
-rw-r--r--absl/flags/BUILD.bazel171
1 files changed, 93 insertions, 78 deletions
diff --git a/absl/flags/BUILD.bazel b/absl/flags/BUILD.bazel
index 368108252741..006911fd8e71 100644
--- a/absl/flags/BUILD.bazel
+++ b/absl/flags/BUILD.bazel
@@ -27,28 +27,18 @@ package(default_visibility = ["//visibility:public"])
 licenses(["notice"])  # Apache 2.0
 
 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",
-        ":marshalling",
-        ":registry",
-        "//absl/base",
         "//absl/base:config",
-        "//absl/base:core_headers",
-        "//absl/memory",
-        "//absl/meta:type_traits",
         "//absl/strings",
-        "//absl/synchronization",
     ],
 )
 
@@ -75,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",
@@ -131,21 +105,32 @@ cc_library(
 )
 
 cc_library(
-    name = "handle",
-    srcs = [
-        "internal/commandlineflag.cc",
-    ],
+    name = "commandlineflag_internal",
     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 = [
+        ":commandlineflag_internal",
         "//absl/base:config",
-        "//absl/base:core_headers",
         "//absl/base:fast_type_id",
         "//absl/strings",
         "//absl/types:optional",
@@ -165,37 +150,66 @@ cc_library(
     visibility = [
         "//absl/flags:__pkg__",
     ],
-    deps = [":handle"],
+    deps = [
+        ":commandlineflag",
+        ":commandlineflag_internal",
+        "//absl/base:config",
+        "//absl/strings",
+    ],
 )
 
 cc_library(
-    name = "registry",
+    name = "reflection",
     srcs = [
-        "internal/registry.cc",
-        "internal/type_erased.cc",
+        "reflection.cc",
     ],
     hdrs = [
         "internal/registry.h",
-        "internal/type_erased.h",
+        "reflection.h",
     ],
     copts = ABSL_DEFAULT_COPTS,
     linkopts = ABSL_DEFAULT_LINKOPTS,
-    visibility = [
-        "//absl/flags:__pkg__",
-    ],
     deps = [
+        ":commandlineflag",
+        ":commandlineflag_internal",
         ":config",
-        ":handle",
         ":private_handle_accessor",
         "//absl/base:config",
         "//absl/base:core_headers",
-        "//absl/base:raw_logging_internal",
         "//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",
+    ],
+)
+
+cc_library(
     name = "flag",
     srcs = [
         "flag.cc",
@@ -209,9 +223,7 @@ cc_library(
     deps = [
         ":config",
         ":flag_internal",
-        ":handle",
-        ":marshalling",
-        ":registry",
+        ":reflection",
         "//absl/base",
         "//absl/base:config",
         "//absl/base:core_headers",
@@ -233,14 +245,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",
@@ -276,13 +288,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",
@@ -299,16 +312,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",
         ":private_handle_accessor",
-        ":registry",
+        ":reflection",
         "//absl/memory",
         "//absl/strings",
         "@com_google_googletest//:gtest_main",
@@ -342,8 +356,8 @@ cc_test(
         ":config",
         ":flag",
         ":flag_internal",
-        ":handle",
-        ":registry",
+        ":marshalling",
+        ":reflection",
         "//absl/base:core_headers",
         "//absl/base:malloc_internal",
         "//absl/strings",
@@ -363,6 +377,8 @@ cc_binary(
     visibility = ["//visibility:private"],
     deps = [
         ":flag",
+        ":marshalling",
+        "//absl/strings",
         "//absl/time",
         "//absl/types:optional",
         "@com_github_google_benchmark//:benchmark_main",
@@ -384,35 +400,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",
     ],
 )
@@ -433,18 +449,18 @@ 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",
         "//absl/memory",
         "@com_google_googletest//:gtest_main",
     ],
@@ -481,10 +497,9 @@ cc_test(
         ":parse",
         ":path_util",
         ":program_name",
-        ":registry",
+        ":reflection",
         ":usage",
         ":usage_internal",
-        "//absl/memory",
         "//absl/strings",
         "@com_google_googletest//:gtest",
     ],