diff --git a/BUILD.bazel b/BUILD.bazel index e1448c65a15..33ff5c103eb 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,10 +3,14 @@ load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library", "cc_test") load("//third_party:substitution.bzl", "header_template_rule") +load("//:tools/bazel.bzl", "rules") load("//:tools/build_variables.bzl", "jit_core_sources", "libtorch_core_sources", "libtorch_cuda_sources", "libtorch_distributed_sources", "libtorch_extra_sources", "libtorch_nvfuser_generated_headers", "libtorch_nvfuser_runtime_sources", "libtorch_python_core_sources", "torch_cpp_srcs", "lazy_tensor_ts_sources") load("//tools/rules:cu.bzl", "cu_library") load("//tools/config:defs.bzl", "if_cuda") load("//:aten.bzl", "intern_build_aten_ops", "generate_aten", "aten_ufunc_generated_cpu_sources", "aten_ufunc_generated_cpu_kernel_sources", "aten_ufunc_generated_cuda_sources") +load(":build.bzl", "define_targets") + +define_targets(rules = rules) COMMON_COPTS = [ "-DHAVE_MALLOC_USABLE_SIZE=1", diff --git a/build.bzl b/build.bzl index 33d6c02b7c1..dcea1a0f112 100644 --- a/build.bzl +++ b/build.bzl @@ -7,10 +7,6 @@ def define_targets(rules): "caffe2/serialize/istream_adapter.cc", "caffe2/serialize/read_adapter_interface.cc", ], - # Flags that end with '()' are converted to a list of strings - # by calling the function when translating in to buck/bazel. - # TODO: find a better way to do this. - copts = ["get_c2_fbandroid_xplat_compiler_flags()", "-frtti"], tags = [ "supermodule:android/default/pytorch", "supermodule:ios/default/public.pytorch", @@ -18,8 +14,8 @@ def define_targets(rules): visibility = ["//visibility:public"], deps = [ ":caffe2_headers", - ":miniz", - "//third-party/glog:glog", - "//xplat/caffe2/c10:c10", + "@com_github_glog//:glog", + "//c10", + "//third_party/miniz-2.0.8:miniz", ], )