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 | 3c71bbd | 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 | |
Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 29 | target: { |
| 30 | linux_bionic: { |
| 31 | enabled: true, |
| 32 | }, |
| 33 | windows: { |
| 34 | enabled: true, |
| 35 | }, |
| 36 | }, |
| 37 | } |
| 38 | |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 39 | cc_library { |
| 40 | name: "libbase", |
Steven Moreland | d10a023 | 2017-04-13 15:13:57 -0700 | [diff] [blame] | 41 | vendor_available: true, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 42 | clang: true, |
| 43 | host_supported: true, |
| 44 | srcs: [ |
| 45 | "file.cpp", |
| 46 | "logging.cpp", |
| 47 | "parsenetaddress.cpp", |
Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 48 | "quick_exit.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 49 | "stringprintf.cpp", |
| 50 | "strings.cpp", |
| 51 | "test_utils.cpp", |
| 52 | ], |
Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 53 | |
Colin Cross | 4eda982 | 2017-04-18 17:42:10 -0700 | [diff] [blame] | 54 | header_libs: [ |
| 55 | "libbase_headers", |
| 56 | "libutils_headers", |
| 57 | ], |
Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 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", |
Josh Gao | 0b35b18 | 2017-05-01 21:56:28 +0000 | [diff] [blame] | 67 | "chrono_utils.cpp", |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 68 | ], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 69 | cppflags: ["-Wexit-time-destructors"], |
Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 70 | sanitize: { |
| 71 | misc_undefined: ["integer"], |
| 72 | }, |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 73 | |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 74 | }, |
| 75 | darwin: { |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 76 | srcs: [ |
Josh Gao | 0b35b18 | 2017-05-01 21:56:28 +0000 | [diff] [blame] | 77 | "chrono_utils.cpp", |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 78 | "errors_unix.cpp", |
| 79 | ], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 80 | cppflags: ["-Wexit-time-destructors"], |
| 81 | }, |
Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 82 | linux_bionic: { |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 83 | srcs: [ |
Josh Gao | 0b35b18 | 2017-05-01 21:56:28 +0000 | [diff] [blame] | 84 | "chrono_utils.cpp", |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 85 | "errors_unix.cpp", |
| 86 | ], |
Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 87 | cppflags: ["-Wexit-time-destructors"], |
| 88 | enabled: true, |
| 89 | }, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 90 | linux: { |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 91 | srcs: [ |
Josh Gao | 0b35b18 | 2017-05-01 21:56:28 +0000 | [diff] [blame] | 92 | "chrono_utils.cpp", |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 93 | "errors_unix.cpp", |
| 94 | ], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 95 | cppflags: ["-Wexit-time-destructors"], |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 96 | host_ldlibs: ["-lrt"], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 97 | }, |
| 98 | windows: { |
| 99 | srcs: [ |
| 100 | "errors_windows.cpp", |
| 101 | "utf8.cpp", |
| 102 | ], |
| 103 | enabled: true, |
| 104 | }, |
| 105 | }, |
| 106 | } |
| 107 | |
| 108 | // Tests |
| 109 | // ------------------------------------------------------------------------------ |
| 110 | cc_test { |
| 111 | name: "libbase_test", |
| 112 | host_supported: true, |
| 113 | clang: true, |
| 114 | srcs: [ |
Elliott Hughes | 1dbd976 | 2017-02-24 14:02:05 -0800 | [diff] [blame] | 115 | "endian_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 116 | "errors_test.cpp", |
| 117 | "file_test.cpp", |
| 118 | "logging_test.cpp", |
Yabin Cui | 997cba4 | 2016-10-05 10:54:35 -0700 | [diff] [blame] | 119 | "parsedouble_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 120 | "parseint_test.cpp", |
| 121 | "parsenetaddress_test.cpp", |
Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 122 | "quick_exit_test.cpp", |
Tom Cherry | c996a8e | 2017-04-05 14:15:31 -0700 | [diff] [blame] | 123 | "scopeguard_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 124 | "stringprintf_test.cpp", |
| 125 | "strings_test.cpp", |
| 126 | "test_main.cpp", |
| 127 | ], |
| 128 | target: { |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 129 | android: { |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 130 | srcs: [ |
| 131 | "chrono_utils_test.cpp", |
| 132 | "properties_test.cpp" |
| 133 | ], |
Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 134 | sanitize: { |
| 135 | misc_undefined: ["integer"], |
| 136 | }, |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 137 | }, |
James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 138 | linux: { |
| 139 | srcs: ["chrono_utils_test.cpp"], |
| 140 | host_ldlibs: ["-lrt"], |
| 141 | }, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 142 | windows: { |
| 143 | srcs: ["utf8_test.cpp"], |
| 144 | enabled: true, |
| 145 | }, |
| 146 | }, |
| 147 | local_include_dirs: ["."], |
| 148 | cppflags: libbase_cppflags, |
| 149 | shared_libs: ["libbase"], |
| 150 | compile_multilib: "both", |
| 151 | multilib: { |
| 152 | lib32: { |
| 153 | suffix: "32", |
| 154 | }, |
| 155 | lib64: { |
| 156 | suffix: "64", |
| 157 | }, |
| 158 | }, |
| 159 | } |