Skip to content

Commit 2734d60

Browse files
committed
base: export strong_int cleanup from google3
1 parent d356be0 commit 2734d60

3 files changed

Lines changed: 184 additions & 268 deletions

File tree

ortools/base/BUILD.bazel

Lines changed: 120 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,31 @@ filegroup(
3636
visibility = ["//visibility:public"],
3737
)
3838

39+
cc_library(
40+
name = "accurate_sum",
41+
hdrs = ["accurate_sum.h"],
42+
)
43+
44+
cc_library(
45+
name = "adjustable_priority_queue",
46+
hdrs = [
47+
"adjustable_priority_queue.h",
48+
"adjustable_priority_queue-inl.h",
49+
],
50+
deps = [
51+
":base",
52+
],
53+
)
54+
55+
cc_library(
56+
name = "array",
57+
srcs = ["array_internal.h"],
58+
hdrs = ["array.h"],
59+
deps = [
60+
"@abseil-cpp//absl/utility",
61+
],
62+
)
63+
3964
cc_library(
4065
name = "base",
4166
srcs = [
@@ -82,28 +107,8 @@ cc_library(
82107
)
83108

84109
cc_library(
85-
name = "accurate_sum",
86-
hdrs = ["accurate_sum.h"],
87-
)
88-
89-
cc_library(
90-
name = "adjustable_priority_queue",
91-
hdrs = [
92-
"adjustable_priority_queue.h",
93-
"adjustable_priority_queue-inl.h",
94-
],
95-
deps = [
96-
":base",
97-
],
98-
)
99-
100-
cc_library(
101-
name = "array",
102-
srcs = ["array_internal.h"],
103-
hdrs = ["array.h"],
104-
deps = [
105-
"@abseil-cpp//absl/utility",
106-
],
110+
name = "base_export",
111+
hdrs = ["base_export.h"],
107112
)
108113

109114
cc_library(
@@ -137,6 +142,31 @@ cc_library(
137142
],
138143
)
139144

145+
cc_library(
146+
name = "constant_divisor",
147+
srcs = ["constant_divisor.cc"],
148+
hdrs = ["constant_divisor.h"],
149+
visibility = ["//visibility:public"],
150+
deps = [
151+
"@abseil-cpp//absl/log:check",
152+
"@abseil-cpp//absl/numeric:int128",
153+
],
154+
)
155+
156+
cc_test(
157+
name = "constant_divisor_test",
158+
srcs = ["constant_divisor_test.cc"],
159+
deps = [
160+
":constant_divisor",
161+
"@abseil-cpp//absl/flags:flag",
162+
"@abseil-cpp//absl/random",
163+
"@abseil-cpp//absl/random:bit_gen_ref",
164+
"@abseil-cpp//absl/random:distributions",
165+
"@com_google_benchmark//:benchmark",
166+
"@com_google_googletest//:gtest_main",
167+
],
168+
)
169+
140170
cc_library(
141171
name = "container_logging",
142172
hdrs = ["container_logging.h"],
@@ -239,28 +269,6 @@ cc_library(
239269
],
240270
)
241271

242-
cc_library(
243-
name = "status_matchers",
244-
hdrs = ["status_matchers.h"],
245-
deps = [
246-
":base",
247-
"@abseil-cpp//absl/status",
248-
"@abseil-cpp//absl/status:statusor",
249-
"@abseil-cpp//absl/strings",
250-
"@com_google_googletest//:gtest",
251-
],
252-
)
253-
254-
cc_library(
255-
name = "message_matchers",
256-
hdrs = ["message_matchers.h"],
257-
deps = [
258-
"@abseil-cpp//absl/strings",
259-
"@com_google_googletest//:gtest",
260-
"@com_google_protobuf//:protobuf",
261-
],
262-
)
263-
264272
cc_library(
265273
name = "gmock",
266274
hdrs = ["gmock.h"],
@@ -325,30 +333,11 @@ cc_library(
325333
name = "intops",
326334
hdrs = ["strong_int.h"],
327335
deps = [
328-
":int_type",
329-
"@abseil-cpp//absl/log:absl_log",
330-
"@abseil-cpp//absl/numeric:int128",
331-
"@abseil-cpp//absl/strings",
332-
"@abseil-cpp//absl/strings:str_format",
333-
],
334-
)
335-
336-
cc_test(
337-
name = "strong_int_test",
338-
size = "small",
339-
timeout = "long",
340-
srcs = ["strong_int_test.cc"],
341-
deps = [
342-
":intops",
343-
":base",
344-
":types",
345-
"@abseil-cpp//absl/container:node_hash_map",
346-
"@abseil-cpp//absl/flags:marshalling",
347-
"@abseil-cpp//absl/hash:hash_testing",
336+
":int_type",
337+
"@abseil-cpp//absl/log:absl_log",
348338
"@abseil-cpp//absl/numeric:int128",
349339
"@abseil-cpp//absl/strings",
350340
"@abseil-cpp//absl/strings:str_format",
351-
"@com_google_googletest//:gtest_main",
352341
],
353342
)
354343

@@ -358,31 +347,6 @@ cc_library(
358347
deps = [":base"],
359348
)
360349

361-
cc_library(
362-
name = "constant_divisor",
363-
srcs = ["constant_divisor.cc"],
364-
hdrs = ["constant_divisor.h"],
365-
visibility = ["//visibility:public"],
366-
deps = [
367-
"@abseil-cpp//absl/log:check",
368-
"@abseil-cpp//absl/numeric:int128",
369-
],
370-
)
371-
372-
cc_test(
373-
name = "constant_divisor_test",
374-
srcs = ["constant_divisor_test.cc"],
375-
deps = [
376-
":constant_divisor",
377-
"@abseil-cpp//absl/flags:flag",
378-
"@abseil-cpp//absl/random",
379-
"@abseil-cpp//absl/random:bit_gen_ref",
380-
"@abseil-cpp//absl/random:distributions",
381-
"@com_google_benchmark//:benchmark",
382-
"@com_google_googletest//:gtest_main",
383-
],
384-
)
385-
386350
cc_library(
387351
name = "linked_hash_map",
388352
hdrs = ["linked_hash_map.h"],
@@ -415,11 +379,6 @@ cc_library(
415379
],
416380
)
417381

418-
cc_library(
419-
name = "base_export",
420-
hdrs = ["base_export.h"],
421-
)
422-
423382
cc_library(
424383
name = "macros",
425384
hdrs = ["macros.h"],
@@ -457,6 +416,16 @@ cc_library(
457416
],
458417
)
459418

419+
cc_library(
420+
name = "message_matchers",
421+
hdrs = ["message_matchers.h"],
422+
deps = [
423+
"@abseil-cpp//absl/strings",
424+
"@com_google_googletest//:gtest",
425+
"@com_google_protobuf//:protobuf",
426+
],
427+
)
428+
460429
cc_library(
461430
name = "murmur",
462431
hdrs = ["murmur.h"],
@@ -512,20 +481,6 @@ cc_library(
512481
],
513482
)
514483

515-
cc_library(
516-
name = "temp_path",
517-
srcs = ["temp_path.cc"],
518-
hdrs = ["temp_path.h"],
519-
deps = [
520-
":base",
521-
":file",
522-
"@abseil-cpp//absl/log:check",
523-
"@abseil-cpp//absl/status",
524-
"@abseil-cpp//absl/strings",
525-
"@abseil-cpp//absl/time",
526-
],
527-
)
528-
529484
cc_library(
530485
name = "protobuf_util",
531486
hdrs = ["protobuf_util.h"],
@@ -593,6 +548,18 @@ cc_library(
593548
],
594549
)
595550

551+
cc_library(
552+
name = "status_matchers",
553+
hdrs = ["status_matchers.h"],
554+
deps = [
555+
":base",
556+
"@abseil-cpp//absl/status",
557+
"@abseil-cpp//absl/status:statusor",
558+
"@abseil-cpp//absl/strings",
559+
"@com_google_googletest//:gtest",
560+
],
561+
)
562+
596563
cc_library(
597564
name = "status_macros",
598565
hdrs = ["status_macros.h"],
@@ -610,6 +577,36 @@ cc_library(
610577
deps = [":base"],
611578
)
612579

580+
cc_library(
581+
name = "strong_int",
582+
hdrs = ["strong_int.h"],
583+
deps = [
584+
"@abseil-cpp//absl/meta:type_traits",
585+
"@abseil-cpp//absl/strings",
586+
"@abseil-cpp//absl/strings:str_format",
587+
"@abseil-cpp//absl/strings:string_view",
588+
],
589+
)
590+
591+
cc_test(
592+
name = "strong_int_test",
593+
size = "small",
594+
timeout = "long",
595+
srcs = ["strong_int_test.cc"],
596+
deps = [
597+
":gmock",
598+
":logging",
599+
":strong_int",
600+
"@abseil-cpp//absl/container:node_hash_map",
601+
"@abseil-cpp//absl/flags:marshalling",
602+
"@abseil-cpp//absl/hash:hash_testing",
603+
"@abseil-cpp//absl/numeric:int128",
604+
"@abseil-cpp//absl/strings",
605+
"@abseil-cpp//absl/strings:str_format",
606+
"@com_google_googletest//:gtest_main",
607+
],
608+
)
609+
613610
cc_library(
614611
name = "strong_vector",
615612
hdrs = ["strong_vector.h"],
@@ -638,6 +635,20 @@ cc_library(
638635
],
639636
)
640637

638+
cc_library(
639+
name = "temp_path",
640+
srcs = ["temp_path.cc"],
641+
hdrs = ["temp_path.h"],
642+
deps = [
643+
":base",
644+
":file",
645+
"@abseil-cpp//absl/log:check",
646+
"@abseil-cpp//absl/status",
647+
"@abseil-cpp//absl/strings",
648+
"@abseil-cpp//absl/time",
649+
],
650+
)
651+
641652
cc_library(
642653
name = "threadpool",
643654
srcs = ["threadpool.cc"],

0 commit comments

Comments
 (0)