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
17cc_defaults {
18    name: "header-checker-defaults",
19
20    defaults: [
21        "llvm-build-host-tools-defaults",
22    ],
23
24    cflags: [
25        "-Wall",
26        "-Werror",
27        "-Wno-unused-parameter",
28        "-DGOOGLE_PROTOBUF_NO_RTTI",
29        "-UNDEBUG",
30    ],
31
32    cppflags: [
33        "-fno-exceptions",
34        "-fno-rtti",
35        "-std=c++14",
36    ],
37
38    target: {
39        windows: {
40            enabled: false,
41        },
42    },
43
44    local_include_dirs: [
45        "src",
46    ],
47
48    compile_multilib: "64",
49    stl: "none",
50}
51
52cc_binary_host {
53    name: "header-abi-dumper",
54
55    defaults: [
56        "header-checker-defaults",
57    ],
58
59    srcs: [
60        "src/dumper/abi_wrappers.cpp",
61        "src/dumper/ast_processing.cpp",
62        "src/dumper/diagnostic_consumer.cpp",
63        "src/dumper/fake_decl_source.cpp",
64        "src/dumper/fixed_argv.cpp",
65        "src/dumper/frontend_action.cpp",
66        "src/dumper/frontend_action_factory.cpp",
67        "src/dumper/header_checker.cpp",
68    ],
69
70    static_libs: [
71        "libheader-checker",
72        "libheader-checker-proto",
73        "libjsoncpp",
74    ],
75
76    shared_libs: [
77        "libprotobuf-cpp-full",
78        "libLLVM_host",
79        "libclang_cxx_host",
80        "libc++_host",
81    ],
82}
83
84cc_defaults {
85    name: "header-abi-linker-defaults",
86
87    defaults: ["header-checker-defaults"],
88
89    static_libs: [
90        "libheader-checker",
91        "libheader-checker-proto",
92        "libjsoncpp",
93    ],
94
95    shared_libs: [
96        "libprotobuf-cpp-full",
97        "libLLVM_host",
98        "libclang_cxx_host",
99        "libc++_host",
100    ],
101}
102
103cc_binary_host {
104    name: "header-abi-linker",
105
106    defaults: [
107        "header-checker-defaults",
108        "header-abi-linker-defaults",
109    ],
110
111    srcs: [
112        "src/linker/header_abi_linker.cpp",
113        "src/linker/module_merger.cpp",
114    ],
115}
116
117cc_binary_host {
118    name: "header-abi-diff",
119
120    defaults: [
121        "header-checker-defaults",
122        "header-abi-linker-defaults",
123    ],
124
125    srcs: [
126        "src/diff/abi_diff.cpp",
127        "src/diff/abi_diff_wrappers.cpp",
128        "src/diff/header_abi_diff.cpp",
129    ],
130}
131
132cc_library_host_static {
133    name: "libheader-checker",
134
135    defaults: [
136        "header-checker-defaults",
137    ],
138
139    srcs: [
140        "src/repr/abi_diff_helpers.cpp",
141        "src/repr/ir_diff_dumper.cpp",
142        "src/repr/ir_dumper.cpp",
143        "src/repr/ir_reader.cpp",
144        "src/repr/ir_representation.cpp",
145        "src/repr/json/converter.cpp",
146        "src/repr/json/ir_dumper.cpp",
147        "src/repr/json/ir_reader.cpp",
148        "src/repr/protobuf/converter.cpp",
149        "src/repr/protobuf/ir_diff_dumper.cpp",
150        "src/repr/protobuf/ir_dumper.cpp",
151        "src/repr/protobuf/ir_reader.cpp",
152        "src/repr/symbol/exported_symbol_set.cpp",
153        "src/repr/symbol/so_file_parser.cpp",
154        "src/repr/symbol/version_script_parser.cpp",
155        "src/utils/api_level.cpp",
156        "src/utils/command_line_utils.cpp",
157        "src/utils/config_file.cpp",
158        "src/utils/collect_exported_headers.cpp",
159        "src/utils/string_utils.cpp",
160    ],
161
162    static_libs: [
163        "libheader-checker-proto",
164        "libjsoncpp",
165    ],
166
167    shared_libs: [
168        "libLLVM_host",
169        "libc++_host",
170        "libprotobuf-cpp-full",
171    ],
172
173    cflags: [
174        "-Wcast-qual",
175        "-Wno-long-long",
176        "-Wno-unused-parameter",
177    ],
178}
179
180cc_test_host {
181    name: "header-checker-unittests",
182
183    defaults: [
184        "header-checker-defaults",
185    ],
186
187    srcs: [
188        "src/repr/symbol/exported_symbol_set_test.cpp",
189        "src/repr/symbol/version_script_parser_test.cpp",
190        "src/utils/api_level_test.cpp",
191        "src/utils/collect_exported_headers_test.cpp",
192        "src/utils/config_file_test.cpp",
193        "src/utils/string_utils_test.cpp",
194    ],
195
196    static_libs: [
197        "libgtest",
198        "libgtest_main",
199        "libheader-checker",
200    ],
201
202    shared_libs: [
203        "libLLVM_host",
204        "libc++_host",
205    ],
206
207    test_suites: ["general-tests"],
208}
209