Skip to content

Commit 5cfbeec

Browse files
keithIasonaskrpr
authored andcommitted
[bazel] Use lld's Version.inc.in file (llvm#220342)
Just in case this ever changes it will fail more obviously. This is the same value cmake uses for the version so I think the TODO was outdated.
1 parent 150cbd4 commit 5cfbeec

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

utils/bazel/llvm-project-overlay/lld/BUILD.bazel

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5+
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
56
load("@bazel_skylib//rules:write_file.bzl", "write_file")
67
load("@rules_cc//cc:defs.bzl", "cc_library")
78
load(
@@ -19,13 +20,11 @@ package(
1920

2021
licenses(["notice"])
2122

22-
# TODO: Actually compute version info
23-
write_file(
23+
expand_template(
2424
name = "config_version_gen",
2525
out = "include/lld/Common/Version.inc",
26-
content = [
27-
"#define LLD_VERSION_STRING \"{}\"".format(LLVM_VERSION),
28-
],
26+
substitutions = {"@LLD_VERSION@": LLVM_VERSION},
27+
template = "include/lld/Common/Version.inc.in",
2928
)
3029

3130
write_file(

0 commit comments

Comments
 (0)