blob: b9a6e0bd6f8547be719414843479741b9a9457e1 [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",
25 clang: true,
26 host_supported: true,
27 srcs: [
28 "file.cpp",
29 "logging.cpp",
30 "parsenetaddress.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070031 "quick_exit.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070032 "stringprintf.cpp",
33 "strings.cpp",
34 "test_utils.cpp",
35 ],
36 local_include_dirs: ["include"],
37 cppflags: libbase_cppflags,
38 export_include_dirs: ["include"],
39 shared_libs: ["liblog"],
40 target: {
41 android: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070042 srcs: [
43 "errors_unix.cpp",
44 "properties.cpp",
45 ],
Colin Crossfc06bd02016-07-11 14:15:31 -070046 cppflags: ["-Wexit-time-destructors"],
47 },
48 darwin: {
49 srcs: ["errors_unix.cpp"],
50 cppflags: ["-Wexit-time-destructors"],
51 },
Dan Willemsenab34b472016-11-29 13:32:55 -080052 linux_bionic: {
53 srcs: ["errors_unix.cpp"],
54 cppflags: ["-Wexit-time-destructors"],
55 enabled: true,
56 },
Colin Crossfc06bd02016-07-11 14:15:31 -070057 linux: {
58 srcs: ["errors_unix.cpp"],
59 cppflags: ["-Wexit-time-destructors"],
60 },
61 windows: {
62 srcs: [
63 "errors_windows.cpp",
64 "utf8.cpp",
65 ],
66 enabled: true,
67 },
68 },
69}
70
71// Tests
72// ------------------------------------------------------------------------------
73cc_test {
74 name: "libbase_test",
75 host_supported: true,
76 clang: true,
77 srcs: [
78 "errors_test.cpp",
79 "file_test.cpp",
80 "logging_test.cpp",
Yabin Cui997cba42016-10-05 10:54:35 -070081 "parsedouble_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070082 "parseint_test.cpp",
83 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070084 "quick_exit_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070085 "stringprintf_test.cpp",
86 "strings_test.cpp",
87 "test_main.cpp",
88 ],
89 target: {
Elliott Hughes1e88c8c2016-09-21 16:53:15 -070090 android: {
91 srcs: ["properties_test.cpp"],
92 },
Colin Crossfc06bd02016-07-11 14:15:31 -070093 windows: {
94 srcs: ["utf8_test.cpp"],
95 enabled: true,
96 },
97 },
98 local_include_dirs: ["."],
99 cppflags: libbase_cppflags,
100 shared_libs: ["libbase"],
101 compile_multilib: "both",
102 multilib: {
103 lib32: {
104 suffix: "32",
105 },
106 lib64: {
107 suffix: "64",
108 },
109 },
110}