| 1 |
# This file is licensed under the Apache License v2.0 with LLVM Exceptions. |
| 2 |
# See https://llvm.org/LICENSE.txt for license information. |
| 3 |
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 |
|
| 5 |
load("@bazel_skylib//rules:expand_template.bzl", "expand_template") |
| 6 |
load("//:vars.bzl", "PACKAGE_VERSION") |
| 7 |
load("//mlir:tblgen.bzl", "gentbl_cc_library") |
| 8 |
|
| 9 |
package( |
| 10 |
default_visibility = ["//visibility:public"], |
| 11 |
features = ["layering_check"], |
| 12 |
) |
| 13 |
|
| 14 |
licenses(["notice"]) |
| 15 |
|
| 16 |
expand_template( |
| 17 |
name = "plist", |
| 18 |
out = "lldb-dap-Info.plist", |
| 19 |
substitutions = { |
| 20 |
"${LLDB_VERSION}": PACKAGE_VERSION, |
| 21 |
}, |
| 22 |
template = "lldb-dap-Info.plist.in", |
| 23 |
) |
| 24 |
|
| 25 |
gentbl_cc_library( |
| 26 |
name = "lldb_dap_opts_gen", |
| 27 |
strip_include_prefix = ".", |
| 28 |
tbl_outs = [( |
| 29 |
["-gen-opt-parser-defs"], |
| 30 |
"Options.inc", |
| 31 |
)], |
| 32 |
tblgen = "//llvm:llvm-tblgen", |
| 33 |
td_file = "Options.td", |
| 34 |
deps = ["//llvm:OptParserTdFiles"], |
| 35 |
) |
| 36 |
|
| 37 |
cc_binary( |
| 38 |
name = "lldb-dap", |
| 39 |
srcs = glob([ |
| 40 |
"*.cpp", |
| 41 |
"*.h", |
| 42 |
]), |
| 43 |
additional_linker_inputs = [ |
| 44 |
":plist", |
| 45 |
], |
| 46 |
linkopts = select({ |
| 47 |
"@platforms//os:macos": [ |
| 48 |
"-Wl,-sectcreate,__TEXT,__info_plist,$(location :plist)", |
| 49 |
], |
| 50 |
"//conditions:default": [], |
| 51 |
}), |
| 52 |
deps = [ |
| 53 |
":lldb_dap_opts_gen", |
| 54 |
"//lldb:APIHeaders", |
| 55 |
"//lldb:Headers", |
| 56 |
"//lldb:Host", |
| 57 |
"//lldb:liblldb.wrapper", |
| 58 |
"//llvm:Option", |
| 59 |
"//llvm:Support", |
| 60 |
"//llvm:config", |
| 61 |
], |
| 62 |
) |