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