1//
2// Copyright (C) 2016 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_defaults {
22    name: "header-checker-defaults",
23
24    defaults: [
25        "llvm-build-host-tools-defaults",
26    ],
27
28    cflags: [
29        "-Wall",
30        "-Werror",
31        "-Wno-unused-parameter",
32        "-DGOOGLE_PROTOBUF_NO_RTTI",
33        "-UNDEBUG",
34    ],
35
36    cppflags: [
37        "-fno-exceptions",
38        "-fno-rtti",
39        "-std=c++14",
40    ],
41
42    target: {
43        windows: {
44            enabled: false,
45        },
46    },
47
48    local_include_dirs: [
49        "src",
50    ],
51
52    compile_multilib: "64",
53    stl: "none",
54}
55
56cc_binary_host {
57    name: "header-abi-dumper",
58
59    defaults: [
60        "header-checker-defaults",
61    ],
62
63    srcs: [
64        "src/dumper/abi_wrappers.cpp",
65        "src/dumper/ast_processing.cpp",
66        "src/dumper/diagnostic_consumer.cpp",
67        "src/dumper/fake_decl_source.cpp",
68        "src/dumper/fixed_argv.cpp",
69        "src/dumper/frontend_action.cpp",
70        "src/dumper/frontend_action_factory.cpp",
71        "src/dumper/header_checker.cpp",
72    ],
73
74    static_libs: [
75        "libheader-checker",
76        "libheader-checker-proto",
77        "libjsoncpp",
78    ],
79
80    shared_libs: [
81        "libprotobuf-cpp-full",
82        "libLLVM_host",
83        "libclang_cxx_host",
84        "libc++_host",
85    ],
86}
87
88cc_defaults {
89    name: "header-abi-linker-defaults",
90
91    defaults: ["header-checker-defaults"],
92
93    static_libs: [
94        "libheader-checker",
95        "libheader-checker-proto",
96        "libjsoncpp",
97    ],
98
99    shared_libs: [
100        "libprotobuf-cpp-full",
101        "libLLVM_host",
102        "libclang_cxx_host",
103        "libc++_host",
104    ],
105}
106
107cc_binary_host {
108    name: "header-abi-linker",
109
110    defaults: [
111        "header-checker-defaults",
112        "header-abi-linker-defaults",
113    ],
114
115    srcs: [
116        "src/linker/header_abi_linker.cpp",
117        "src/linker/module_merger.cpp",
118    ],
119}
120
121cc_binary_host {
122    name: "header-abi-diff",
123
124    defaults: [
125        "header-checker-defaults",
126        "header-abi-linker-defaults",
127    ],
128
129    srcs: [
130        "src/diff/abi_diff.cpp",
131        "src/diff/abi_diff_wrappers.cpp",
132        "src/diff/header_abi_diff.cpp",
133    ],
134}
135
136cc_library_host_static {
137    name: "libheader-checker",
138
139    defaults: [
140        "header-checker-defaults",
141    ],
142
143    srcs: [
144        "src/repr/abi_diff_helpers.cpp",
145        "src/repr/ir_diff_dumper.cpp",
146        "src/repr/ir_dumper.cpp",
147        "src/repr/ir_reader.cpp",
148        "src/repr/ir_representation.cpp",
149        "src/repr/json/converter.cpp",
150        "src/repr/json/ir_dumper.cpp",
151        "src/repr/json/ir_reader.cpp",
152        "src/repr/protobuf/converter.cpp",
153        "src/repr/protobuf/ir_diff_dumper.cpp",
154        "src/repr/protobuf/ir_dumper.cpp",
155        "src/repr/protobuf/ir_reader.cpp",
156        "src/repr/symbol/exported_symbol_set.cpp",
157        "src/repr/symbol/so_file_parser.cpp",
158        "src/repr/symbol/version_script_parser.cpp",
159        "src/utils/api_level.cpp",
160        "src/utils/command_line_utils.cpp",
161        "src/utils/config_file.cpp",
162        "src/utils/collect_exported_headers.cpp",
163        "src/utils/string_utils.cpp",
164    ],
165
166    static_libs: [
167        "libheader-checker-proto",
168        "libjsoncpp",
169    ],
170
171    shared_libs: [
172        "libLLVM_host",
173        "libc++_host",
174        "libprotobuf-cpp-full",
175    ],
176
177    cflags: [
178        "-Wcast-qual",
179        "-Wno-long-long",
180        "-Wno-unused-parameter",
181    ],
182}
183
184cc_test_host {
185    name: "header-checker-unittests",
186
187    defaults: [
188        "header-checker-defaults",
189    ],
190
191    srcs: [
192        "src/repr/symbol/exported_symbol_set_test.cpp",
193        "src/repr/symbol/version_script_parser_test.cpp",
194        "src/utils/api_level_test.cpp",
195        "src/utils/collect_exported_headers_test.cpp",
196        "src/utils/config_file_test.cpp",
197        "src/utils/string_utils_test.cpp",
198    ],
199
200    static_libs: [
201        "libgtest",
202        "libgtest_main",
203        "libheader-checker",
204    ],
205
206    shared_libs: [
207        "libLLVM_host",
208        "libc++_host",
209    ],
210
211    test_suites: ["general-tests"],
212}
213