blob: c93ea5047277f7dd6af05fd8019513d4bf8b8ff2 [file] [log] [blame]
Kiyoung Kim7d422b32019-03-05 17:06:13 +09001/*
2 * Copyright (C) 2019 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: "linkerconfig_defaults",
19 cflags: [
20 "-Wall",
21 "-Werror",
22 "-Wextra",
23 ],
24 static_libs: [
25 "libbase",
26 "liblog",
Jooyung Han33a95052019-12-06 19:47:30 +090027 "libprotobuf-cpp-lite",
28 "lib_apex_manifest_proto_lite",
Kiyoung Kim7d422b32019-03-05 17:06:13 +090029 ],
Jooyung Hana3d5d092019-09-26 23:23:50 +090030 host_supported: true,
Kiyoung Kim09cbb082019-12-05 16:44:34 +090031 recovery_available: true,
Kiyoung Kim7d422b32019-03-05 17:06:13 +090032}
33
Kiyoung Kim853438d2019-07-16 09:51:14 +090034cc_defaults {
35 name: "linkerconfig_test_defaults",
36 defaults: ["linkerconfig_defaults"],
37 cflags: [
38 "-g",
39 "-Wunused",
40 ],
41 test_suites: ["general-tests"],
Kiyoung Kim09cbb082019-12-05 16:44:34 +090042 recovery_available: false,
Kiyoung Kim853438d2019-07-16 09:51:14 +090043}
44
Kiyoung Kim7d422b32019-03-05 17:06:13 +090045cc_library_static {
46 name: "linkerconfig_modules",
47 defaults: [ "linkerconfig_defaults" ],
Kiyoung Kimff9cbf72019-03-14 18:26:24 +090048 export_include_dirs: [ "modules/include" ],
Kiyoung Kim7d422b32019-03-05 17:06:13 +090049 srcs: [
50 "modules/*.cc",
51 ],
52}
53
Kiyoung Kimff9cbf72019-03-14 18:26:24 +090054cc_library_static {
55 name: "linkerconfig_contents",
56 defaults: [ "linkerconfig_defaults" ],
57 export_include_dirs: [ "contents/include" ],
58 static_libs: [
59 "linkerconfig_modules",
60 ],
61 srcs: [
62 "contents/namespace/*.cc",
63 "contents/section/*.cc",
64 "contents/configuration/*.cc",
65 "contents/context/*.cc",
Martin Stjernholmcb9df4f2019-10-02 20:47:12 +010066 "contents/common/*.cc",
Kiyoung Kimff9cbf72019-03-14 18:26:24 +090067 ],
68}
69
Kiyoung Kim853438d2019-07-16 09:51:14 +090070cc_library_static {
71 name: "linkerconfig_generator",
72 defaults : [ "linkerconfig_defaults" ],
73 export_include_dirs: [ "generator/include" ],
Kiyoung Kime9a77fe2019-05-23 11:04:20 +090074 static_libs: [
75 "linkerconfig_modules",
76 "linkerconfig_contents",
Kiyoung Kim853438d2019-07-16 09:51:14 +090077 "libc++fs",
Kiyoung Kime9a77fe2019-05-23 11:04:20 +090078 ],
79 srcs: [
80 "generator/*.cc",
Kiyoung Kim15e38352019-07-11 17:07:03 +090081 ],
Kiyoung Kim853438d2019-07-16 09:51:14 +090082}
83
84cc_binary {
85 name: "linkerconfig",
86 defaults: [ "linkerconfig_defaults" ],
87 static_libs: [
88 "linkerconfig_modules",
89 "linkerconfig_contents",
90 "linkerconfig_generator",
91 ],
92 srcs: [
93 "main.cc",
94 ],
Kiyoung Kim15e38352019-07-11 17:07:03 +090095 static_executable: true,
Kiyoung Kime9a77fe2019-05-23 11:04:20 +090096}
97
Kiyoung Kim7d422b32019-03-05 17:06:13 +090098cc_test {
99 name: "linkerconfig_modules_unittest",
Kiyoung Kim853438d2019-07-16 09:51:14 +0900100 defaults: [ "linkerconfig_test_defaults" ],
Kiyoung Kim7d422b32019-03-05 17:06:13 +0900101 srcs: [
102 "modules/tests/*_test.cc",
103 ],
104 static_libs: [
Jooyung Han33a95052019-12-06 19:47:30 +0900105 "libgmock",
Kiyoung Kim7d422b32019-03-05 17:06:13 +0900106 "linkerconfig_modules",
107 ],
Kiyoung Kimff9cbf72019-03-14 18:26:24 +0900108}
109
110cc_test {
111 name: "linkerconfig_backward_compatibility_test",
Kiyoung Kim853438d2019-07-16 09:51:14 +0900112 defaults: [ "linkerconfig_test_defaults" ],
Kiyoung Kimff9cbf72019-03-14 18:26:24 +0900113 srcs: [
114 "contents/tests/backward_compatibility/*_test.cc",
115 ],
116 static_libs: [
117 "linkerconfig_modules",
118 "linkerconfig_contents",
119 ],
Kiyoung Kim15e38352019-07-11 17:07:03 +0900120}
Kiyoung Kim853438d2019-07-16 09:51:14 +0900121
122cc_test {
123 name: "linkerconfig_generator_unittest",
124 defaults: [ "linkerconfig_test_defaults" ],
125 srcs: [
126 "generator/tests/*_test.cc",
127 ],
128 static_libs: [
129 "linkerconfig_modules",
130 "linkerconfig_contents",
131 "linkerconfig_generator",
132 ],
133 data: [
134 "generator/tests/data/*.txt",
135 ],
Kiyoung Kim84cbf002019-08-21 19:46:51 +0900136}
137
138cc_test {
139 name: "linkerconfig_contents_fulltest",
140 defaults: [ "linkerconfig_test_defaults" ],
141 local_include_dirs: [
142 "contents/tests/configuration/include",
143 ],
144 srcs: [
145 "contents/tests/configuration/*_test.cc",
146 ],
147 static_libs: [
148 "linkerconfig_modules",
149 "linkerconfig_contents",
150 ],
Jooyung Hanbfe06542019-11-14 13:27:19 +0900151 host_supported: true,
Martin Stjernholmcb9df4f2019-10-02 20:47:12 +0100152}