blob: 7b0ba11d09fe6e61f9ac5d0606b7ad565cd1dddf [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,
29 host_supported: true,
30 export_include_dirs: ["include"],
31
Steven Moreland3c71bbd2017-04-14 00:54:46 -070032 target: {
33 linux_bionic: {
34 enabled: true,
35 },
36 windows: {
37 enabled: true,
38 },
39 },
40}
41
Andreas Gampeaf05f3b2018-02-15 11:40:30 -080042cc_defaults {
43 name: "libbase_defaults",
44 defaults: ["libbase_cflags_defaults"],
Colin Crossfc06bd02016-07-11 14:15:31 -070045 srcs: [
Mark Salyzyn0c071c92018-02-05 07:41:31 -080046 "chrono_utils.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070047 "file.cpp",
48 "logging.cpp",
49 "parsenetaddress.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070050 "quick_exit.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070051 "stringprintf.cpp",
52 "strings.cpp",
Josh Gao5791e212018-03-16 14:25:42 -070053 "threads.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070054 "test_utils.cpp",
55 ],
Steven Moreland3c71bbd2017-04-14 00:54:46 -070056
Colin Crossfc06bd02016-07-11 14:15:31 -070057 shared_libs: ["liblog"],
58 target: {
59 android: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070060 srcs: [
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070061 "properties.cpp",
62 ],
Elliott Hughesec46f4e2017-02-14 15:46:33 -080063 sanitize: {
64 misc_undefined: ["integer"],
65 },
James Hawkinse78ea772017-03-24 11:43:02 -070066
Colin Crossfc06bd02016-07-11 14:15:31 -070067 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -070068 linux: {
69 srcs: [
Dan Willemsenbdddcab2017-10-03 14:17:31 -070070 "errors_unix.cpp",
71 ],
72 cppflags: ["-Wexit-time-destructors"],
73 },
Colin Crossfc06bd02016-07-11 14:15:31 -070074 darwin: {
James Hawkinse78ea772017-03-24 11:43:02 -070075 srcs: [
James Hawkinse78ea772017-03-24 11:43:02 -070076 "errors_unix.cpp",
77 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070078 cppflags: ["-Wexit-time-destructors"],
79 },
Dan Willemsenab34b472016-11-29 13:32:55 -080080 linux_bionic: {
Dan Willemsenab34b472016-11-29 13:32:55 -080081 enabled: true,
82 },
Colin Crossfc06bd02016-07-11 14:15:31 -070083 windows: {
84 srcs: [
85 "errors_windows.cpp",
86 "utf8.cpp",
87 ],
88 enabled: true,
89 },
90 },
91}
92
Andreas Gampeaf05f3b2018-02-15 11:40:30 -080093cc_library {
94 name: "libbase",
95 defaults: ["libbase_defaults"],
96 vendor_available: true,
97 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 Crossfc06bd02016-07-11 14:15:31 -0700116// Tests
117// ------------------------------------------------------------------------------
118cc_test {
119 name: "libbase_test",
Andreas Gampeaf05f3b2018-02-15 11:40:30 -0800120 defaults: ["libbase_cflags_defaults"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700121 host_supported: true,
Colin Crossfc06bd02016-07-11 14:15:31 -0700122 srcs: [
Elliott Hughes1dbd9762017-02-24 14:02:05 -0800123 "endian_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700124 "errors_test.cpp",
125 "file_test.cpp",
126 "logging_test.cpp",
Yabin Cui997cba42016-10-05 10:54:35 -0700127 "parsedouble_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700128 "parseint_test.cpp",
129 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -0700130 "quick_exit_test.cpp",
Tom Cherryc996a8e2017-04-05 14:15:31 -0700131 "scopeguard_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700132 "stringprintf_test.cpp",
133 "strings_test.cpp",
134 "test_main.cpp",
Josh Gao30171a82017-04-27 19:48:44 -0700135 "test_utils_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700136 ],
137 target: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700138 android: {
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700139 srcs: ["properties_test.cpp"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -0800140 sanitize: {
141 misc_undefined: ["integer"],
142 },
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700143 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700144 linux: {
James Hawkinse78ea772017-03-24 11:43:02 -0700145 srcs: ["chrono_utils_test.cpp"],
James Hawkinse78ea772017-03-24 11:43:02 -0700146 },
Colin Crossfc06bd02016-07-11 14:15:31 -0700147 windows: {
148 srcs: ["utf8_test.cpp"],
Dan Willemsen528f1442017-11-29 18:06:11 -0800149 cflags: ["-Wno-unused-parameter"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700150 enabled: true,
151 },
152 },
153 local_include_dirs: ["."],
Colin Crossfc06bd02016-07-11 14:15:31 -0700154 shared_libs: ["libbase"],
155 compile_multilib: "both",
156 multilib: {
157 lib32: {
158 suffix: "32",
159 },
160 lib64: {
161 suffix: "64",
162 },
163 },
164}