blob: 71bf1540c6255d735a8a3529ae1eae309050a58b [file] [log] [blame]
Colin Crossfc06bd02016-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 Hsieh122352d2017-10-02 15:20:07 -070017cc_defaults {
Andreas Gampeaf05f3b2018-02-15 11:40:30 -080018 name: "libbase_cflags_defaults",
Elliott Hughesdc699a22018-02-16 17:58:14 -080019 cflags: [
20 "-Wall",
21 "-Werror",
22 "-Wextra",
23 ],
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -070024}
Colin Crossfc06bd02016-07-11 14:15:31 -070025
Steven Moreland3c71bbd2017-04-14 00:54:46 -070026cc_library_headers {
27 name: "libbase_headers",
28 vendor_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090029 recovery_available: true,
Steven Moreland3c71bbd2017-04-14 00:54:46 -070030 host_supported: true,
31 export_include_dirs: ["include"],
32
Steven Moreland3c71bbd2017-04-14 00:54:46 -070033 target: {
34 linux_bionic: {
35 enabled: true,
36 },
37 windows: {
38 enabled: true,
39 },
40 },
41}
42
Andreas Gampeaf05f3b2018-02-15 11:40:30 -080043cc_defaults {
44 name: "libbase_defaults",
45 defaults: ["libbase_cflags_defaults"],
Colin Crossfc06bd02016-07-11 14:15:31 -070046 srcs: [
Mark Salyzyn0c071c92018-02-05 07:41:31 -080047 "chrono_utils.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070048 "file.cpp",
49 "logging.cpp",
50 "parsenetaddress.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070051 "quick_exit.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070052 "stringprintf.cpp",
53 "strings.cpp",
Josh Gao5791e212018-03-16 14:25:42 -070054 "threads.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070055 "test_utils.cpp",
56 ],
Steven Moreland3c71bbd2017-04-14 00:54:46 -070057
Colin Crossfc06bd02016-07-11 14:15:31 -070058 shared_libs: ["liblog"],
59 target: {
60 android: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070061 srcs: [
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070062 "properties.cpp",
63 ],
Elliott Hughesec46f4e2017-02-14 15:46:33 -080064 sanitize: {
65 misc_undefined: ["integer"],
66 },
James Hawkinse78ea772017-03-24 11:43:02 -070067
Colin Crossfc06bd02016-07-11 14:15:31 -070068 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -070069 linux: {
70 srcs: [
Dan Willemsenbdddcab2017-10-03 14:17:31 -070071 "errors_unix.cpp",
72 ],
73 cppflags: ["-Wexit-time-destructors"],
74 },
Colin Crossfc06bd02016-07-11 14:15:31 -070075 darwin: {
James Hawkinse78ea772017-03-24 11:43:02 -070076 srcs: [
James Hawkinse78ea772017-03-24 11:43:02 -070077 "errors_unix.cpp",
78 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070079 cppflags: ["-Wexit-time-destructors"],
80 },
Dan Willemsenab34b472016-11-29 13:32:55 -080081 linux_bionic: {
Dan Willemsenab34b472016-11-29 13:32:55 -080082 enabled: true,
83 },
Colin Crossfc06bd02016-07-11 14:15:31 -070084 windows: {
85 srcs: [
86 "errors_windows.cpp",
87 "utf8.cpp",
88 ],
89 enabled: true,
90 },
91 },
92}
93
Andreas Gampeaf05f3b2018-02-15 11:40:30 -080094cc_library {
95 name: "libbase",
96 defaults: ["libbase_defaults"],
97 vendor_available: true,
Jiyong Parka0e75042018-05-24 14:11:00 +090098 recovery_available: true,
Andreas Gampeaf05f3b2018-02-15 11:40:30 -080099 host_supported: true,
100 vndk: {
101 enabled: true,
102 support_system_process: true,
103 },
104 header_libs: [
105 "libbase_headers",
106 ],
107 export_header_lib_headers: ["libbase_headers"],
108}
109
110cc_library_static {
111 name: "libbase_ndk",
112 defaults: ["libbase_defaults"],
113 sdk_version: "current",
114 stl: "c++_static",
115 export_include_dirs: ["include"],
116}
117
Colin Crossfc06bd02016-07-11 14:15:31 -0700118// Tests
119// ------------------------------------------------------------------------------
120cc_test {
121 name: "libbase_test",
Andreas Gampeaf05f3b2018-02-15 11:40:30 -0800122 defaults: ["libbase_cflags_defaults"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700123 host_supported: true,
Colin Crossfc06bd02016-07-11 14:15:31 -0700124 srcs: [
Elliott Hughes1dbd9762017-02-24 14:02:05 -0800125 "endian_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700126 "errors_test.cpp",
127 "file_test.cpp",
128 "logging_test.cpp",
Elliott Hughes1b86d412018-04-06 17:45:22 -0700129 "macros_test.cpp",
Yabin Cui997cba42016-10-05 10:54:35 -0700130 "parsedouble_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700131 "parseint_test.cpp",
132 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -0700133 "quick_exit_test.cpp",
Tom Cherryc996a8e2017-04-05 14:15:31 -0700134 "scopeguard_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700135 "stringprintf_test.cpp",
136 "strings_test.cpp",
137 "test_main.cpp",
Josh Gao30171a82017-04-27 19:48:44 -0700138 "test_utils_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700139 ],
140 target: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700141 android: {
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700142 srcs: ["properties_test.cpp"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -0800143 sanitize: {
144 misc_undefined: ["integer"],
145 },
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700146 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700147 linux: {
James Hawkinse78ea772017-03-24 11:43:02 -0700148 srcs: ["chrono_utils_test.cpp"],
James Hawkinse78ea772017-03-24 11:43:02 -0700149 },
Colin Crossfc06bd02016-07-11 14:15:31 -0700150 windows: {
151 srcs: ["utf8_test.cpp"],
Dan Willemsen528f1442017-11-29 18:06:11 -0800152 cflags: ["-Wno-unused-parameter"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700153 enabled: true,
154 },
155 },
156 local_include_dirs: ["."],
Colin Crossfc06bd02016-07-11 14:15:31 -0700157 shared_libs: ["libbase"],
158 compile_multilib: "both",
159 multilib: {
160 lib32: {
161 suffix: "32",
162 },
163 lib64: {
164 suffix: "64",
165 },
166 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700167 test_suites: ["device-tests"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700168}