blob: 37caeb2044ffbacedc451e995189934318e2edfe [file] [log] [blame]
Eric Holkc4239ac2018-09-05 10:43:31 -07001//
2// Copyright (C) 2018 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
Eric Holkdbc36e22018-09-20 12:03:10 -070017cc_defaults {
18 name: "viewcompiler_defaults",
Orion Hodsonca1b80b2019-01-28 11:35:16 +000019 defaults: ["libdexfile_static_defaults"],
Eric Holkfaefd4f2018-10-11 16:25:57 -070020 header_libs: [
21 "libbase_headers",
22 ],
Eric Holkdbc36e22018-09-20 12:03:10 -070023 shared_libs: [
Eric Holkfaefd4f2018-10-11 16:25:57 -070024 "libbase",
Eric Holkb377e512018-12-21 17:25:38 -080025 "libz",
Eric Holkdbc36e22018-09-20 12:03:10 -070026 "slicer",
27 ],
Eric Holk3cbf1762018-12-13 16:04:56 -080028 static_libs: [
29 "libtinyxml2",
Eric Holkb377e512018-12-21 17:25:38 -080030 "liblog",
31 "libutils",
32 "libziparchive",
Eric Holk3cbf1762018-12-13 16:04:56 -080033 ],
Eric Holkb377e512018-12-21 17:25:38 -080034 cppflags: ["-std=c++17"],
35 target: {
36 android: {
37 shared_libs: [
38 "libandroidfw",
39 ],
40 },
41 host: {
42 static_libs: [
43 "libandroidfw",
44 ],
45 },
46 },
Eric Holkdbc36e22018-09-20 12:03:10 -070047}
48
Eric Holkbf30e312019-01-14 10:25:40 -080049cc_library_static {
Eric Holkc4239ac2018-09-05 10:43:31 -070050 name: "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070051 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070052 srcs: [
Eric Holkb377e512018-12-21 17:25:38 -080053 "apk_layout_compiler.cc",
Eric Holkdbc36e22018-09-20 12:03:10 -070054 "dex_builder.cc",
Eric Holk42734572018-12-17 15:46:18 -080055 "dex_layout_compiler.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070056 "java_lang_builder.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080057 "tinyxml_layout_parser.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070058 "util.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080059 "layout_validation.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070060 ],
Chih-Hung Hsieh7ae7f162019-02-04 10:35:55 -080061 // b/123880763, clang-tidy analyzer has segmentation fault with dex_builder.cc
62 tidy_checks: ["-clang-analyzer-*"],
Eric Holkbf30e312019-01-14 10:25:40 -080063 host_supported: true,
Eric Holkc4239ac2018-09-05 10:43:31 -070064}
65
Eric Holkbf30e312019-01-14 10:25:40 -080066cc_binary {
Eric Holkc4239ac2018-09-05 10:43:31 -070067 name: "viewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070068 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070069 srcs: [
70 "main.cc",
71 ],
72 static_libs: [
Eric Holkc4239ac2018-09-05 10:43:31 -070073 "libgflags",
74 "libviewcompiler",
75 ],
Eric Holkbf30e312019-01-14 10:25:40 -080076 host_supported: true
Eric Holkc4239ac2018-09-05 10:43:31 -070077}
78
79cc_test_host {
80 name: "view-compiler-tests",
Eric Holkdbc36e22018-09-20 12:03:10 -070081 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070082 srcs: [
Eric Holkdbc36e22018-09-20 12:03:10 -070083 "dex_builder_test.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080084 "layout_validation_test.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070085 "util_test.cc",
86 ],
87 static_libs: [
88 "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070089 ],
Eric Holkfaefd4f2018-10-11 16:25:57 -070090 test_suites: ["general-tests"],
Eric Holkc4239ac2018-09-05 10:43:31 -070091}
Eric Holkd683f9f2018-10-26 16:08:09 -070092
93cc_binary_host {
94 name: "dex_testcase_generator",
95 defaults: ["viewcompiler_defaults"],
96 srcs: ["dex_testcase_generator.cc"],
97 static_libs: [
98 "libviewcompiler",
99 ],
100}
101
102genrule {
103 name: "generate_dex_testcases",
104 tools: [":dex_testcase_generator"],
105 cmd: "$(location :dex_testcase_generator) $(genDir)",
106 out: [
107 "simple.dex",
108 "trivial.dex",
109 ],
110}