[llvm] 5caa121 - [gn build] include revision information in lld --version output
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 16 10:10:48 PST 2020
Author: Nico Weber
Date: 2020-01-16T13:10:41-05:00
New Revision: 5caa1212957456c3bfb4adf3cd3b7308cecc8650
URL: https://github.com/llvm/llvm-project/commit/5caa1212957456c3bfb4adf3cd3b7308cecc8650
DIFF: https://github.com/llvm/llvm-project/commit/5caa1212957456c3bfb4adf3cd3b7308cecc8650.diff
LOG: [gn build] include revision information in lld --version output
Added:
Modified:
llvm/utils/gn/build/write_vcsrevision.gni
llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
llvm/utils/gn/secondary/lld/Common/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/build/write_vcsrevision.gni b/llvm/utils/gn/build/write_vcsrevision.gni
index 9cdf5e3f1574..9ab7d89f8f98 100644
--- a/llvm/utils/gn/build/write_vcsrevision.gni
+++ b/llvm/utils/gn/build/write_vcsrevision.gni
@@ -19,7 +19,7 @@ declare_args() {
template("write_vcsrevision") {
assert(defined(invoker.header), "must set 'header' in $target_name")
- action("write_vcsrevision") {
+ action(target_name) {
script = "//llvm/utils/gn/build/write_vcsrevision.py"
header = invoker.header
if (defined(invoker.names)) {
diff --git a/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
index 4729e2873f4b..6105fd4e2bfb 100644
--- a/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
@@ -6,7 +6,7 @@ config("write_vcsrevision_config") {
visibility = [ ":write_vcsrevision" ]
}
-write_vcsrevision("write_vcsrevision") {
+write_vcsrevision("write_vcsversion") {
visibility = [ ":Basic" ]
header = "$target_gen_dir/VCSVersion.inc"
names = [
@@ -29,7 +29,7 @@ static_library("Basic") {
"//clang/include/clang/Basic:version",
]
deps = [
- ":write_vcsrevision",
+ ":write_vcsversion",
"//clang/include/clang/Basic:AttrHasAttributeImpl",
"//clang/include/clang/Basic:arm_fp16",
"//clang/include/clang/Basic:arm_neon",
diff --git a/llvm/utils/gn/secondary/lld/Common/BUILD.gn b/llvm/utils/gn/secondary/lld/Common/BUILD.gn
index dc1804452fba..02f91cde6745 100644
--- a/llvm/utils/gn/secondary/lld/Common/BUILD.gn
+++ b/llvm/utils/gn/secondary/lld/Common/BUILD.gn
@@ -1,3 +1,18 @@
+import("//llvm/utils/gn/build/write_vcsrevision.gni")
+
+config("write_vcsrevision_config") {
+ # To pick up the generated inc file.
+ include_dirs = [ target_gen_dir ]
+ visibility = [ ":write_vcsrevision" ]
+}
+
+write_vcsrevision("write_vcsversion") {
+ visibility = [ ":Common" ]
+ header = "$target_gen_dir/VCSVersion.inc"
+ names = [ "LLD" ]
+ public_configs = [ ":write_vcsrevision_config" ]
+}
+
static_library("Common") {
output_name = "lldCommon"
configs += [ "//llvm/utils/gn/build:lld_code" ]
@@ -6,6 +21,7 @@ static_library("Common") {
"//lld/include/lld/Common:version",
]
deps = [
+ ":write_vcsversion",
"//llvm/lib/CodeGen",
"//llvm/lib/Demangle",
"//llvm/lib/IR",
@@ -25,8 +41,7 @@ static_library("Common") {
"TargetOptionsCommandFlags.cpp",
"Threads.cpp",
"Timer.cpp",
-
- # FIXME: This should be in its own target that passes -DHAVE_VCS_VERSION_INC
"Version.cpp",
]
+ defines = [ "HAVE_VCS_VERSION_INC" ] # For Version.cpp
}
More information about the llvm-commits
mailing list