blob: e2604120dfbbabdfa5440e0e3e988fe518215cb5 [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: {
42 srcs: ["errors_unix.cpp"],
43 cppflags: ["-Wexit-time-destructors"],
44 },
45 darwin: {
46 srcs: ["errors_unix.cpp"],
47 cppflags: ["-Wexit-time-destructors"],
48 },
49 linux: {
50 srcs: ["errors_unix.cpp"],
51 cppflags: ["-Wexit-time-destructors"],
52 },
53 windows: {
54 srcs: [
55 "errors_windows.cpp",
56 "utf8.cpp",
57 ],
58 enabled: true,
59 },
60 },
61}
62
63// Tests
64// ------------------------------------------------------------------------------
65cc_test {
66 name: "libbase_test",
67 host_supported: true,
68 clang: true,
69 srcs: [
70 "errors_test.cpp",
71 "file_test.cpp",
72 "logging_test.cpp",
73 "parseint_test.cpp",
74 "parsenetaddress_test.cpp",
Josh Gao0c442562016-09-13 14:50:57 -070075 "quick_exit_test.cpp",
Colin Crossfc06bd02016-07-11 14:15:31 -070076 "stringprintf_test.cpp",
77 "strings_test.cpp",
78 "test_main.cpp",
79 ],
80 target: {
81 windows: {
82 srcs: ["utf8_test.cpp"],
83 enabled: true,
84 },
85 },
86 local_include_dirs: ["."],
87 cppflags: libbase_cppflags,
88 shared_libs: ["libbase"],
89 compile_multilib: "both",
90 multilib: {
91 lib32: {
92 suffix: "32",
93 },
94 lib64: {
95 suffix: "64",
96 },
97 },
98}