mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
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)
This commit is contained in:
committed by
PyTorch MergeBot
parent
111b2bf9da
commit
f4200600e4
@ -1617,14 +1617,6 @@ cc_library(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# torch
|
# torch
|
||||||
genrule(
|
|
||||||
name = "version_h",
|
|
||||||
srcs = ["torch/csrc/api/include/torch/version.h.in", "version.txt"],
|
|
||||||
outs = ["torch/csrc/api/include/torch/version.h"],
|
|
||||||
cmd = "$(location //tools/setup_helpers:gen_version_header) --template-path $(location torch/csrc/api/include/torch/version.h.in) --version-path $(location version.txt) --output-path $@",
|
|
||||||
tools = ['//tools/setup_helpers:gen_version_header'],
|
|
||||||
)
|
|
||||||
|
|
||||||
py_binary(
|
py_binary(
|
||||||
name = "stringify_file",
|
name = "stringify_file",
|
||||||
srcs = ["torch/csrc/jit/codegen/cuda/tools/stringify_file.py"],
|
srcs = ["torch/csrc/jit/codegen/cuda/tools/stringify_file.py"],
|
||||||
|
14
build.bzl
14
build.bzl
@ -10,6 +10,7 @@ def define_targets(rules):
|
|||||||
tags = [
|
tags = [
|
||||||
"supermodule:android/default/pytorch",
|
"supermodule:android/default/pytorch",
|
||||||
"supermodule:ios/default/public.pytorch",
|
"supermodule:ios/default/public.pytorch",
|
||||||
|
"xplat",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
@ -19,3 +20,16 @@ def define_targets(rules):
|
|||||||
"//third_party/miniz-2.0.8:miniz",
|
"//third_party/miniz-2.0.8:miniz",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
rules.genrule(
|
||||||
|
name = "version_h",
|
||||||
|
srcs = [
|
||||||
|
":torch/csrc/api/include/torch/version.h.in",
|
||||||
|
":version.txt",
|
||||||
|
],
|
||||||
|
outs = ["torch/csrc/api/include/torch/version.h"],
|
||||||
|
cmd = "$(location //tools/setup_helpers:gen_version_header) " +
|
||||||
|
"--template-path $(location :torch/csrc/api/include/torch/version.h.in) " +
|
||||||
|
"--version-path $(location :version.txt) --output-path $@ ",
|
||||||
|
tools = ["//tools/setup_helpers:gen_version_header"],
|
||||||
|
)
|
||||||
|
@ -19,6 +19,7 @@ rules = struct(
|
|||||||
cc_test = cc_test,
|
cc_test = cc_test,
|
||||||
cmake_configure_file = cmake_configure_file,
|
cmake_configure_file = cmake_configure_file,
|
||||||
filegroup = native.filegroup,
|
filegroup = native.filegroup,
|
||||||
|
genrule = native.genrule,
|
||||||
glob = native.glob,
|
glob = native.glob,
|
||||||
if_cuda = if_cuda,
|
if_cuda = if_cuda,
|
||||||
py_binary = native.py_binary,
|
py_binary = native.py_binary,
|
||||||
|
Reference in New Issue
Block a user