[llvm] [bazel] Move lldb-dap cc_binary to lldb/BUILD.bazel (PR #105733)
Keith Smiley via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 22 14:25:43 PDT 2024
https://github.com/keith created https://github.com/llvm/llvm-project/pull/105733
On linux lldb-dap uses the location of the lldb-dap binary to search for
lldb-server. Previously these were produced in different directories
corresponding to the BUILD file paths. It's not ideal that the BUILD
file location matters for the binary at runtime but it doesn't hurt to
have this tool here too like the others.
>From 2d7e98b21e55c623e8415c9df0eb74b452f898d1 Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Thu, 22 Aug 2024 21:20:47 +0000
Subject: [PATCH] [bazel] Move lldb-dap cc_binary to lldb/BUILD.bazel
On linux lldb-dap uses the location of the lldb-dap binary to search for
lldb-server. Previously these were produced in different directories
corresponding to the BUILD file paths. It's not ideal that the BUILD
file location matters for the binary at runtime but it doesn't hurt to
have this tool here too like the others.
---
.../llvm-project-overlay/lldb/BUILD.bazel | 48 ++++++++++++++
.../lldb/tools/lldb-dap/BUILD.bazel | 62 -------------------
2 files changed, 48 insertions(+), 62 deletions(-)
delete mode 100644 utils/bazel/llvm-project-overlay/lldb/tools/lldb-dap/BUILD.bazel
diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
index ee7ea7458b4488..3ed4f552290da4 100644
--- a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
@@ -1015,3 +1015,51 @@ cc_binary(
"//conditions:default": [],
}),
)
+
+expand_template(
+ name = "lldb-dap-plist",
+ out = "lldb-dap-Info.plist",
+ substitutions = {
+ "${LLDB_VERSION}": PACKAGE_VERSION,
+ },
+ template = "tools/lldb-dap/lldb-dap-Info.plist.in",
+)
+
+gentbl_cc_library(
+ name = "lldb_dap_opts_gen",
+ strip_include_prefix = "tools/lldb-dap",
+ tbl_outs = [(
+ ["-gen-opt-parser-defs"],
+ "tools/lldb-dap/Options.inc",
+ )],
+ tblgen = "//llvm:llvm-tblgen",
+ td_file = "tools/lldb-dap/Options.td",
+ deps = ["//llvm:OptParserTdFiles"],
+)
+
+cc_binary(
+ name = "lldb-dap",
+ srcs = glob([
+ "tools/lldb-dap/*.cpp",
+ "tools/lldb-dap/*.h",
+ ]),
+ additional_linker_inputs = [
+ ":lldb-dap-plist",
+ ],
+ linkopts = select({
+ "@platforms//os:macos": [
+ "-Wl,-sectcreate,__TEXT,__info_plist,$(location :lldb-dap-plist)",
+ ],
+ "//conditions:default": [],
+ }),
+ deps = [
+ ":lldb_dap_opts_gen",
+ "//lldb:APIHeaders",
+ "//lldb:Headers",
+ "//lldb:Host",
+ "//lldb:liblldb.wrapper",
+ "//llvm:Option",
+ "//llvm:Support",
+ "//llvm:config",
+ ],
+)
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
deleted file mode 100644
index 6d3f19098fb452..00000000000000
--- a/utils/bazel/llvm-project-overlay/lldb/tools/lldb-dap/BUILD.bazel
+++ /dev/null
@@ -1,62 +0,0 @@
-# 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",
- ],
-)
More information about the llvm-commits
mailing list