From 2fd586595be43e555eb5943e0ae86a22e61f7352 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 6 Aug 2025 10:57:31 +0200 Subject: [PATCH] bazel: fix more load statements --- examples/cpp/BUILD.bazel | 4 ++++ ortools/algorithms/BUILD.bazel | 1 + ortools/base/BUILD.bazel | 5 +++-- ortools/bop/BUILD.bazel | 1 - ortools/flatzinc/BUILD.bazel | 3 +++ ortools/glpk/BUILD.bazel | 2 ++ ortools/graph/BUILD.bazel | 2 ++ ortools/gurobi/BUILD.bazel | 2 ++ ortools/gurobi/isv_public/BUILD.bazel | 2 ++ ortools/init/BUILD.bazel | 2 ++ ortools/java/com/google/ortools/BUILD.bazel | 2 ++ ortools/linear_solver/BUILD.bazel | 1 + ortools/linear_solver/proto_solver/BUILD.bazel | 2 ++ ortools/linear_solver/samples/code_samples.bzl | 2 +- ortools/linear_solver/wrappers/BUILD.bazel | 2 ++ ortools/lp_data/BUILD.bazel | 2 ++ ortools/packing/BUILD.bazel | 2 ++ ortools/pdlp/BUILD.bazel | 1 + ortools/port/BUILD.bazel | 2 ++ ortools/third_party_solvers/BUILD.bazel | 2 ++ 20 files changed, 38 insertions(+), 4 deletions(-) diff --git a/examples/cpp/BUILD.bazel b/examples/cpp/BUILD.bazel index a31911a537..486f4cf808 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 ce96a8c9f3..e8e70672ef 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 4de134e499..1868692c24 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 e909a7dba8..bdc2e395ab 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 9852646883..d2f0d85b53 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 b4b57a8263..e23aef60c5 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 15828c7270..2d51f51363 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 07070d46d5..5669746ce4 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 cabab7cc8b..1604eb599a 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 c3f0cc4290..a40ae9ace7 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 05f5288fab..188af3bce3 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 a6aad6ec73..7c0ffde3e5 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 e7047ebc6f..33b4fa4c91 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 dbbd25a030..41be2f3cd0 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 2695ff282e..e6725e6542 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 619de54c9a..b7723281a6 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/packing/BUILD.bazel b/ortools/packing/BUILD.bazel index 405f0e7a78..982ba5a0f6 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 04dbb9ba9c..dcef03144e 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 20219982d7..6c5639dee5 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/third_party_solvers/BUILD.bazel b/ortools/third_party_solvers/BUILD.bazel index 7b2ee8fefb..a7eb2776a6 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(