# Copyright 2010-2025 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. load("@rules_cc//cc:cc_library.bzl", "cc_library") load("@rules_cc//cc:cc_test.bzl", "cc_test") package(default_visibility = ["//visibility:public"]) filegroup( name = "base_swig", srcs = ["base.i"], ) cc_library( name = "accurate_sum", hdrs = ["accurate_sum.h"], ) cc_library( name = "adjustable_priority_queue", hdrs = [ "adjustable_priority_queue.h", "adjustable_priority_queue-inl.h", ], ) cc_library( name = "array", hdrs = ["array.h"], deps = ["@abseil-cpp//absl/utility"], ) cc_library( name = "base", srcs = ["version.cc"], hdrs = [ "commandlineflags.h", "init_google.h", "types.h", "version.h", ], copts = [ "-DOR_TOOLS_MAJOR=9", "-DOR_TOOLS_MINOR=15", "-DOR_TOOLS_PATCH=9999", ], linkopts = select({ "@platforms//os:macos": ["-framework CoreFoundation"], "//conditions:default": [], }), deps = [ ":commandlineflags", ":logging", ":types", "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/flags:parse", "@abseil-cpp//absl/flags:usage", "@abseil-cpp//absl/log", "@abseil-cpp//absl/log:initialize", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:string_view", ], ) cc_library( name = "base_export", hdrs = ["base_export.h"], ) cc_library( name = "bitmap", srcs = ["bitmap.cc"], hdrs = ["bitmap.h"], ) cc_library( name = "commandlineflags", srcs = ["commandlineflags.cc"], hdrs = ["commandlineflags.h"], deps = [ "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/flags:parse", "@abseil-cpp//absl/flags:usage", ], ) cc_library( name = "constant_divisor", srcs = ["constant_divisor.cc"], hdrs = ["constant_divisor.h"], deps = [ "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/numeric:int128", ], ) cc_test( name = "constant_divisor_test", srcs = ["constant_divisor_test.cc"], deps = [ ":constant_divisor", "//ortools/base:gmock_main", "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/random", "@abseil-cpp//absl/random:bit_gen_ref", "@abseil-cpp//absl/random:distributions", "@google_benchmark//:benchmark", ], ) cc_library( name = "container_logging", hdrs = ["container_logging.h"], ) cc_library( name = "dump_vars", hdrs = ["dump_vars.h"], copts = select({ "@platforms//os:windows": ["/Zc:preprocessor"], "//conditions:default": [], }), deps = [ ":strong_vector", "@abseil-cpp//absl/container:inlined_vector", ], ) cc_test( name = "dump_vars_test", size = "small", srcs = ["dump_vars_test.cc"], copts = select({ "@platforms//os:windows": ["/Zc:preprocessor"], "//conditions:default": [], }), deps = [ ":dump_vars", ":strong_int", ":strong_vector", "@googletest//:gtest_main", ], ) cc_library( name = "file", srcs = [ "file.cc", "filesystem.cc", ], hdrs = [ "file.h", "filesystem.h", "helpers.h", "options.h", ], deps = [ ":status_macros", "@abseil-cpp//absl/log", "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/status", "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/strings", "@bzip2//:bz2", "@protobuf", "@zlib", ], ) cc_library( name = "gmock", testonly = True, hdrs = ["gmock.h"], deps = [ "@abseil-cpp//absl/status:status_matchers", "@googletest//:gtest", "@protobuf-matchers//protobuf-matchers", ], ) cc_library( name = "gmock_main", testonly = True, deps = [ ":gmock", "@googletest//:gtest_main", ], ) cc_library( name = "gzipfile", srcs = ["gzipfile.cc"], hdrs = ["gzipfile.h"], deps = [ ":file", ":logging", "@abseil-cpp//absl/strings:string_view", "@zlib", ], ) cc_library( name = "gzipstring", hdrs = ["gzipstring.h"], deps = [ ":logging", "@abseil-cpp//absl/log", "@abseil-cpp//absl/strings:string_view", "@zlib", ], ) cc_library( name = "hash", srcs = ["hash.cc"], hdrs = ["hash.h"], ) cc_library( name = "int_type", hdrs = ["int_type.h"], deps = [ "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/strings:string_view", ], ) cc_library( name = "intops", hdrs = ["strong_int.h"], deps = [ "@abseil-cpp//absl/meta:type_traits", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", "@abseil-cpp//absl/strings:string_view", ], ) cc_library( name = "iterator_adaptors", hdrs = ["iterator_adaptors.h"], ) cc_library( name = "linked_hash_map", hdrs = ["linked_hash_map.h"], deps = [ "//ortools/base", "@abseil-cpp//absl/container:common", "@abseil-cpp//absl/container:flat_hash_set", ], ) cc_library( name = "logging", srcs = ["logging.cc"], hdrs = ["logging.h"], deps = [ ":base_export", "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/base:log_severity", "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/flags:usage", "@abseil-cpp//absl/log", "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/log:die_if_null", "@abseil-cpp//absl/log:globals", "@abseil-cpp//absl/log:initialize", "@abseil-cpp//absl/log:vlog_is_on", "@abseil-cpp//absl/memory", "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:string_view", ], ) cc_library( name = "map_util", hdrs = ["map_util.h"], deps = ["//ortools/base:logging"], ) cc_library( name = "mathutil", srcs = ["mathutil.cc"], hdrs = ["mathutil.h"], deps = [ "//ortools/base:logging", "@abseil-cpp//absl/base", "@abseil-cpp//absl/log:check", ], ) cc_library( name = "memfile", hdrs = ["memfile.h"], ) cc_library( name = "memutil", hdrs = ["memutil.h"], ) cc_library( name = "murmur", hdrs = ["murmur.h"], deps = ["//ortools/base:hash"], ) cc_library( name = "mutable_memfile", hdrs = ["mutable_memfile.h"], ) cc_library( name = "numbers", srcs = ["numbers.cc"], hdrs = ["numbers.h"], deps = [ ":strtoint", "@abseil-cpp//absl/strings", ], ) cc_library( name = "parse_text_proto", hdrs = ["parse_text_proto.h"], deps = [ "//ortools/base:status_macros", "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings:string_view", "@protobuf", ], ) cc_library( name = "parse_test_proto", testonly = True, hdrs = ["parse_test_proto.h"], deps = [ "//ortools/base:gmock", "@protobuf", ], ) cc_library( name = "path", srcs = ["path.cc"], hdrs = ["path.h"], deps = [ "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:string_view", ], ) cc_library( name = "protobuf_util", hdrs = ["protobuf_util.h"], deps = [ "@abseil-cpp//absl/log:check", "@protobuf", ], ) cc_library( name = "protoutil", hdrs = ["protoutil.h"], deps = [ "@abseil-cpp//absl/status", "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/time", "@protobuf//:duration_cc_proto", ], ) cc_library( name = "proto_enum_utils", hdrs = ["proto_enum_utils.h"], deps = ["@protobuf"], ) cc_library( name = "recordio", srcs = ["recordio.cc"], hdrs = ["recordio.h"], deps = [ ":file", "@abseil-cpp//absl/log", "@abseil-cpp//absl/log:check", "@zlib", ], ) cc_library( name = "source_location", hdrs = ["source_location.h"], deps = ["@abseil-cpp//absl/base:config"], ) cc_library( name = "status_builder", hdrs = ["status_builder.h"], deps = [ "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", ], ) cc_library( name = "status_macros", hdrs = ["status_macros.h"], deps = [ ":status_builder", "@abseil-cpp//absl/status", "@abseil-cpp//absl/status:statusor", ], ) cc_library( name = "stl_util", hdrs = ["stl_util.h"], deps = [ "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/meta:type_traits", ], ) cc_library( name = "strong_int", hdrs = ["strong_int.h"], deps = [ "@abseil-cpp//absl/meta:type_traits", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", "@abseil-cpp//absl/strings:string_view", ], ) cc_test( name = "strong_int_test", size = "small", timeout = "long", srcs = ["strong_int_test.cc"], deps = [ ":logging", ":strong_int", "//ortools/base:gmock_main", "@abseil-cpp//absl/container:node_hash_map", "@abseil-cpp//absl/flags:marshalling", "@abseil-cpp//absl/hash:hash_testing", "@abseil-cpp//absl/numeric:int128", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", ], ) cc_library( name = "strong_vector", hdrs = ["strong_vector.h"], deps = [ ":intops", "//ortools/base:logging", ], ) cc_library( name = "strtoint", srcs = ["strtoint.cc"], hdrs = ["strtoint.h"], deps = [ "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/strings", ], ) cc_test( name = "strtoint_test", size = "small", srcs = ["strtoint_test.cc"], deps = [ ":strtoint", "//ortools/base:gmock_main", "//ortools/base:types", ], ) cc_library( name = "sysinfo", srcs = ["sysinfo.cc"], hdrs = ["sysinfo.h"], ) cc_library( name = "temp_file", srcs = ["temp_file.cc"], hdrs = ["temp_file.h"], deps = [ "//ortools/base:logging", "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", "@abseil-cpp//absl/time", ], ) cc_library( name = "temp_path", srcs = ["temp_path.cc"], hdrs = ["temp_path.h"], deps = [ ":base", ":file", "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:string_view", "@abseil-cpp//absl/time", ], ) cc_library( name = "threadpool", srcs = ["threadpool.cc"], hdrs = ["threadpool.h"], deps = [ "@abseil-cpp//absl/algorithm:container", "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/base:nullability", "@abseil-cpp//absl/functional:any_invocable", "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/synchronization", ], ) cc_library( name = "timer", srcs = ["timer.cc"], hdrs = ["timer.h"], deps = [ "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/time", ], ) cc_library( name = "top_n", hdrs = ["top_n.h"], deps = [":logging"], ) cc_library( name = "types", hdrs = ["types.h"], ) cc_library( name = "zipfile", srcs = ["zipfile.cc"], hdrs = ["zipfile.h"], deps = [ ":file", ":logging", "@abseil-cpp//absl/strings:string_view", "@zlib", ], )