[llvm] 80544d1 - [gn build] (manually) port ccf1469a4cdb (lldbVersion)
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 8 16:47:54 PST 2021
Author: Nico Weber
Date: 2021-12-08T19:47:45-05:00
New Revision: 80544d1b4cf2cc1c3a739a1580518bd384e24645
URL: https://github.com/llvm/llvm-project/commit/80544d1b4cf2cc1c3a739a1580518bd384e24645
DIFF: https://github.com/llvm/llvm-project/commit/80544d1b4cf2cc1c3a739a1580518bd384e24645.diff
LOG: [gn build] (manually) port ccf1469a4cdb (lldbVersion)
Added:
llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn
llvm/utils/gn/secondary/lldb/source/Version/BUILD.gn
Modified:
llvm/utils/gn/secondary/lldb/source/API/BUILD.gn
llvm/utils/gn/secondary/lldb/source/Commands/BUILD.gn
llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn
llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn
Removed:
llvm/utils/gn/secondary/lldb/source/BUILD.gn
################################################################################
diff --git a/llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn b/llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn
new file mode 100644
index 0000000000000..43987b3712623
--- /dev/null
+++ b/llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn
@@ -0,0 +1,15 @@
+import("//llvm/utils/gn/build/write_cmake_config.gni")
+import("//llvm/version.gni")
+
+# Configure the Version.inc file.
+write_cmake_config("version") {
+ input = "Version.inc.in"
+ output = "$target_gen_dir/Version.inc"
+ values = [
+ "LLDB_VERSION=$llvm_version",
+ "LLDB_VERSION_MAJOR=$llvm_version_major",
+ "LLDB_VERSION_MINOR=$llvm_version_minor",
+ "LLDB_VERSION_PATCHLEVEL=$llvm_version_patch",
+ "LLDB_FULL_VERSION_STRING=",
+ ]
+}
diff --git a/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn
index f3911f0e4fab6..a8be280bc9b50 100644
--- a/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn
@@ -9,7 +9,6 @@ static_library("liblldb") {
configs += [ "//llvm/utils/gn/build:lldb_code" ]
deps = [
"//lldb/include/lldb/Host:Config",
- "//lldb/source:lldbBase",
"//lldb/source/Breakpoint",
"//lldb/source/Core",
"//lldb/source/DataFormatters",
@@ -21,6 +20,7 @@ static_library("liblldb") {
"//lldb/source/Symbol",
"//lldb/source/Target",
"//lldb/source/Utility",
+ "//lldb/source/Version",
"//lldb/tools/argdumper:lldb-argdumper",
"//llvm/lib/Support",
]
diff --git a/llvm/utils/gn/secondary/lldb/source/Commands/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Commands/BUILD.gn
index 72c63128460e6..8d1d12f444064 100644
--- a/llvm/utils/gn/secondary/lldb/source/Commands/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Commands/BUILD.gn
@@ -10,7 +10,6 @@ static_library("Commands") {
configs += [ "//llvm/utils/gn/build:lldb_code" ]
deps = [
":CommandOptions",
- "//lldb/source:lldbBase",
"//llvm/lib/Support",
#"//lldb/source/Breakpoint", # FIXME: many-hop dependency cycle.
@@ -24,6 +23,7 @@ static_library("Commands") {
#"//lldb/source/Symbol", # FIXME: many-hop dependency cycle.
#"//lldb/source/Target", # FIXME: 2-hop dependency cycle.
"//lldb/source/Utility",
+ "//lldb/source/Version",
]
sources = [
"CommandCompletions.cpp",
diff --git a/llvm/utils/gn/secondary/lldb/source/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Version/BUILD.gn
similarity index 60%
rename from llvm/utils/gn/secondary/lldb/source/BUILD.gn
rename to llvm/utils/gn/secondary/lldb/source/Version/BUILD.gn
index 965e5756790a4..31a1009dd6dcc 100644
--- a/llvm/utils/gn/secondary/lldb/source/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Version/BUILD.gn
@@ -1,5 +1,6 @@
import("//llvm/utils/gn/build/write_vcsrevision.gni")
+# Configure the VCSVersion.inc file
config("write_vcsrevision_config") {
# To pick up the generated inc file.
include_dirs = [ target_gen_dir ]
@@ -7,24 +8,25 @@ config("write_vcsrevision_config") {
}
write_vcsrevision("write_vcsversion") {
- visibility = [ ":lldbBase" ]
+ visibility = [ ":Version" ]
header = "$target_gen_dir/VCSVersion.inc"
names = [ "LLDB" ]
public_configs = [ ":write_vcsrevision_config" ]
}
-static_library("lldbBase") {
+
+static_library("Version") {
+ output_name = "lldbVersion"
configs += [
"//llvm/utils/gn/build:lldb_code",
# To pick up clang/Basic/Version.h.
"//llvm/utils/gn/build:clang_code",
]
- sources = [ "lldb.cpp" ]
- deps = [
- ":write_vcsversion",
- "//clang/lib/Basic",
+ sources = [ "Version.cpp" ]
+ public_deps = [
+ # public_dep because public header Version.h includes generated Version.inc.
+ "//lldb/include/lldb/Version:version",
]
-
- # XXX define LLDB_VERSION_STRING
+ deps = [ ":write_vcsversion" ]
}
diff --git a/llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn b/llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn
index b5b3f65515d19..8706cf1eb738c 100644
--- a/llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn
@@ -15,10 +15,10 @@ executable("lldb-server") {
":LLGSOptions",
#"//lldb/include/lldb/Host:Config",
- "//lldb/source:lldbBase",
"//lldb/source/Host",
"//lldb/source/Initialization",
"//lldb/source/Plugins/Instruction/ARM",
+ "//lldb/source/Version",
#"//lldb/source/Plugins/Instruction/MIPS", # XXX
#"//lldb/source/Plugins/Instruction/MIPS64", # XXX
diff --git a/llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn b/llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn
index ea2ed501ec7a6..96beba140581a 100644
--- a/llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn
@@ -4,7 +4,6 @@ executable("lldb-test") {
"//llvm/utils/gn/build:lldb_code",
]
deps = [
- "//lldb/source:lldbBase",
"//lldb/source/Breakpoint",
"//lldb/source/Core",
"//lldb/source/DataFormatters",
@@ -16,6 +15,7 @@ executable("lldb-test") {
"//lldb/source/Symbol",
"//lldb/source/Target",
"//lldb/source/Utility",
+ "//lldb/source/Version",
"//llvm/lib/Support",
]
More information about the llvm-commits
mailing list