blob: acbc6b7c051c90c58c6d2bd7cfa901eb16769232 [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 {
18 name: "libbase_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
Colin Crossfc06bd02016-07-11 14:15:31 -070042cc_library {
43 name: "libbase",
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -070044 defaults: ["libbase_defaults"],
Steven Morelandd10a0232017-04-13 15:13:57 -070045 vendor_available: true,
Colin Crossfc06bd02016-07-11 14:15:31 -070046 host_supported: true,
Justin Yun9ca92452017-07-31 15:41:10 +090047 vndk: {
48 enabled: true,
49 support_system_process: true,
50 },
Colin Crossfc06bd02016-07-11 14:15:31 -070051 srcs: [
Mark Salyzyn0c071c92018-02-05 07:41:31 -080052 "chrono_utils.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070053 "file.cpp",
54 "logging.cpp",
55 "parsenetaddress.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070056 "quick_exit.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070057 "stringprintf.cpp",
58 "strings.cpp",
59 "test_utils.cpp",
60 ],
Steven Moreland3c71bbd2017-04-14 00:54:46 -070061
Colin Cross4eda9822017-04-18 17:42:10 -070062 header_libs: [
63 "libbase_headers",
Colin Cross4eda9822017-04-18 17:42:10 -070064 ],
Steven Moreland3c71bbd2017-04-14 00:54:46 -070065 export_header_lib_headers: ["libbase_headers"],
66
Colin Crossfc06bd02016-07-11 14:15:31 -070067 shared_libs: ["liblog"],
68 target: {
69 android: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070070 srcs: [
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070071 "properties.cpp",
72 ],
Elliott Hughesec46f4e2017-02-14 15:46:33 -080073 sanitize: {
74 misc_undefined: ["integer"],
75 },
James Hawkinse78ea772017-03-24 11:43:02 -070076
Colin Crossfc06bd02016-07-11 14:15:31 -070077 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -070078 linux: {
79 srcs: [
Dan Willemsenbdddcab2017-10-03 14:17:31 -070080 "errors_unix.cpp",
81 ],
82 cppflags: ["-Wexit-time-destructors"],
83 },
Colin Crossfc06bd02016-07-11 14:15:31 -070084 darwin: {
James Hawkinse78ea772017-03-24 11:43:02 -070085 srcs: [
James Hawkinse78ea772017-03-24 11:43:02 -070086 "errors_unix.cpp",
87 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070088 cppflags: ["-Wexit-time-destructors"],
89 },
Dan Willemsenab34b472016-11-29 13:32:55 -080090 linux_bionic: {
Dan Willemsenab34b472016-11-29 13:32:55 -080091 enabled: true,
92 },
Colin Crossfc06bd02016-07-11 14:15:31 -070093 windows: {
94 srcs: [
95 "errors_windows.cpp",
96 "utf8.cpp",
97 ],
98 enabled: true,
99 },
100 },
101}
102
103// Tests
104// ------------------------------------------------------------------------------
105cc_test {
106 name: "libbase_test",
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -0700107 defaults: ["libbase_defaults"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700108 host_supported: true,
Colin Crossfc06bd02016-07-11 14:15:31 -0700109 srcs: [
Elliott Hughes1dbd9762017-02-24 14:02:05 -0800110 "endian_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700111 "errors_test.cpp",
112 "file_test.cpp",
113 "logging_test.cpp",
Yabin Cui997cba42016-10-05 10:54:35 -0700114 "parsedouble_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700115 "parseint_test.cpp",
116 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -0700117 "quick_exit_test.cpp",
Tom Cherryc996a8e2017-04-05 14:15:31 -0700118 "scopeguard_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700119 "stringprintf_test.cpp",
120 "strings_test.cpp",
121 "test_main.cpp",
Josh Gao30171a82017-04-27 19:48:44 -0700122 "test_utils_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700123 ],
124 target: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700125 android: {
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700126 srcs: ["properties_test.cpp"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -0800127 sanitize: {
128 misc_undefined: ["integer"],
129 },
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700130 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700131 linux: {
James Hawkinse78ea772017-03-24 11:43:02 -0700132 srcs: ["chrono_utils_test.cpp"],
James Hawkinse78ea772017-03-24 11:43:02 -0700133 },
Colin Crossfc06bd02016-07-11 14:15:31 -0700134 windows: {
135 srcs: ["utf8_test.cpp"],
Dan Willemsen528f1442017-11-29 18:06:11 -0800136 cflags: ["-Wno-unused-parameter"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700137 enabled: true,
138 },
139 },
140 local_include_dirs: ["."],
Colin Crossfc06bd02016-07-11 14:15:31 -0700141 shared_libs: ["libbase"],
142 compile_multilib: "both",
143 multilib: {
144 lib32: {
145 suffix: "32",
146 },
147 lib64: {
148 suffix: "64",
149 },
150 },
151}