xref: /aosp_15_r20/external/stg/Android.bp (revision 9e3b08ae94a55201065475453d799e8b1378bea6)
1// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2//
3// Copyright 2021 Google LLC
4//
5// Licensed under the Apache License v2.0 with LLVM Exceptions (the
6// "License"); you may not use this file except in compliance with the
7// License.  You may obtain a copy of the License at
8//
9//     https://llvm.org/LICENSE.txt
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Author: Giuliano Procida
18
19package {
20    default_applicable_licenses: ["llvm_license"],
21}
22
23// http://go/android-license-faq
24license {
25    name: "llvm_license",
26    visibility: [":__subpackages__"],
27    license_kinds: [
28        "SPDX-license-identifier-Apache-2.0",
29    ],
30    license_text: [
31        "LICENSE",
32    ],
33}
34
35cc_defaults {
36    name: "defaults",
37    defaults: ["elfutils_transitive_defaults"],
38    visibility: [
39        "//visibility:private",
40    ],
41    cpp_std: "c++20",
42    cflags: [
43        "-DUSE_ANDROID_BUILD_NUMBER",
44        "-fexceptions",
45        "-Wno-error=unused-parameter",
46    ],
47    static_libs: [
48        "libbpf",
49        "libbuildversion",
50        "libdw",
51        "libelf",
52        "libicuuc",
53        "libicuuc_stubdata",
54        "libjemalloc5",
55        "libprotobuf-cpp-full",
56        "libxml2",
57    ],
58    compile_multilib: "64",
59    target: {
60        darwin: {
61            enabled: false,
62        },
63    },
64    // TODO(b/324274771): figure out a better solution
65    native_coverage: false,
66}
67
68cc_library_host_static {
69    name: "libstg",
70    defaults: ["defaults"],
71    srcs: [
72        "abigail_reader.cc",
73        "btf_reader.cc",
74        "comparison.cc",
75        "deduplication.cc",
76        "dwarf_processor.cc",
77        "dwarf_wrappers.cc",
78        "elf_dwarf_handle.cc",
79        "elf_loader.cc",
80        "elf_reader.cc",
81        "fidelity.cc",
82        "file_descriptor.cc",
83        "filter.cc",
84        "fingerprint.cc",
85        "graph.cc",
86        "input.cc",
87        "naming.cc",
88        "post_processing.cc",
89        "proto_reader.cc",
90        "proto_writer.cc",
91        "reporting.cc",
92        "runtime.cc",
93        "stable_hash.cc",
94        "stg.proto",
95        "type_normalisation.cc",
96        "type_resolution.cc",
97        "unification.cc",
98    ],
99    proto: {
100        export_proto_headers: true,
101    },
102
103}
104
105cc_binary_host {
106    name: "stg",
107    defaults: ["defaults"],
108    srcs: [
109        "stg.cc",
110    ],
111    static_libs: ["libstg"],
112}
113
114cc_binary_host {
115    name: "stgdiff",
116    defaults: ["defaults"],
117    srcs: [
118        "stgdiff.cc",
119    ],
120    static_libs: ["libstg"],
121}
122