Files
pytorch/tools/bazel.bzl
mikey dagitses f4200600e4 move Bazel version header generation to shared build structure (#75332)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75332

ghstack-source-id: 154678044

Test Plan: Rely on OSS CI.

Reviewed By: malfet

Differential Revision: D35434229

fbshipit-source-id: 7cdd33fa32d0c485f44477e414c24c9bc4b74963
(cherry picked from commit 60285c613e8703c52f36f0bf1178e35c04574ffa)
2022-04-25 17:51:30 +00:00

32 lines
1.1 KiB
Python

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("@rules_cuda//cuda:defs.bzl", "requires_cuda_enabled")
load("//c10/macros:cmake_configure_file.bzl", "cmake_configure_file")
load("//tools/config:defs.bzl", "if_cuda")
def _py_library(name, **kwds):
deps = [dep for dep in kwds.pop("deps", []) if dep != None]
native.py_library(name = name, deps = deps, **kwds)
def _requirement(_pypi_project):
return None
# Rules implementation for the Bazel build system. Since the common
# build structure aims to replicate Bazel as much as possible, most of
# the rules simply forward to the Bazel definitions.
rules = struct(
cc_binary = cc_binary,
cc_library = cc_library,
cc_test = cc_test,
cmake_configure_file = cmake_configure_file,
filegroup = native.filegroup,
genrule = native.genrule,
glob = native.glob,
if_cuda = if_cuda,
py_binary = native.py_binary,
py_library = _py_library,
requirement = _requirement,
requires_cuda_enabled = requires_cuda_enabled,
select = select,
test_suite = native.test_suite,
)