Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 1 | // |
| 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 | |
| 17 | libbase_cppflags = [ |
| 18 | "-Wall", |
| 19 | "-Wextra", |
| 20 | "-Werror", |
| 21 | ] |
| 22 | |
Steven Moreland | 8f56c1e | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 23 | cc_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 Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 42 | cc_library { |
| 43 | name: "libbase", |
Steven Moreland | c28517f | 2017-04-13 15:13:57 -0700 | [diff] [blame] | 44 | vendor_available: true, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 45 | clang: true, |
| 46 | host_supported: true, |
| 47 | srcs: [ |
| 48 | "file.cpp", |
| 49 | "logging.cpp", |
| 50 | "parsenetaddress.cpp", |
Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 51 | "quick_exit.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 52 | "stringprintf.cpp", |
| 53 | "strings.cpp", |
| 54 | "test_utils.cpp", |
| 55 | ], |
Steven Moreland | 8f56c1e | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 56 | |
| 57 | header_libs: ["libbase_headers"], |
| 58 | export_header_lib_headers: ["libbase_headers"], |
| 59 | |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 60 | cppflags: libbase_cppflags, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 61 | shared_libs: ["liblog"], |
| 62 | target: { |
| 63 | android: { |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 64 | srcs: [ |
| 65 | "errors_unix.cpp", |
| 66 | "properties.cpp", |
| 67 | ], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 68 | cppflags: ["-Wexit-time-destructors"], |
Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 69 | sanitize: { |
| 70 | misc_undefined: ["integer"], |
| 71 | }, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 72 | }, |
| 73 | darwin: { |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 74 | srcs: ["errors_unix.cpp"], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 75 | cppflags: ["-Wexit-time-destructors"], |
| 76 | }, |
Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 77 | linux_bionic: { |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 78 | srcs: ["errors_unix.cpp"], |
Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 79 | cppflags: ["-Wexit-time-destructors"], |
| 80 | enabled: true, |
| 81 | }, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 82 | linux: { |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 83 | srcs: ["errors_unix.cpp"], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 84 | cppflags: ["-Wexit-time-destructors"], |
| 85 | }, |
| 86 | windows: { |
| 87 | srcs: [ |
| 88 | "errors_windows.cpp", |
| 89 | "utf8.cpp", |
| 90 | ], |
| 91 | enabled: true, |
| 92 | }, |
| 93 | }, |
| 94 | } |
| 95 | |
| 96 | // Tests |
| 97 | // ------------------------------------------------------------------------------ |
| 98 | cc_test { |
| 99 | name: "libbase_test", |
| 100 | host_supported: true, |
| 101 | clang: true, |
| 102 | srcs: [ |
Elliott Hughes | 1dbd976 | 2017-02-24 14:02:05 -0800 | [diff] [blame] | 103 | "endian_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 104 | "errors_test.cpp", |
| 105 | "file_test.cpp", |
| 106 | "logging_test.cpp", |
Yabin Cui | 997cba4 | 2016-10-05 10:54:35 -0700 | [diff] [blame] | 107 | "parsedouble_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 108 | "parseint_test.cpp", |
| 109 | "parsenetaddress_test.cpp", |
Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 110 | "quick_exit_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 111 | "stringprintf_test.cpp", |
| 112 | "strings_test.cpp", |
| 113 | "test_main.cpp", |
| 114 | ], |
| 115 | target: { |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 116 | android: { |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 117 | srcs: ["properties_test.cpp"], |
Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 118 | sanitize: { |
| 119 | misc_undefined: ["integer"], |
| 120 | }, |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 121 | }, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 122 | windows: { |
| 123 | srcs: ["utf8_test.cpp"], |
| 124 | enabled: true, |
| 125 | }, |
| 126 | }, |
| 127 | local_include_dirs: ["."], |
| 128 | cppflags: libbase_cppflags, |
| 129 | shared_libs: ["libbase"], |
| 130 | compile_multilib: "both", |
| 131 | multilib: { |
| 132 | lib32: { |
| 133 | suffix: "32", |
| 134 | }, |
| 135 | lib64: { |
| 136 | suffix: "64", |
| 137 | }, |
| 138 | }, |
| 139 | } |