diff options
author | Keith Smiley <keithbsmiley@gmail.com> | 2024-06-24 14:43:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-24 14:43:05 -0700 |
commit | a030c8bc87be0599e861f5d8fe8254ac8d6e84ba (patch) | |
tree | 75cd0ed8a184ca2c7ddb750d3b63c712e14a93c5 | |
parent | dd8d978b7642b410f3a4895aa20f0aada4a0f7e4 (diff) | |
download | llvm-a030c8bc87be0599e861f5d8fe8254ac8d6e84ba.zip llvm-a030c8bc87be0599e861f5d8fe8254ac8d6e84ba.tar.gz llvm-a030c8bc87be0599e861f5d8fe8254ac8d6e84ba.tar.bz2 |
[bazel] Add support for building lldb-dap (#96556)
-rw-r--r-- | utils/bazel/llvm-project-overlay/lldb/tools/lldb-dap/BUILD.bazel | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/utils/bazel/llvm-project-overlay/lldb/tools/lldb-dap/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/tools/lldb-dap/BUILD.bazel new file mode 100644 index 0000000..6d3f190 --- /dev/null +++ b/utils/bazel/llvm-project-overlay/lldb/tools/lldb-dap/BUILD.bazel @@ -0,0 +1,62 @@ +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("//:vars.bzl", "PACKAGE_VERSION") +load("//mlir:tblgen.bzl", "gentbl_cc_library") + +package( + default_visibility = ["//visibility:public"], + features = ["layering_check"], +) + +licenses(["notice"]) + +expand_template( + name = "plist", + out = "lldb-dap-Info.plist", + substitutions = { + "${LLDB_VERSION}": PACKAGE_VERSION, + }, + template = "lldb-dap-Info.plist.in", +) + +gentbl_cc_library( + name = "lldb_dap_opts_gen", + strip_include_prefix = ".", + tbl_outs = [( + ["-gen-opt-parser-defs"], + "Options.inc", + )], + tblgen = "//llvm:llvm-tblgen", + td_file = "Options.td", + deps = ["//llvm:OptParserTdFiles"], +) + +cc_binary( + name = "lldb-dap", + srcs = glob([ + "*.cpp", + "*.h", + ]), + additional_linker_inputs = [ + ":plist", + ], + linkopts = select({ + "@platforms//os:macos": [ + "-Wl,-sectcreate,__TEXT,__info_plist,$(location :plist)", + ], + "//conditions:default": [], + }), + deps = [ + ":lldb_dap_opts_gen", + "//lldb:APIHeaders", + "//lldb:Headers", + "//lldb:Host", + "//lldb:liblldb.wrapper", + "//llvm:Option", + "//llvm:Support", + "//llvm:config", + ], +) |