blob: 6cadcfc0fcfb36fe561d06818d8282f8ea6a0d87 [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: [
Mark Salyzyn0c071c92018-02-05 07:41:31 -080048 "chrono_utils.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070049 "file.cpp",
50 "logging.cpp",
51 "parsenetaddress.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070052 "quick_exit.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070053 "stringprintf.cpp",
54 "strings.cpp",
55 "test_utils.cpp",
56 ],
Steven Moreland3c71bbd2017-04-14 00:54:46 -070057
Colin Cross4eda9822017-04-18 17:42:10 -070058 header_libs: [
59 "libbase_headers",
Colin Cross4eda9822017-04-18 17:42:10 -070060 ],
Steven Moreland3c71bbd2017-04-14 00:54:46 -070061 export_header_lib_headers: ["libbase_headers"],
62
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: [
Dan Willemsenbdddcab2017-10-03 14:17:31 -070076 "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: [
James Hawkinse78ea772017-03-24 11:43:02 -070082 "errors_unix.cpp",
83 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070084 cppflags: ["-Wexit-time-destructors"],
85 },
Dan Willemsenab34b472016-11-29 13:32:55 -080086 linux_bionic: {
Dan Willemsenab34b472016-11-29 13:32:55 -080087 enabled: true,
88 },
Colin Crossfc06bd02016-07-11 14:15:31 -070089 windows: {
90 srcs: [
91 "errors_windows.cpp",
92 "utf8.cpp",
93 ],
94 enabled: true,
95 },
96 },
97}
98
99// Tests
100// ------------------------------------------------------------------------------
101cc_test {
102 name: "libbase_test",
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -0700103 defaults: ["libbase_defaults"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700104 host_supported: true,
Colin Crossfc06bd02016-07-11 14:15:31 -0700105 srcs: [
Elliott Hughes1dbd9762017-02-24 14:02:05 -0800106 "endian_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700107 "errors_test.cpp",
108 "file_test.cpp",
109 "logging_test.cpp",
Yabin Cui997cba42016-10-05 10:54:35 -0700110 "parsedouble_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700111 "parseint_test.cpp",
112 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -0700113 "quick_exit_test.cpp",
Tom Cherryc996a8e2017-04-05 14:15:31 -0700114 "scopeguard_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700115 "stringprintf_test.cpp",
116 "strings_test.cpp",
117 "test_main.cpp",
Josh Gao30171a82017-04-27 19:48:44 -0700118 "test_utils_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700119 ],
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"],
Dan Willemsen528f1442017-11-29 18:06:11 -0800132 cflags: ["-Wno-unused-parameter"],
Colin Crossfc06bd02016-07-11 14:15:31 -0700133 enabled: true,
134 },
135 },
136 local_include_dirs: ["."],
Colin Crossfc06bd02016-07-11 14:15:31 -0700137 shared_libs: ["libbase"],
138 compile_multilib: "both",
139 multilib: {
140 lib32: {
141 suffix: "32",
142 },
143 lib64: {
144 suffix: "64",
145 },
146 },
147}