Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is enough to get the lit-based tests to pass on macOS. Doesn't yet add build targets for: - Any LLDB unit tests - swig bindings - various targets not needed by lit tests LLDB has many dependency cycles, something GN doesn't allow. For that reason, I've omitted some dependency edges. Hopefully we can clean up the cycles one day. LLDB has a public/private header distinction, but mostly ignores it. Many libraries include private headers from other modules. Since LLDB is the first target the LLVM/GN build that uses Objective-C++ code, add some machinery to the toolchain file to handle that. Differential Revision: https://reviews.llvm.org/D109185
- Loading branch information
Showing
81 changed files
with
2,899 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import("//llvm/utils/gn/build/libs/xml/enable.gni") | ||
import("//llvm/utils/gn/build/write_cmake_config.gni") | ||
import("libedit.gni") | ||
|
||
# In lldb/cmake/modules/LLDBGenerateConfig.cmake, | ||
# brought in by lldb/cmake/modules/LLDBConfig.cmake, | ||
# brought in by lldb/CMakeLists.txt in the CMake build. | ||
write_cmake_config("Config") { | ||
input = "Config.h.cmake" | ||
output = "$target_gen_dir/Config.h" | ||
values = [ | ||
# FIXME: Actual values for everything. | ||
"LLDB_EDITLINE_USE_WCHAR=", | ||
"LLDB_HAVE_EL_RFUNC_T=", | ||
"HAVE_PPOLL=", | ||
"HAVE_PTSNAME_R=", | ||
"HAVE_PROCESS_VM_READV=", | ||
"HAVE_NR_PROCESS_VM_READV=", | ||
"LLDB_ENABLE_LZMA=", | ||
"LLDB_ENABLE_CURSES=", | ||
"CURSES_HAVE_NCURSES_CURSES_H=", | ||
"LLDB_ENABLE_LUA=", | ||
"LLDB_ENABLE_PYTHON=", | ||
"LLDB_EMBED_PYTHON_HOME=", | ||
|
||
"LLDB_PYTHON_HOME=", | ||
|
||
"LLVM_LIBDIR_SUFFIX=", | ||
|
||
"HAVE_LIBCOMPRESSION=", | ||
] | ||
|
||
if (lldb_enable_libedit) { | ||
values += [ "LLDB_ENABLE_LIBEDIT=1" ] | ||
} else { | ||
values += [ "LLDB_ENABLE_LIBEDIT=" ] | ||
} | ||
|
||
if (llvm_enable_libxml2) { | ||
values += [ "LLDB_ENABLE_LIBXML2=1" ] | ||
} else { | ||
values += [ "LLDB_ENABLE_LIBXML2=" ] | ||
} | ||
|
||
if (current_os == "win") { | ||
values += [ | ||
"HAVE_SYS_EVENT_H=", | ||
"LLDB_ENABLE_POSIX=", | ||
"LLDB_ENABLE_TERMIOS=", | ||
] | ||
} else { | ||
values += [ | ||
"HAVE_SYS_EVENT_H=1", | ||
"LLDB_ENABLE_POSIX=1", | ||
"LLDB_ENABLE_TERMIOS=1", | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
declare_args() { | ||
# Whether lldb links against libedit. Set to `true` or `false`, or to | ||
# `"default"` to get the platform default. | ||
lldb_enable_libedit = "default" | ||
} | ||
|
||
if (lldb_enable_libedit == "default") { | ||
lldb_enable_libedit = current_os == "mac" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
static_library("liblldb") { | ||
# XXX if win -DEXPORT_LIBLLDB | ||
|
||
# XXX LLDB_BUILD_FRAMEWORK | ||
# XXX LLDB_ENABLE_PYTHON | ||
# XXX LLDB_ENABLE_LUA | ||
|
||
output_name = "liblldb" # XXX lib prefix? | ||
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", | ||
"//lldb/source/Expression", | ||
"//lldb/source/Host", | ||
"//lldb/source/Initialization", | ||
"//lldb/source/Interpreter", | ||
"//lldb/source/Plugins:LldbAllPlugins", | ||
"//lldb/source/Symbol", | ||
"//lldb/source/Target", | ||
"//lldb/source/Utility", | ||
"//lldb/tools/argdumper:lldb-argdumper", | ||
"//llvm/lib/Support", | ||
] | ||
|
||
# SBTarget.cpp includes Commands-internal header Commands/CommandObjectBreakpoint.h | ||
include_dirs = [ ".." ] | ||
sources = [ | ||
"SBAddress.cpp", | ||
"SBAttachInfo.cpp", | ||
"SBBlock.cpp", | ||
"SBBreakpoint.cpp", | ||
"SBBreakpointLocation.cpp", | ||
"SBBreakpointName.cpp", | ||
"SBBreakpointOptionCommon.cpp", | ||
"SBBroadcaster.cpp", | ||
"SBCommandInterpreter.cpp", | ||
"SBCommandInterpreterRunOptions.cpp", | ||
"SBCommandReturnObject.cpp", | ||
"SBCommunication.cpp", | ||
"SBCompileUnit.cpp", | ||
"SBData.cpp", | ||
"SBDebugger.cpp", | ||
"SBDeclaration.cpp", | ||
"SBEnvironment.cpp", | ||
"SBError.cpp", | ||
"SBEvent.cpp", | ||
"SBExecutionContext.cpp", | ||
"SBExpressionOptions.cpp", | ||
"SBFile.cpp", | ||
"SBFileSpec.cpp", | ||
"SBFileSpecList.cpp", | ||
"SBFrame.cpp", | ||
"SBFunction.cpp", | ||
"SBHostOS.cpp", | ||
"SBInstruction.cpp", | ||
"SBInstructionList.cpp", | ||
"SBLanguageRuntime.cpp", | ||
"SBLaunchInfo.cpp", | ||
"SBLineEntry.cpp", | ||
"SBListener.cpp", | ||
"SBMemoryRegionInfo.cpp", | ||
"SBMemoryRegionInfoList.cpp", | ||
"SBModule.cpp", | ||
"SBModuleSpec.cpp", | ||
"SBPlatform.cpp", | ||
"SBProcess.cpp", | ||
"SBProcessInfo.cpp", | ||
"SBQueue.cpp", | ||
"SBQueueItem.cpp", | ||
"SBReproducer.cpp", | ||
"SBSection.cpp", | ||
"SBSourceManager.cpp", | ||
"SBStream.cpp", | ||
"SBStringList.cpp", | ||
"SBStructuredData.cpp", | ||
"SBSymbol.cpp", | ||
"SBSymbolContext.cpp", | ||
"SBSymbolContextList.cpp", | ||
"SBTarget.cpp", | ||
"SBThread.cpp", | ||
"SBThreadCollection.cpp", | ||
"SBThreadPlan.cpp", | ||
"SBTrace.cpp", | ||
"SBType.cpp", | ||
"SBTypeCategory.cpp", | ||
"SBTypeEnumMember.cpp", | ||
"SBTypeFilter.cpp", | ||
"SBTypeFormat.cpp", | ||
"SBTypeNameSpecifier.cpp", | ||
"SBTypeSummary.cpp", | ||
"SBTypeSynthetic.cpp", | ||
"SBUnixSignals.cpp", | ||
"SBValue.cpp", | ||
"SBValueList.cpp", | ||
"SBVariablesOptions.cpp", | ||
"SBWatchpoint.cpp", | ||
"SystemInitializerFull.cpp", | ||
] | ||
|
||
# XXX liblldb.exports or liblldb-private.expoorts | ||
# XXX dep on clang resource directory | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 = [ ":lldbBase" ] | ||
header = "$target_gen_dir/VCSVersion.inc" | ||
names = [ "LLDB" ] | ||
public_configs = [ ":write_vcsrevision_config" ] | ||
} | ||
|
||
static_library("lldbBase") { | ||
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", | ||
] | ||
|
||
# XXX define LLDB_VERSION_STRING | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
static_library("Breakpoint") { | ||
output_name = "lldbBreakpoint" | ||
configs += [ "//llvm/utils/gn/build:lldb_code" ] | ||
deps = [ | ||
"//lldb/include/lldb/Host:Config", | ||
"//lldb/source/Core", | ||
"//lldb/source/Expression", | ||
"//lldb/source/Interpreter", | ||
"//lldb/source/Symbol", | ||
"//lldb/source/Target", | ||
"//lldb/source/Utility", | ||
"//llvm/lib/Support", | ||
] | ||
sources = [ | ||
"Breakpoint.cpp", | ||
"BreakpointID.cpp", | ||
"BreakpointIDList.cpp", | ||
"BreakpointList.cpp", | ||
"BreakpointLocation.cpp", | ||
"BreakpointLocationCollection.cpp", | ||
"BreakpointLocationList.cpp", | ||
"BreakpointName.cpp", | ||
"BreakpointOptions.cpp", | ||
"BreakpointPrecondition.cpp", | ||
"BreakpointResolver.cpp", | ||
"BreakpointResolverAddress.cpp", | ||
"BreakpointResolverFileLine.cpp", | ||
"BreakpointResolverFileRegex.cpp", | ||
"BreakpointResolverName.cpp", | ||
"BreakpointResolverScripted.cpp", | ||
"BreakpointSite.cpp", | ||
"BreakpointSiteList.cpp", | ||
"Stoppoint.cpp", | ||
"StoppointCallbackContext.cpp", | ||
"StoppointSite.cpp", | ||
"Watchpoint.cpp", | ||
"WatchpointList.cpp", | ||
"WatchpointOptions.cpp", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import("//lldb/utils/TableGen/lldb_tablegen.gni") | ||
|
||
lldb_tablegen("CommandOptions") { | ||
args = [ "-gen-lldb-option-defs" ] | ||
td_file = "Options.td" # FIXME: rename? | ||
} | ||
|
||
static_library("Commands") { | ||
output_name = "lldbCommands" | ||
configs += [ "//llvm/utils/gn/build:lldb_code" ] | ||
deps = [ | ||
":CommandOptions", | ||
"//lldb/source:lldbBase", | ||
"//llvm/lib/Support", | ||
|
||
#"//lldb/source/Breakpoint", # FIXME: many-hop dependency cycle. | ||
"//lldb/source/Core", | ||
"//lldb/source/DataFormatters", | ||
|
||
#"//lldb/source/Expression", # FIXME: 2-hop dependency cycle. | ||
"//lldb/source/Host", | ||
|
||
#"//lldb/source/Interpreter", # FIXME: Dependency cycle. | ||
#"//lldb/source/Symbol", # FIXME: many-hop dependency cycle. | ||
#"//lldb/source/Target", # FIXME: 2-hop dependency cycle. | ||
"//lldb/source/Utility", | ||
] | ||
sources = [ | ||
"CommandCompletions.cpp", | ||
"CommandObjectApropos.cpp", | ||
"CommandObjectBreakpoint.cpp", | ||
"CommandObjectBreakpointCommand.cpp", | ||
"CommandObjectCommands.cpp", | ||
"CommandObjectDisassemble.cpp", | ||
"CommandObjectExpression.cpp", | ||
"CommandObjectFrame.cpp", | ||
"CommandObjectGUI.cpp", | ||
"CommandObjectHelp.cpp", | ||
"CommandObjectLanguage.cpp", | ||
"CommandObjectLog.cpp", | ||
"CommandObjectMemory.cpp", | ||
"CommandObjectMemoryTag.cpp", | ||
"CommandObjectMultiword.cpp", | ||
"CommandObjectPlatform.cpp", | ||
"CommandObjectPlugin.cpp", | ||
"CommandObjectProcess.cpp", | ||
"CommandObjectQuit.cpp", | ||
"CommandObjectRegexCommand.cpp", | ||
"CommandObjectRegister.cpp", | ||
"CommandObjectReproducer.cpp", | ||
"CommandObjectScript.cpp", | ||
"CommandObjectSession.cpp", | ||
"CommandObjectSettings.cpp", | ||
"CommandObjectSource.cpp", | ||
"CommandObjectStats.cpp", | ||
"CommandObjectTarget.cpp", | ||
"CommandObjectThread.cpp", | ||
"CommandObjectThreadUtil.cpp", | ||
"CommandObjectTrace.cpp", | ||
"CommandObjectType.cpp", | ||
"CommandObjectVersion.cpp", | ||
"CommandObjectWatchpoint.cpp", | ||
"CommandObjectWatchpointCommand.cpp", | ||
"CommandOptionsProcessLaunch.cpp", | ||
] | ||
} |
Oops, something went wrong.