blob: 7bf4c79a69355b247f02d61a375edf551664d39e [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",
31 "stringprintf.cpp",
32 "strings.cpp",
33 "test_utils.cpp",
34 ],
35 local_include_dirs: ["include"],
36 cppflags: libbase_cppflags,
37 export_include_dirs: ["include"],
38 shared_libs: ["liblog"],
39 target: {
40 android: {
41 srcs: ["errors_unix.cpp"],
42 cppflags: ["-Wexit-time-destructors"],
43 },
44 darwin: {
45 srcs: ["errors_unix.cpp"],
46 cppflags: ["-Wexit-time-destructors"],
47 },
48 linux: {
49 srcs: ["errors_unix.cpp"],
50 cppflags: ["-Wexit-time-destructors"],
51 },
52 windows: {
53 srcs: [
54 "errors_windows.cpp",
55 "utf8.cpp",
56 ],
57 enabled: true,
58 },
59 },
60}
61
62// Tests
63// ------------------------------------------------------------------------------
64cc_test {
65 name: "libbase_test",
66 host_supported: true,
67 clang: true,
68 srcs: [
69 "errors_test.cpp",
70 "file_test.cpp",
71 "logging_test.cpp",
72 "parseint_test.cpp",
73 "parsenetaddress_test.cpp",
74 "stringprintf_test.cpp",
75 "strings_test.cpp",
76 "test_main.cpp",
77 ],
78 target: {
79 windows: {
80 srcs: ["utf8_test.cpp"],
81 enabled: true,
82 },
83 },
84 local_include_dirs: ["."],
85 cppflags: libbase_cppflags,
86 shared_libs: ["libbase"],
87 compile_multilib: "both",
88 multilib: {
89 lib32: {
90 suffix: "32",
91 },
92 lib64: {
93 suffix: "64",
94 },
95 },
96}