blob: 46a0233429de2d20b501f53cb4499779c8986e70 [file] [log] [blame]
Colin Crosscaaeb282016-07-11 14:15:31 -07001//
2// Copyright (C) 2015 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
Chih-Hung Hsieh6f36fb02017-10-02 15:20:07 -070017cc_defaults {
Andreas Gampeed917072018-02-15 11:40:30 -080018 name: "libbase_cflags_defaults",
Elliott Hughesa72e3f62018-02-16 17:58:14 -080019 cflags: [
20 "-Wall",
21 "-Werror",
22 "-Wextra",
23 ],
Chih-Hung Hsieh6f36fb02017-10-02 15:20:07 -070024}
Colin Crosscaaeb282016-07-11 14:15:31 -070025
Steven Morelanda347b772017-04-14 00:54:46 -070026cc_library_headers {
27 name: "libbase_headers",
28 vendor_available: true,
Jiyong Parkb51bddd2018-04-27 21:48:43 +090029 recovery_available: true,
Steven Morelanda347b772017-04-14 00:54:46 -070030 host_supported: true,
31 export_include_dirs: ["include"],
32
Steven Morelanda347b772017-04-14 00:54:46 -070033 target: {
34 linux_bionic: {
35 enabled: true,
36 },
37 windows: {
38 enabled: true,
39 },
40 },
41}
42
Andreas Gampeed917072018-02-15 11:40:30 -080043cc_defaults {
44 name: "libbase_defaults",
45 defaults: ["libbase_cflags_defaults"],
Colin Crosscaaeb282016-07-11 14:15:31 -070046 srcs: [
Mark Salyzyn764a9c72018-02-05 07:41:31 -080047 "chrono_utils.cpp",
Colin Crosscaaeb282016-07-11 14:15:31 -070048 "file.cpp",
49 "logging.cpp",
50 "parsenetaddress.cpp",
Elliott Hughes083c2fe2018-05-24 18:00:39 -070051 "properties.cpp",
Josh Gaof6d181b2016-09-13 14:50:57 -070052 "quick_exit.cpp",
Colin Crosscaaeb282016-07-11 14:15:31 -070053 "stringprintf.cpp",
54 "strings.cpp",
Josh Gaoef102be2018-03-16 14:25:42 -070055 "threads.cpp",
Colin Crosscaaeb282016-07-11 14:15:31 -070056 "test_utils.cpp",
57 ],
Steven Morelanda347b772017-04-14 00:54:46 -070058
Colin Crosscaaeb282016-07-11 14:15:31 -070059 shared_libs: ["liblog"],
60 target: {
61 android: {
Elliott Hughes83b00972017-02-14 15:46:33 -080062 sanitize: {
63 misc_undefined: ["integer"],
64 },
James Hawkins99574972017-03-24 11:43:02 -070065
Colin Crosscaaeb282016-07-11 14:15:31 -070066 },
Dan Willemsen2cb672f2017-10-03 14:17:31 -070067 linux: {
68 srcs: [
Dan Willemsen2cb672f2017-10-03 14:17:31 -070069 "errors_unix.cpp",
70 ],
71 cppflags: ["-Wexit-time-destructors"],
72 },
Colin Crosscaaeb282016-07-11 14:15:31 -070073 darwin: {
James Hawkins99574972017-03-24 11:43:02 -070074 srcs: [
James Hawkins99574972017-03-24 11:43:02 -070075 "errors_unix.cpp",
76 ],
Colin Crosscaaeb282016-07-11 14:15:31 -070077 cppflags: ["-Wexit-time-destructors"],
78 },
Dan Willemsen15acb592016-11-29 13:32:55 -080079 linux_bionic: {
Dan Willemsen15acb592016-11-29 13:32:55 -080080 enabled: true,
81 },
Colin Crosscaaeb282016-07-11 14:15:31 -070082 windows: {
83 srcs: [
84 "errors_windows.cpp",
85 "utf8.cpp",
86 ],
87 enabled: true,
88 },
89 },
90}
91
Andreas Gampeed917072018-02-15 11:40:30 -080092cc_library {
93 name: "libbase",
94 defaults: ["libbase_defaults"],
95 vendor_available: true,
Jiyong Park9670f162018-05-24 14:11:00 +090096 recovery_available: true,
Andreas Gampeed917072018-02-15 11:40:30 -080097 host_supported: true,
98 vndk: {
99 enabled: true,
100 support_system_process: true,
101 },
102 header_libs: [
103 "libbase_headers",
104 ],
105 export_header_lib_headers: ["libbase_headers"],
106}
107
108cc_library_static {
109 name: "libbase_ndk",
110 defaults: ["libbase_defaults"],
111 sdk_version: "current",
112 stl: "c++_static",
113 export_include_dirs: ["include"],
114}
115
Colin Crosscaaeb282016-07-11 14:15:31 -0700116// Tests
117// ------------------------------------------------------------------------------
118cc_test {
119 name: "libbase_test",
Andreas Gampeed917072018-02-15 11:40:30 -0800120 defaults: ["libbase_cflags_defaults"],
Colin Crosscaaeb282016-07-11 14:15:31 -0700121 host_supported: true,
Colin Crosscaaeb282016-07-11 14:15:31 -0700122 srcs: [
Elliott Hughes08baa862017-02-24 14:02:05 -0800123 "endian_test.cpp",
Colin Crosscaaeb282016-07-11 14:15:31 -0700124 "errors_test.cpp",
125 "file_test.cpp",
126 "logging_test.cpp",
Elliott Hughesda37d812018-04-06 17:45:22 -0700127 "macros_test.cpp",
Yabin Cuiebe8eef2016-10-05 10:54:35 -0700128 "parsedouble_test.cpp",
Colin Crosscaaeb282016-07-11 14:15:31 -0700129 "parseint_test.cpp",
130 "parsenetaddress_test.cpp",
Elliott Hughes083c2fe2018-05-24 18:00:39 -0700131 "properties_test.cpp",
Josh Gaof6d181b2016-09-13 14:50:57 -0700132 "quick_exit_test.cpp",
Tom Cherry1d273062017-04-05 14:15:31 -0700133 "scopeguard_test.cpp",
Colin Crosscaaeb282016-07-11 14:15:31 -0700134 "stringprintf_test.cpp",
135 "strings_test.cpp",
136 "test_main.cpp",
Josh Gao8f1fa002017-04-27 19:48:44 -0700137 "test_utils_test.cpp",
Josh Gao6b4ef852018-07-20 12:42:14 -0700138 "unique_fd_test.cpp",
Colin Crosscaaeb282016-07-11 14:15:31 -0700139 ],
140 target: {
Elliott Hughes5a7788c2016-09-21 16:53:15 -0700141 android: {
Elliott Hughes83b00972017-02-14 15:46:33 -0800142 sanitize: {
143 misc_undefined: ["integer"],
144 },
Elliott Hughes5a7788c2016-09-21 16:53:15 -0700145 },
Dan Willemsen2cb672f2017-10-03 14:17:31 -0700146 linux: {
James Hawkins99574972017-03-24 11:43:02 -0700147 srcs: ["chrono_utils_test.cpp"],
James Hawkins99574972017-03-24 11:43:02 -0700148 },
Colin Crosscaaeb282016-07-11 14:15:31 -0700149 windows: {
150 srcs: ["utf8_test.cpp"],
Dan Willemsenb80b3d52017-11-29 18:06:11 -0800151 cflags: ["-Wno-unused-parameter"],
Colin Crosscaaeb282016-07-11 14:15:31 -0700152 enabled: true,
153 },
154 },
155 local_include_dirs: ["."],
Colin Crosscaaeb282016-07-11 14:15:31 -0700156 shared_libs: ["libbase"],
157 compile_multilib: "both",
158 multilib: {
159 lib32: {
160 suffix: "32",
161 },
162 lib64: {
163 suffix: "64",
164 },
165 },
Elliott Hughesefdeefd2018-04-27 16:12:06 -0700166 test_suites: ["device-tests"],
Colin Crosscaaeb282016-07-11 14:15:31 -0700167}