blob: e18c47ec1e27af56b40304466cc73d57878ae332 [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 Moreland8f56c1e2017-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
29 header_libs: ["libutils_headers"],
30 export_header_lib_headers: ["libutils_headers"],
31
32 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",
44 clang: true,
45 host_supported: true,
46 srcs: [
47 "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",
53 "test_utils.cpp",
54 ],
Steven Moreland8f56c1e2017-04-14 00:54:46 -070055
56 header_libs: ["libbase_headers"],
57 export_header_lib_headers: ["libbase_headers"],
58
Colin Crossfc06bd02016-07-11 14:15:31 -070059 cppflags: libbase_cppflags,
Colin Crossfc06bd02016-07-11 14:15:31 -070060 shared_libs: ["liblog"],
61 target: {
62 android: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070063 srcs: [
64 "errors_unix.cpp",
65 "properties.cpp",
66 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070067 cppflags: ["-Wexit-time-destructors"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -080068 sanitize: {
69 misc_undefined: ["integer"],
70 },
Colin Crossfc06bd02016-07-11 14:15:31 -070071 },
72 darwin: {
James Hawkinsc8ac0672017-02-14 19:20:20 +000073 srcs: ["errors_unix.cpp"],
Colin Crossfc06bd02016-07-11 14:15:31 -070074 cppflags: ["-Wexit-time-destructors"],
75 },
Dan Willemsenab34b472016-11-29 13:32:55 -080076 linux_bionic: {
James Hawkinsc8ac0672017-02-14 19:20:20 +000077 srcs: ["errors_unix.cpp"],
Dan Willemsenab34b472016-11-29 13:32:55 -080078 cppflags: ["-Wexit-time-destructors"],
79 enabled: true,
80 },
Colin Crossfc06bd02016-07-11 14:15:31 -070081 linux: {
James Hawkinsc8ac0672017-02-14 19:20:20 +000082 srcs: ["errors_unix.cpp"],
Colin Crossfc06bd02016-07-11 14:15:31 -070083 cppflags: ["-Wexit-time-destructors"],
84 },
85 windows: {
86 srcs: [
87 "errors_windows.cpp",
88 "utf8.cpp",
89 ],
90 enabled: true,
91 },
92 },
93}
94
95// Tests
96// ------------------------------------------------------------------------------
97cc_test {
98 name: "libbase_test",
99 host_supported: true,
100 clang: true,
101 srcs: [
Elliott Hughes1dbd9762017-02-24 14:02:05 -0800102 "endian_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700103 "errors_test.cpp",
104 "file_test.cpp",
105 "logging_test.cpp",
Yabin Cui997cba42016-10-05 10:54:35 -0700106 "parsedouble_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700107 "parseint_test.cpp",
108 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -0700109 "quick_exit_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -0700110 "stringprintf_test.cpp",
111 "strings_test.cpp",
112 "test_main.cpp",
113 ],
114 target: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700115 android: {
James Hawkinsc8ac0672017-02-14 19:20:20 +0000116 srcs: ["properties_test.cpp"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -0800117 sanitize: {
118 misc_undefined: ["integer"],
119 },
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700120 },
Colin Crossfc06bd02016-07-11 14:15:31 -0700121 windows: {
122 srcs: ["utf8_test.cpp"],
123 enabled: true,
124 },
125 },
126 local_include_dirs: ["."],
127 cppflags: libbase_cppflags,
128 shared_libs: ["libbase"],
129 compile_multilib: "both",
130 multilib: {
131 lib32: {
132 suffix: "32",
133 },
134 lib64: {
135 suffix: "64",
136 },
137 },
138}