[llvm] aaa50e5 - [gn build] port b2a162e63bd73 (liblldb.dll)
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 19 07:50:15 PST 2022
Author: Nico Weber
Date: 2022-01-19T10:50:08-05:00
New Revision: aaa50e54e60fd6c455361f009fe4318bc267038b
URL: https://github.com/llvm/llvm-project/commit/aaa50e54e60fd6c455361f009fe4318bc267038b
DIFF: https://github.com/llvm/llvm-project/commit/aaa50e54e60fd6c455361f009fe4318bc267038b.diff
LOG: [gn build] port b2a162e63bd73 (liblldb.dll)
This requires making liblldb a dll on Windows.
Things still work with a static lib on non-Windows, so keep it a
static lib there for now.
Added:
Modified:
llvm/utils/gn/secondary/lldb/source/API/BUILD.gn
llvm/utils/gn/secondary/lldb/tools/driver/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn
index a8be280bc9b50..3a73ac937dec2 100644
--- a/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn
@@ -1,6 +1,16 @@
-static_library("liblldb") {
- # XXX if win -DEXPORT_LIBLLDB
+# The LLDB_IN_LIBLLDB setup requires that liblldb is a shared_library
+# on Windows.
+# FIXME: Consider making it a shared_library everywhere like in cmake?
+# (Having it a static_library is simpler -- no need for
+# -Wl,-runpath=$ORIGIN/../lib in executables on unix or the corresponding @loader_path on mac,
+# no need for .exports files, etc.)
+if (current_os == "win") {
+ liblldb_type = "shared_library"
+} else {
+ liblldb_type = "static_library"
+}
+target(liblldb_type, "liblldb") {
# XXX LLDB_BUILD_FRAMEWORK
# XXX LLDB_ENABLE_PYTHON
# XXX LLDB_ENABLE_LUA
@@ -100,6 +110,10 @@ static_library("liblldb") {
"SystemInitializerFull.cpp",
]
+ if (current_os == "win") {
+ defines = [ "LLDB_IN_LIBLLDB" ]
+ }
+
# XXX liblldb.exports or liblldb-private.expoorts
# XXX dep on clang resource directory
}
diff --git a/llvm/utils/gn/secondary/lldb/tools/driver/BUILD.gn b/llvm/utils/gn/secondary/lldb/tools/driver/BUILD.gn
index 4883af4fa4150..4eea24640c0c9 100644
--- a/llvm/utils/gn/secondary/lldb/tools/driver/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/tools/driver/BUILD.gn
@@ -47,6 +47,5 @@ executable("lldb") {
"Platform.cpp",
]
- # XXX if win -DIMPORT_LIBLLDB
# XXX LLDB_BUILD_FRAMEWORK rpath stuff
}
More information about the llvm-commits
mailing list