blob: d76e26ddab27309520eb0c31e5df87211d2dc389 [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",
27 ],
Jooyung Hana3d5d092019-09-26 23:23:50 +090028 host_supported: true,
Kiyoung Kim7d422b32019-03-05 17:06:13 +090029}
30
Kiyoung Kim853438d2019-07-16 09:51:14 +090031cc_defaults {
32 name: "linkerconfig_test_defaults",
33 defaults: ["linkerconfig_defaults"],
34 cflags: [
35 "-g",
36 "-Wunused",
37 ],
38 test_suites: ["general-tests"],
39}
40
Kiyoung Kim7d422b32019-03-05 17:06:13 +090041cc_library_static {
42 name: "linkerconfig_modules",
43 defaults: [ "linkerconfig_defaults" ],
Kiyoung Kimff9cbf72019-03-14 18:26:24 +090044 export_include_dirs: [ "modules/include" ],
Kiyoung Kim7d422b32019-03-05 17:06:13 +090045 srcs: [
46 "modules/*.cc",
47 ],
48}
49
Kiyoung Kimff9cbf72019-03-14 18:26:24 +090050cc_library_static {
51 name: "linkerconfig_contents",
52 defaults: [ "linkerconfig_defaults" ],
53 export_include_dirs: [ "contents/include" ],
54 static_libs: [
55 "linkerconfig_modules",
56 ],
57 srcs: [
58 "contents/namespace/*.cc",
59 "contents/section/*.cc",
60 "contents/configuration/*.cc",
61 "contents/context/*.cc",
Martin Stjernholmcb9df4f2019-10-02 20:47:12 +010062 "contents/common/*.cc",
Kiyoung Kimff9cbf72019-03-14 18:26:24 +090063 ],
64}
65
Kiyoung Kim853438d2019-07-16 09:51:14 +090066cc_library_static {
67 name: "linkerconfig_generator",
68 defaults : [ "linkerconfig_defaults" ],
69 export_include_dirs: [ "generator/include" ],
Kiyoung Kime9a77fe2019-05-23 11:04:20 +090070 static_libs: [
71 "linkerconfig_modules",
72 "linkerconfig_contents",
Kiyoung Kim853438d2019-07-16 09:51:14 +090073 "libc++fs",
Kiyoung Kime9a77fe2019-05-23 11:04:20 +090074 ],
75 srcs: [
76 "generator/*.cc",
Kiyoung Kim15e38352019-07-11 17:07:03 +090077 ],
Kiyoung Kim853438d2019-07-16 09:51:14 +090078}
79
80cc_binary {
81 name: "linkerconfig",
82 defaults: [ "linkerconfig_defaults" ],
83 static_libs: [
84 "linkerconfig_modules",
85 "linkerconfig_contents",
86 "linkerconfig_generator",
87 ],
88 srcs: [
89 "main.cc",
90 ],
Kiyoung Kim15e38352019-07-11 17:07:03 +090091 static_executable: true,
Kiyoung Kime9a77fe2019-05-23 11:04:20 +090092}
93
Kiyoung Kim7d422b32019-03-05 17:06:13 +090094cc_test {
95 name: "linkerconfig_modules_unittest",
Kiyoung Kim853438d2019-07-16 09:51:14 +090096 defaults: [ "linkerconfig_test_defaults" ],
Kiyoung Kim7d422b32019-03-05 17:06:13 +090097 srcs: [
98 "modules/tests/*_test.cc",
99 ],
100 static_libs: [
101 "linkerconfig_modules",
102 ],
Jooyung Han523e0c32019-11-15 13:48:00 +0900103 host_supported: true,
Kiyoung Kimff9cbf72019-03-14 18:26:24 +0900104}
105
106cc_test {
107 name: "linkerconfig_backward_compatibility_test",
Kiyoung Kim853438d2019-07-16 09:51:14 +0900108 defaults: [ "linkerconfig_test_defaults" ],
Kiyoung Kimff9cbf72019-03-14 18:26:24 +0900109 srcs: [
110 "contents/tests/backward_compatibility/*_test.cc",
111 ],
112 static_libs: [
113 "linkerconfig_modules",
114 "linkerconfig_contents",
115 ],
Kiyoung Kim15e38352019-07-11 17:07:03 +0900116}
Kiyoung Kim853438d2019-07-16 09:51:14 +0900117
118cc_test {
119 name: "linkerconfig_generator_unittest",
120 defaults: [ "linkerconfig_test_defaults" ],
121 srcs: [
122 "generator/tests/*_test.cc",
123 ],
124 static_libs: [
125 "linkerconfig_modules",
126 "linkerconfig_contents",
127 "linkerconfig_generator",
128 ],
129 data: [
130 "generator/tests/data/*.txt",
131 ],
Kiyoung Kim84cbf002019-08-21 19:46:51 +0900132}
133
134cc_test {
135 name: "linkerconfig_contents_fulltest",
136 defaults: [ "linkerconfig_test_defaults" ],
137 local_include_dirs: [
138 "contents/tests/configuration/include",
139 ],
140 srcs: [
141 "contents/tests/configuration/*_test.cc",
142 ],
143 static_libs: [
144 "linkerconfig_modules",
145 "linkerconfig_contents",
146 ],
Jooyung Hanbfe06542019-11-14 13:27:19 +0900147 host_supported: true,
Martin Stjernholmcb9df4f2019-10-02 20:47:12 +0100148}