blob: f4a841107ee155061bf17e702ed727e99b995d2b [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
17libbase_cppflags = [
18 "-Wall",
19 "-Wextra",
20 "-Werror",
21]
22
Steven Moreland3c71bbd2017-04-14 00:54:46 -070023cc_library_headers {
24 name: "libbase_headers",
25 vendor_available: true,
26 host_supported: true,
27 export_include_dirs: ["include"],
28
Steven Moreland3c71bbd2017-04-14 00:54:46 -070029 target: {
30 linux_bionic: {
31 enabled: true,
32 },
33 windows: {
34 enabled: true,
35 },
36 },
37}
38
Colin Crossfc06bd02016-07-11 14:15:31 -070039cc_library {
40 name: "libbase",
Steven Morelandd10a0232017-04-13 15:13:57 -070041 vendor_available: true,
Colin Crossfc06bd02016-07-11 14:15:31 -070042 host_supported: true,
Justin Yun9ca92452017-07-31 15:41:10 +090043 vndk: {
44 enabled: true,
45 support_system_process: true,
46 },
Colin Crossfc06bd02016-07-11 14:15:31 -070047 srcs: [
48 "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",
54 "test_utils.cpp",
55 ],
Steven Moreland3c71bbd2017-04-14 00:54:46 -070056
Colin Cross4eda9822017-04-18 17:42:10 -070057 header_libs: [
58 "libbase_headers",
Colin Cross4eda9822017-04-18 17:42:10 -070059 ],
Steven Moreland3c71bbd2017-04-14 00:54:46 -070060 export_header_lib_headers: ["libbase_headers"],
61
Colin Crossfc06bd02016-07-11 14:15:31 -070062 cppflags: libbase_cppflags,
Colin Crossfc06bd02016-07-11 14:15:31 -070063 shared_libs: ["liblog"],
64 target: {
65 android: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070066 srcs: [
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070067 "properties.cpp",
68 ],
Elliott Hughesec46f4e2017-02-14 15:46:33 -080069 sanitize: {
70 misc_undefined: ["integer"],
71 },
James Hawkinse78ea772017-03-24 11:43:02 -070072
Colin Crossfc06bd02016-07-11 14:15:31 -070073 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -070074 linux: {
75 srcs: [
76 "chrono_utils.cpp",
77 "errors_unix.cpp",
78 ],
79 cppflags: ["-Wexit-time-destructors"],
80 },
Colin Crossfc06bd02016-07-11 14:15:31 -070081 darwin: {
James Hawkinse78ea772017-03-24 11:43:02 -070082 srcs: [
Josh Gao0b35b182017-05-01 21:56:28 +000083 "chrono_utils.cpp",
James Hawkinse78ea772017-03-24 11:43:02 -070084 "errors_unix.cpp",
85 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070086 cppflags: ["-Wexit-time-destructors"],
87 },
Dan Willemsenab34b472016-11-29 13:32:55 -080088 linux_bionic: {
Dan Willemsenab34b472016-11-29 13:32:55 -080089 enabled: true,
90 },
Colin Crossfc06bd02016-07-11 14:15:31 -070091 windows: {
92 srcs: [
93 "errors_windows.cpp",
94 "utf8.cpp",
95 ],
96 enabled: true,
97 },
98 },
99}
100
101// Tests
102// ------------------------------------------------------------------------------
103cc_test {
104 name: "libbase_test",
105 host_supported: true,
Colin Crossfc06bd02016-07-11 14:15:31 -0700106 srcs: [
Elliott Hughes1dbd9762017-02-24 14:02:05 -0800107 "endian_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700108 "errors_test.cpp",
109 "file_test.cpp",
110 "logging_test.cpp",
Yabin Cui997cba42016-10-05 10:54:35 -0700111 "parsedouble_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700112 "parseint_test.cpp",
113 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -0700114 "quick_exit_test.cpp",
Tom Cherryc996a8e2017-04-05 14:15:31 -0700115 "scopeguard_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700116 "stringprintf_test.cpp",
117 "strings_test.cpp",
118 "test_main.cpp",
119 ],
120 target: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700121 android: {
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700122 srcs: ["properties_test.cpp"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -0800123 sanitize: {
124 misc_undefined: ["integer"],
125 },
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700126 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700127 linux: {
James Hawkinse78ea772017-03-24 11:43:02 -0700128 srcs: ["chrono_utils_test.cpp"],
James Hawkinse78ea772017-03-24 11:43:02 -0700129 },
Colin Crossfc06bd02016-07-11 14:15:31 -0700130 windows: {
131 srcs: ["utf8_test.cpp"],
132 enabled: true,
133 },
134 },
135 local_include_dirs: ["."],
136 cppflags: libbase_cppflags,
137 shared_libs: ["libbase"],
138 compile_multilib: "both",
139 multilib: {
140 lib32: {
141 suffix: "32",
142 },
143 lib64: {
144 suffix: "64",
145 },
146 },
147}