blob: 8d2a3f6bddaa7dd8a68f9fdde425f8f96186b5a4 [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
23cc_library {
24 name: "libbase",
Steven Morelandc28517f2017-04-13 15:13:57 -070025 vendor_available: true,
Colin Crossfc06bd02016-07-11 14:15:31 -070026 clang: true,
27 host_supported: true,
28 srcs: [
29 "file.cpp",
30 "logging.cpp",
31 "parsenetaddress.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070032 "quick_exit.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070033 "stringprintf.cpp",
34 "strings.cpp",
35 "test_utils.cpp",
36 ],
37 local_include_dirs: ["include"],
38 cppflags: libbase_cppflags,
39 export_include_dirs: ["include"],
40 shared_libs: ["liblog"],
Steven Morelandc28517f2017-04-13 15:13:57 -070041 header_libs: ["libutils_headers"],
Colin Crossfc06bd02016-07-11 14:15:31 -070042 target: {
43 android: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070044 srcs: [
45 "errors_unix.cpp",
46 "properties.cpp",
47 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070048 cppflags: ["-Wexit-time-destructors"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -080049 sanitize: {
50 misc_undefined: ["integer"],
51 },
Colin Crossfc06bd02016-07-11 14:15:31 -070052 },
53 darwin: {
James Hawkinsc8ac0672017-02-14 19:20:20 +000054 srcs: ["errors_unix.cpp"],
Colin Crossfc06bd02016-07-11 14:15:31 -070055 cppflags: ["-Wexit-time-destructors"],
56 },
Dan Willemsenab34b472016-11-29 13:32:55 -080057 linux_bionic: {
James Hawkinsc8ac0672017-02-14 19:20:20 +000058 srcs: ["errors_unix.cpp"],
Dan Willemsenab34b472016-11-29 13:32:55 -080059 cppflags: ["-Wexit-time-destructors"],
60 enabled: true,
61 },
Colin Crossfc06bd02016-07-11 14:15:31 -070062 linux: {
James Hawkinsc8ac0672017-02-14 19:20:20 +000063 srcs: ["errors_unix.cpp"],
Colin Crossfc06bd02016-07-11 14:15:31 -070064 cppflags: ["-Wexit-time-destructors"],
65 },
66 windows: {
67 srcs: [
68 "errors_windows.cpp",
69 "utf8.cpp",
70 ],
71 enabled: true,
72 },
73 },
74}
75
76// Tests
77// ------------------------------------------------------------------------------
78cc_test {
79 name: "libbase_test",
80 host_supported: true,
81 clang: true,
82 srcs: [
Elliott Hughes1dbd9762017-02-24 14:02:05 -080083 "endian_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070084 "errors_test.cpp",
85 "file_test.cpp",
86 "logging_test.cpp",
Yabin Cui997cba42016-10-05 10:54:35 -070087 "parsedouble_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070088 "parseint_test.cpp",
89 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070090 "quick_exit_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070091 "stringprintf_test.cpp",
92 "strings_test.cpp",
93 "test_main.cpp",
94 ],
95 target: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070096 android: {
James Hawkinsc8ac0672017-02-14 19:20:20 +000097 srcs: ["properties_test.cpp"],
Elliott Hughesec46f4e2017-02-14 15:46:33 -080098 sanitize: {
99 misc_undefined: ["integer"],
100 },
Elliott Hughes1e88c8c2016-09-21 16:53:15 -0700101 },
Colin Crossfc06bd02016-07-11 14:15:31 -0700102 windows: {
103 srcs: ["utf8_test.cpp"],
104 enabled: true,
105 },
106 },
107 local_include_dirs: ["."],
108 cppflags: libbase_cppflags,
109 shared_libs: ["libbase"],
110 compile_multilib: "both",
111 multilib: {
112 lib32: {
113 suffix: "32",
114 },
115 lib64: {
116 suffix: "64",
117 },
118 },
119}