[bazel] Build mcp server for lldb (#178437)

This commit is contained in:
Haojian Wu 2026-02-04 15:06:08 +01:00 committed by GitHub
parent cc2b48f1e4
commit aa7faec962
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 39 additions and 0 deletions

View File

@ -138,6 +138,7 @@ expand_template(
# Defaults that could be configurable if needed
"#cmakedefine01 LLDB_ENABLE_POSIX": "#define LLDB_ENABLE_POSIX 1",
"#cmakedefine01 LLDB_ENABLE_PROTOCOL_SERVERS": "#define LLDB_ENABLE_PROTOCOL_SERVERS 1",
"#cmakedefine LLDB_GLOBAL_INIT_DIRECTORY R\"(${LLDB_GLOBAL_INIT_DIRECTORY})\"": "#define LLDB_GLOBAL_INIT_DIRECTORY \"\"",
"${LLDB_INSTALL_LIBDIR_BASENAME}": "lib",
"${LLDB_BUG_REPORT_URL}": "",
@ -757,6 +758,27 @@ cc_library(
includes = ["include"],
)
cc_library(
name = "ProtocolHeaders",
hdrs = glob(["include/lldb/Protocol/**/*.h"]),
includes = ["include"],
deps = [
":Headers",
"//llvm:Telemetry",
],
)
cc_library(
name = "ProtocolMCP",
srcs = glob(["source/Protocol/MCP/*.cpp"]),
deps = [
":Host",
":ProtocolHeaders",
":Utility",
"//llvm:Support",
],
)
cc_library(
name = "Utility",
srcs = glob(["source/Utility/**/*.cpp"]),

View File

@ -136,6 +136,22 @@ cc_library(
],
)
cc_library(
name = "PluginProtocolServerMCP",
srcs = glob(["Protocol/MCP/*.cpp"]),
hdrs = glob(["Protocol/MCP/*.h"]),
deps = [
"//lldb:CoreHeaders",
"//lldb:Headers",
"//lldb:Host",
"//lldb:InterpreterHeaders",
"//lldb:ProtocolHeaders",
"//lldb:ProtocolMCP",
"//lldb:Utility",
"//llvm:Support",
],
)
cc_library(
name = "PluginTypeSystemClang",
srcs = glob(["TypeSystem/Clang/*.cpp"]),

View File

@ -71,6 +71,7 @@ DEFAULT_PLUGINS = [
"ProcessElfCore",
"ProcessMachCore",
"ProcessMinidump",
"ProtocolServerMCP",
"RegisterTypeBuilderClang",
"ScriptedProcess",
"StructuredDataDarwinLog",