Skip to content

Commit 7ac6f1c

Browse files
committed
feat(//:libtrtorch): Ship a WORKSPACE file and BUILD file with the
tarball so that users can just load it as an HTTP archive Signed-off-by: Naren Dasan <naren@narendasan.com> Signed-off-by: Naren Dasan <narens@nvidia.com>
1 parent f0523f1 commit 7ac6f1c

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

BUILD

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ pkg_tar(
6565
name = "libtrtorch",
6666
srcs = [
6767
"//:LICENSE",
68+
"//bzl_def:BUILD.bzl",
69+
"//bzl_def:WORKSPACE"
6870
],
6971
extension = "tar.gz",
7072
package_dir = "trtorch",

bzl_def/BUILD

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
exports_files([
4+
"WORKSPACE",
5+
"BUILD.bzl"
6+
])

bzl_def/BUILD.bzl

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
config_setting(
4+
name = "aarch64_linux",
5+
constraint_values = [
6+
"@platforms//cpu:aarch64",
7+
"@platforms//os:linux",
8+
],
9+
)
10+
11+
config_setting(
12+
name = "windows",
13+
constraint_values = [
14+
"@platforms//os:windows",
15+
],
16+
)
17+
18+
cc_library(
19+
name = "libtrtorch",
20+
srcs = select({
21+
":windows": [
22+
"lib/x64/trtorch.dll",
23+
],
24+
"//conditions:default": [
25+
"lib/libtrtorch.so",
26+
],
27+
}),
28+
hdrs = glob([
29+
"include/**/*.h",
30+
]),
31+
strip_include_prefix = "include",
32+
includes = ["include/"]
33+
)
34+
35+
cc_library(
36+
name = "libtrtorchrt",
37+
srcs = select({
38+
":windows": [
39+
"lib/x64/trtorchrt.dll"
40+
],
41+
"//conditions:default": [
42+
"lib/libtrtorchrt.so"
43+
]
44+
})
45+
)
46+
47+
cc_library(
48+
name = "libtrtorch_plugins",
49+
srcs = select({
50+
":windows": [
51+
"lib/x64/trtorch_plugins.dll"
52+
],
53+
"//conditions:default": [
54+
"lib/libtrtorch_plugins.so"
55+
]
56+
}),
57+
hdrs = glob([
58+
"include/trtorch/core/plugins/**/*.h",
59+
]),
60+
strip_include_prefix = "include",
61+
includes = ["include/"]
62+
)
63+
64+
cc_library(
65+
name = "trtorch_core_hdrs",
66+
hdrs = glob([
67+
"include/trtorch/core/**/*.h"
68+
]),
69+
strip_include_prefix = "include",
70+
includes = ["include/trtorch/"]
71+
)
72+
73+
# Alias for ease of use
74+
cc_library(
75+
name = "trtorch",
76+
deps = [
77+
":libtrtorch",
78+
]
79+
)

bzl_def/WORKSPACE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
workspace(name = "trtorch")

0 commit comments

Comments
 (0)