blob: 01800afade0bb21dec10a4e91c3b183e2f08da77 [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",
19 cflags: ["-Wall", "-Werror", "-Wextra"],
20}
Colin Crossfc06bd02016-07-11 14:15:31 -070021
Steven Moreland3c71bbd2017-04-14 00:54:46 -070022cc_library_headers {
23 name: "libbase_headers",
24 vendor_available: true,
25 host_supported: true,
26 export_include_dirs: ["include"],
27
Steven Moreland3c71bbd2017-04-14 00:54:46 -070028 target: {
29 linux_bionic: {
30 enabled: true,
31 },
32 windows: {
33 enabled: true,
34 },
35 },
36}
37
Colin Crossfc06bd02016-07-11 14:15:31 -070038cc_library {
39 name: "libbase",
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -070040 defaults: ["libbase_defaults"],
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 shared_libs: ["liblog"],
63 target: {
64 android: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070065 srcs: [
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070066 "properties.cpp",
67 ],
Elliott Hughesec46f4e2017-02-14 15:46:33 -080068 sanitize: {
69 misc_undefined: ["integer"],
70 },
James Hawkinse78ea772017-03-24 11:43:02 -070071
Colin Crossfc06bd02016-07-11 14:15:31 -070072 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -070073 linux: {
74 srcs: [
75 "chrono_utils.cpp",
76 "errors_unix.cpp",
77 ],
78 cppflags: ["-Wexit-time-destructors"],
79 },
Colin Crossfc06bd02016-07-11 14:15:31 -070080 darwin: {
James Hawkinse78ea772017-03-24 11:43:02 -070081 srcs: [
Josh Gao0b35b182017-05-01 21:56:28 +000082 "chrono_utils.cpp",
James Hawkinse78ea772017-03-24 11:43:02 -070083 "errors_unix.cpp",
84 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070085 cppflags: ["-Wexit-time-destructors"],
86 },
Dan Willemsenab34b472016-11-29 13:32:55 -080087 linux_bionic: {
Dan Willemsenab34b472016-11-29 13:32:55 -080088 enabled: true,
89 },
Colin Crossfc06bd02016-07-11 14:15:31 -070090 windows: {
91 srcs: [
92 "errors_windows.cpp",
93 "utf8.cpp",
94 ],
95 enabled: true,
96 },
97 },
98}
99
100// Tests
101// ------------------------------------------------------------------------------
102cc_test {
103 name: "libbase_test",
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -0700104 defaults: ["libbase_defaults"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700105 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",
Josh Gao30171a82017-04-27 19:48:44 -0700119 "test_utils_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700120 ],
121 target: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700122 android: {
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700123 srcs: ["properties_test.cpp"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -0800124 sanitize: {
125 misc_undefined: ["integer"],
126 },
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700127 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -0700128 linux: {
James Hawkinse78ea772017-03-24 11:43:02 -0700129 srcs: ["chrono_utils_test.cpp"],
James Hawkinse78ea772017-03-24 11:43:02 -0700130 },
Colin Crossfc06bd02016-07-11 14:15:31 -0700131 windows: {
132 srcs: ["utf8_test.cpp"],
Dan Willemsen528f1442017-11-29 18:06:11 -0800133 cflags: ["-Wno-unused-parameter"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700134 enabled: true,
135 },
136 },
137 local_include_dirs: ["."],
Colin Crossfc06bd02016-07-11 14:15:31 -0700138 shared_libs: ["libbase"],
139 compile_multilib: "both",
140 multilib: {
141 lib32: {
142 suffix: "32",
143 },
144 lib64: {
145 suffix: "64",
146 },
147 },
148}