diff --git a/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/API/BUILD.gn index a8be280bc9b5..3a73ac937dec 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 4883af4fa415..4eea24640c0c 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 }