diff --git a/examples/cpp/BUILD.bazel b/examples/cpp/BUILD.bazel index 20d51c78f7e..57832468301 100644 --- a/examples/cpp/BUILD.bazel +++ b/examples/cpp/BUILD.bazel @@ -11,6 +11,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + exports_files( [ "shift_minimization.dat", diff --git a/ortools/algorithms/BUILD.bazel b/ortools/algorithms/BUILD.bazel index ce96a8c9f3e..e8e70672efd 100644 --- a/ortools/algorithms/BUILD.bazel +++ b/ortools/algorithms/BUILD.bazel @@ -13,6 +13,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/base/BUILD.bazel b/ortools/base/BUILD.bazel index b4424c60dc4..ad906667771 100644 --- a/ortools/base/BUILD.bazel +++ b/ortools/base/BUILD.bazel @@ -11,6 +11,9 @@ # 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"]) config_setting( @@ -395,7 +398,6 @@ cc_library( cc_library( name = "memfile", hdrs = ["memfile.h"], - deps = [], ) cc_library( @@ -429,7 +431,6 @@ cc_library( cc_library( name = "mutable_memfile", hdrs = ["mutable_memfile.h"], - deps = [], ) cc_library( diff --git a/ortools/bop/BUILD.bazel b/ortools/bop/BUILD.bazel index e909a7dba83..bdc2e395abb 100644 --- a/ortools/bop/BUILD.bazel +++ b/ortools/bop/BUILD.bazel @@ -13,7 +13,6 @@ load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") load("@protobuf//bazel:proto_library.bzl", "proto_library") -load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library") load("@rules_cc//cc:cc_library.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/flatzinc/BUILD.bazel b/ortools/flatzinc/BUILD.bazel index 9852646883d..d2f0d85b53a 100644 --- a/ortools/flatzinc/BUILD.bazel +++ b/ortools/flatzinc/BUILD.bazel @@ -15,6 +15,9 @@ # Source code for the flatzinc interpreter. See www.minizinc.org. # This is a google owned implementation. +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) config_setting( diff --git a/ortools/glpk/BUILD.bazel b/ortools/glpk/BUILD.bazel index b4b57a8263b..e23aef60c5b 100644 --- a/ortools/glpk/BUILD.bazel +++ b/ortools/glpk/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + # Code specific to Glpk solver used by linear_solver/ and math_opt/. package(default_visibility = ["//ortools:__subpackages__"]) diff --git a/ortools/graph/BUILD.bazel b/ortools/graph/BUILD.bazel index 15828c7270a..2d51f51363f 100644 --- a/ortools/graph/BUILD.bazel +++ b/ortools/graph/BUILD.bazel @@ -13,7 +13,9 @@ load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") load("@protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/gurobi/BUILD.bazel b/ortools/gurobi/BUILD.bazel index 07070d46d56..5669746ce4d 100644 --- a/ortools/gurobi/BUILD.bazel +++ b/ortools/gurobi/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/ortools/gurobi/isv_public/BUILD.bazel b/ortools/gurobi/isv_public/BUILD.bazel index cabab7cc8b7..1604eb599a2 100644 --- a/ortools/gurobi/isv_public/BUILD.bazel +++ b/ortools/gurobi/isv_public/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/ortools/init/BUILD.bazel b/ortools/init/BUILD.bazel index c3f0cc42901..a40ae9ace75 100644 --- a/ortools/init/BUILD.bazel +++ b/ortools/init/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/ortools/java/com/google/ortools/BUILD.bazel b/ortools/java/com/google/ortools/BUILD.bazel index 05f5288fabb..188af3bce3f 100644 --- a/ortools/java/com/google/ortools/BUILD.bazel +++ b/ortools/java/com/google/ortools/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + # Utilities to load native libraries in java or-tools. cc_binary( name = "libjniortools.so", diff --git a/ortools/linear_solver/BUILD.bazel b/ortools/linear_solver/BUILD.bazel index a6aad6ec73b..7c0ffde3e50 100644 --- a/ortools/linear_solver/BUILD.bazel +++ b/ortools/linear_solver/BUILD.bazel @@ -15,6 +15,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") load("@protobuf//bazel:proto_library.bzl", "proto_library") load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") load("@rules_cc//cc:cc_library.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/linear_solver/proto_solver/BUILD.bazel b/ortools/linear_solver/proto_solver/BUILD.bazel index e7047ebc6f4..33b4fa4c91a 100644 --- a/ortools/linear_solver/proto_solver/BUILD.bazel +++ b/ortools/linear_solver/proto_solver/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/ortools/linear_solver/samples/code_samples.bzl b/ortools/linear_solver/samples/code_samples.bzl index dbbd25a0309..41be2f3cd02 100644 --- a/ortools/linear_solver/samples/code_samples.bzl +++ b/ortools/linear_solver/samples/code_samples.bzl @@ -16,7 +16,7 @@ load("@pip_deps//:requirements.bzl", "requirement") load("@rules_cc//cc:cc_binary.bzl", "cc_binary") load("@rules_cc//cc:cc_test.bzl", "cc_test") -load("@rules_java//java:defs.bzl", "java_test") +load("@rules_java//java:java_test.bzl", "java_test") load("@rules_python//python:py_binary.bzl", "py_binary") load("@rules_python//python:py_test.bzl", "py_test") diff --git a/ortools/linear_solver/wrappers/BUILD.bazel b/ortools/linear_solver/wrappers/BUILD.bazel index 2695ff282ef..e6725e6542d 100644 --- a/ortools/linear_solver/wrappers/BUILD.bazel +++ b/ortools/linear_solver/wrappers/BUILD.bazel @@ -13,6 +13,8 @@ # ModelBuilder: a lightweight implementation of the linear_solver API +load("@rules_cc//cc:cc_library.bzl", "cc_library") + # Public exports. exports_files( [ diff --git a/ortools/lp_data/BUILD.bazel b/ortools/lp_data/BUILD.bazel index 619de54c9ac..b7723281a63 100644 --- a/ortools/lp_data/BUILD.bazel +++ b/ortools/lp_data/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) config_setting( diff --git a/ortools/math_opt/constraints/indicator/BUILD.bazel b/ortools/math_opt/constraints/indicator/BUILD.bazel index 9b3c1cfc6a0..e49dad14af9 100644 --- a/ortools/math_opt/constraints/indicator/BUILD.bazel +++ b/ortools/math_opt/constraints/indicator/BUILD.bazel @@ -11,6 +11,9 @@ # 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 = ["//ortools/math_opt:__subpackages__"]) cc_library( diff --git a/ortools/math_opt/constraints/quadratic/BUILD.bazel b/ortools/math_opt/constraints/quadratic/BUILD.bazel index 1a395834e2b..5c283ede8eb 100644 --- a/ortools/math_opt/constraints/quadratic/BUILD.bazel +++ b/ortools/math_opt/constraints/quadratic/BUILD.bazel @@ -11,6 +11,9 @@ # 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 = ["//ortools/math_opt:__subpackages__"]) cc_library( diff --git a/ortools/math_opt/constraints/second_order_cone/BUILD.bazel b/ortools/math_opt/constraints/second_order_cone/BUILD.bazel index 7f564322ac7..3bd3630acab 100644 --- a/ortools/math_opt/constraints/second_order_cone/BUILD.bazel +++ b/ortools/math_opt/constraints/second_order_cone/BUILD.bazel @@ -11,6 +11,9 @@ # 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 = ["//ortools/math_opt:__subpackages__"]) cc_library( diff --git a/ortools/math_opt/constraints/sos/BUILD.bazel b/ortools/math_opt/constraints/sos/BUILD.bazel index e5c55a0630b..9573e960390 100644 --- a/ortools/math_opt/constraints/sos/BUILD.bazel +++ b/ortools/math_opt/constraints/sos/BUILD.bazel @@ -11,6 +11,9 @@ # 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 = ["//ortools/math_opt:__subpackages__"]) cc_library( diff --git a/ortools/math_opt/constraints/util/BUILD.bazel b/ortools/math_opt/constraints/util/BUILD.bazel index 4aada4db68c..dc015a8b8d9 100644 --- a/ortools/math_opt/constraints/util/BUILD.bazel +++ b/ortools/math_opt/constraints/util/BUILD.bazel @@ -11,6 +11,9 @@ # 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 = ["//ortools/math_opt:__subpackages__"]) cc_library( diff --git a/ortools/math_opt/core/BUILD.bazel b/ortools/math_opt/core/BUILD.bazel index dd45ee02077..2e23d864e84 100644 --- a/ortools/math_opt/core/BUILD.bazel +++ b/ortools/math_opt/core/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//ortools/math_opt:__subpackages__"]) cc_library( @@ -62,9 +64,9 @@ cc_library( deps = [ "//ortools/base:linked_hash_map", "//ortools/base:status_macros", + "//ortools/base:string_view_migration", "//ortools/math_opt:model_cc_proto", "//ortools/math_opt:model_update_cc_proto", - "//ortools/base:string_view_migration", "@abseil-cpp//absl/algorithm:container", "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/log:check", diff --git a/ortools/math_opt/cpp/BUILD.bazel b/ortools/math_opt/cpp/BUILD.bazel index 4c609e3a3a2..7a82d9736ae 100644 --- a/ortools/math_opt/cpp/BUILD.bazel +++ b/ortools/math_opt/cpp/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + # External users should depend only on ":math_opt" and include # "math_opt.h". Hence other libraries are private. package(default_visibility = [ diff --git a/ortools/math_opt/elemental/python/BUILD.bazel b/ortools/math_opt/elemental/python/BUILD.bazel index 7d290b43ba1..207be611699 100644 --- a/ortools/math_opt/elemental/python/BUILD.bazel +++ b/ortools/math_opt/elemental/python/BUILD.bazel @@ -14,7 +14,7 @@ load("@pip_deps//:requirements.bzl", "requirement") load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") load("@rules_python//python:py_library.bzl", "py_library") -load("@rules_python//python:py_test.bzl", "py_test") +load("@rules_python//python:py_test.bzl", "py_test") genrule( name = "generated_enums", diff --git a/ortools/math_opt/python/BUILD.bazel b/ortools/math_opt/python/BUILD.bazel index fb0ce152406..63b12001c78 100644 --- a/ortools/math_opt/python/BUILD.bazel +++ b/ortools/math_opt/python/BUILD.bazel @@ -13,7 +13,7 @@ load("@pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:py_library.bzl", "py_library") -load("@rules_python//python:py_test.bzl", "py_test") +load("@rules_python//python:py_test.bzl", "py_test") # External users should depend only on ":mathopt" and import "mathopt". # Hence other libraries are private. diff --git a/ortools/math_opt/python/ipc/BUILD.bazel b/ortools/math_opt/python/ipc/BUILD.bazel index 79d3dd9911f..6b271dd68bc 100644 --- a/ortools/math_opt/python/ipc/BUILD.bazel +++ b/ortools/math_opt/python/ipc/BUILD.bazel @@ -12,7 +12,7 @@ # limitations under the License. load("@pip_deps//:requirements.bzl", "requirement") -load("@rules_python//python:defs.bzl", "py_library") +load("@rules_python//python:py_library.bzl", "py_library") py_library( name = "remote_http_solve", diff --git a/ortools/math_opt/python/testing/BUILD.bazel b/ortools/math_opt/python/testing/BUILD.bazel index 374bf0332a8..467db47bdce 100644 --- a/ortools/math_opt/python/testing/BUILD.bazel +++ b/ortools/math_opt/python/testing/BUILD.bazel @@ -13,7 +13,7 @@ load("@pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:py_library.bzl", "py_library") -load("@rules_python//python:py_test.bzl", "py_test") +load("@rules_python//python:py_test.bzl", "py_test") package(default_visibility = ["//ortools/math_opt:__subpackages__"]) diff --git a/ortools/math_opt/solvers/xpress/BUILD.bazel b/ortools/math_opt/solvers/xpress/BUILD.bazel index b339b3b6e7b..5b18b11f2cf 100644 --- a/ortools/math_opt/solvers/xpress/BUILD.bazel +++ b/ortools/math_opt/solvers/xpress/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + # Code specific to XPRESS used in xpress_solver.cc. package(default_visibility = ["//ortools/math_opt/solvers:__subpackages__"]) diff --git a/ortools/packing/BUILD.bazel b/ortools/packing/BUILD.bazel index 405f0e7a78e..982ba5a0f65 100644 --- a/ortools/packing/BUILD.bazel +++ b/ortools/packing/BUILD.bazel @@ -13,7 +13,9 @@ load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") load("@protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/pdlp/BUILD.bazel b/ortools/pdlp/BUILD.bazel index 04dbb9ba9ca..dcef03144ec 100644 --- a/ortools/pdlp/BUILD.bazel +++ b/ortools/pdlp/BUILD.bazel @@ -15,6 +15,7 @@ load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") load("@protobuf//bazel:proto_library.bzl", "proto_library") load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library") load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/port/BUILD.bazel b/ortools/port/BUILD.bazel index 20219982d74..6c5639dee5a 100644 --- a/ortools/port/BUILD.bazel +++ b/ortools/port/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/ortools/routing/parsers/BUILD.bazel b/ortools/routing/parsers/BUILD.bazel index 5c625ba0710..b0faa60aafc 100644 --- a/ortools/routing/parsers/BUILD.bazel +++ b/ortools/routing/parsers/BUILD.bazel @@ -14,6 +14,7 @@ load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") load("@protobuf//bazel:proto_library.bzl", "proto_library") load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/routing/samples/BUILD.bazel b/ortools/routing/samples/BUILD.bazel index c30dd772be3..ae9c018eaf1 100644 --- a/ortools/routing/samples/BUILD.bazel +++ b/ortools/routing/samples/BUILD.bazel @@ -11,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") load(":code_samples.bzl", "code_sample_cc") code_sample_cc(name = "simple_routing_program") diff --git a/ortools/sat/python/BUILD.bazel b/ortools/sat/python/BUILD.bazel index 58ab55d178f..608f7d5dd95 100644 --- a/ortools/sat/python/BUILD.bazel +++ b/ortools/sat/python/BUILD.bazel @@ -15,8 +15,10 @@ load("@pip_deps//:requirements.bzl", "requirement") load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") load("@rules_python//python:py_library.bzl", "py_library") -load("@rules_python//python:py_test.bzl", "py_test") +load("@rules_python//python:py_test.bzl", "py_test") cc_library( name = "linear_expr_doc", diff --git a/ortools/third_party_solvers/BUILD.bazel b/ortools/third_party_solvers/BUILD.bazel index 7b2ee8fefba..a7eb2776a65 100644 --- a/ortools/third_party_solvers/BUILD.bazel +++ b/ortools/third_party_solvers/BUILD.bazel @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) config_setting( diff --git a/ortools/util/BUILD.bazel b/ortools/util/BUILD.bazel index 3c61f2e134f..4b964ab7f53 100644 --- a/ortools/util/BUILD.bazel +++ b/ortools/util/BUILD.bazel @@ -405,7 +405,6 @@ cc_library( cc_library( name = "random_engine", hdrs = ["random_engine.h"], - deps = [], ) cc_library(