-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathextensions.bzl
More file actions
33 lines (28 loc) · 890 Bytes
/
extensions.bzl
File metadata and controls
33 lines (28 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
load("//:fetch_ispc.bzl", "fetch_ispc")
def _ispc_impl(module_ctx):
version = "1.22.0" # Default version
# Extract version from download tags
found_proper_version = False
for module in module_ctx.modules:
for download_tag in module.tags.download:
version = download_tag.version
print("Fetching ISPC version: {}".format(version))
found_proper_version = True
break
if found_proper_version:
break
fetch_ispc(version = version)
_download = tag_class(
attrs = {
"version": attr.string(
doc = "ISPC version to download (e.g., '1.22.0' or '1.23.0'). Defaults to '1.22.0' for backward compatibility.",
default = "1.22.0",
),
},
)
ispc = module_extension(
implementation = _ispc_impl,
tag_classes = {
"download": _download,
},
)