| 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 |  | 
| Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 17 | cc_defaults { | 
| Andreas Gampe | af05f3b | 2018-02-15 11:40:30 -0800 | [diff] [blame] | 18 | name: "libbase_cflags_defaults", | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 19 | cflags: [ | 
|  | 20 | "-Wall", | 
|  | 21 | "-Werror", | 
|  | 22 | "-Wextra", | 
| Elliott Hughes | 9082e7a | 2018-12-19 12:55:17 -0800 | [diff] [blame] | 23 | "-D_FILE_OFFSET_BITS=64", | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 24 | ], | 
| Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 25 | } | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 26 |  | 
| Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 27 | cc_library_headers { | 
|  | 28 | name: "libbase_headers", | 
|  | 29 | vendor_available: true, | 
| Jiyong Park | 612210c | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 30 | recovery_available: true, | 
| Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 31 | host_supported: true, | 
|  | 32 | export_include_dirs: ["include"], | 
|  | 33 |  | 
| Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 34 | target: { | 
|  | 35 | linux_bionic: { | 
|  | 36 | enabled: true, | 
|  | 37 | }, | 
|  | 38 | windows: { | 
|  | 39 | enabled: true, | 
|  | 40 | }, | 
|  | 41 | }, | 
|  | 42 | } | 
|  | 43 |  | 
| Andreas Gampe | af05f3b | 2018-02-15 11:40:30 -0800 | [diff] [blame] | 44 | cc_defaults { | 
|  | 45 | name: "libbase_defaults", | 
|  | 46 | defaults: ["libbase_cflags_defaults"], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 47 | srcs: [ | 
| Mark Salyzyn | 0c071c9 | 2018-02-05 07:41:31 -0800 | [diff] [blame] | 48 | "chrono_utils.cpp", | 
| Josh Gao | 14f9500 | 2019-01-07 19:16:21 -0800 | [diff] [blame] | 49 | "cmsg.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 50 | "file.cpp", | 
|  | 51 | "logging.cpp", | 
| Elliott Hughes | e8f4b14 | 2018-10-19 16:09:39 -0700 | [diff] [blame] | 52 | "mapped_file.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 53 | "parsenetaddress.cpp", | 
| Elliott Hughes | dc80312 | 2018-05-24 18:00:39 -0700 | [diff] [blame] | 54 | "properties.cpp", | 
| Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 55 | "quick_exit.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 56 | "stringprintf.cpp", | 
|  | 57 | "strings.cpp", | 
| Josh Gao | 5791e21 | 2018-03-16 14:25:42 -0700 | [diff] [blame] | 58 | "threads.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 59 | "test_utils.cpp", | 
|  | 60 | ], | 
| Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 61 |  | 
| Pirama Arumuga Nainar | ca6ee83 | 2018-09-26 23:31:00 -0700 | [diff] [blame] | 62 | cppflags: ["-Wexit-time-destructors"], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 63 | shared_libs: ["liblog"], | 
|  | 64 | target: { | 
|  | 65 | android: { | 
| Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 66 | sanitize: { | 
|  | 67 | misc_undefined: ["integer"], | 
|  | 68 | }, | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 69 |  | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 70 | }, | 
| Dan Willemsen | bdddcab | 2017-10-03 14:17:31 -0700 | [diff] [blame] | 71 | linux: { | 
|  | 72 | srcs: [ | 
| Dan Willemsen | bdddcab | 2017-10-03 14:17:31 -0700 | [diff] [blame] | 73 | "errors_unix.cpp", | 
|  | 74 | ], | 
| Dan Willemsen | bdddcab | 2017-10-03 14:17:31 -0700 | [diff] [blame] | 75 | }, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 76 | darwin: { | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 77 | srcs: [ | 
| 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 | }, | 
| Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 81 | linux_bionic: { | 
| Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 82 | enabled: true, | 
|  | 83 | }, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 84 | windows: { | 
|  | 85 | srcs: [ | 
|  | 86 | "errors_windows.cpp", | 
|  | 87 | "utf8.cpp", | 
|  | 88 | ], | 
| Josh Gao | 14f9500 | 2019-01-07 19:16:21 -0800 | [diff] [blame] | 89 | exclude_srcs: [ | 
|  | 90 | "cmsg.cpp", | 
|  | 91 | ], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 92 | enabled: true, | 
|  | 93 | }, | 
|  | 94 | }, | 
|  | 95 | } | 
|  | 96 |  | 
| Andreas Gampe | af05f3b | 2018-02-15 11:40:30 -0800 | [diff] [blame] | 97 | cc_library { | 
|  | 98 | name: "libbase", | 
|  | 99 | defaults: ["libbase_defaults"], | 
|  | 100 | vendor_available: true, | 
| Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 101 | recovery_available: true, | 
| Andreas Gampe | af05f3b | 2018-02-15 11:40:30 -0800 | [diff] [blame] | 102 | host_supported: true, | 
|  | 103 | vndk: { | 
|  | 104 | enabled: true, | 
|  | 105 | support_system_process: true, | 
|  | 106 | }, | 
|  | 107 | header_libs: [ | 
|  | 108 | "libbase_headers", | 
|  | 109 | ], | 
|  | 110 | export_header_lib_headers: ["libbase_headers"], | 
|  | 111 | } | 
|  | 112 |  | 
|  | 113 | cc_library_static { | 
|  | 114 | name: "libbase_ndk", | 
|  | 115 | defaults: ["libbase_defaults"], | 
|  | 116 | sdk_version: "current", | 
|  | 117 | stl: "c++_static", | 
|  | 118 | export_include_dirs: ["include"], | 
|  | 119 | } | 
|  | 120 |  | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 121 | // Tests | 
|  | 122 | // ------------------------------------------------------------------------------ | 
|  | 123 | cc_test { | 
|  | 124 | name: "libbase_test", | 
| Andreas Gampe | af05f3b | 2018-02-15 11:40:30 -0800 | [diff] [blame] | 125 | defaults: ["libbase_cflags_defaults"], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 126 | host_supported: true, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 127 | srcs: [ | 
| Josh Gao | 14f9500 | 2019-01-07 19:16:21 -0800 | [diff] [blame] | 128 | "cmsg_test.cpp", | 
| Elliott Hughes | 1dbd976 | 2017-02-24 14:02:05 -0800 | [diff] [blame] | 129 | "endian_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 130 | "errors_test.cpp", | 
|  | 131 | "file_test.cpp", | 
|  | 132 | "logging_test.cpp", | 
| Elliott Hughes | 1b86d41 | 2018-04-06 17:45:22 -0700 | [diff] [blame] | 133 | "macros_test.cpp", | 
| Elliott Hughes | e8f4b14 | 2018-10-19 16:09:39 -0700 | [diff] [blame] | 134 | "mapped_file_test.cpp", | 
| Yabin Cui | 997cba4 | 2016-10-05 10:54:35 -0700 | [diff] [blame] | 135 | "parsedouble_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 136 | "parseint_test.cpp", | 
|  | 137 | "parsenetaddress_test.cpp", | 
| Elliott Hughes | dc80312 | 2018-05-24 18:00:39 -0700 | [diff] [blame] | 138 | "properties_test.cpp", | 
| Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 139 | "quick_exit_test.cpp", | 
| Tom Cherry | c996a8e | 2017-04-05 14:15:31 -0700 | [diff] [blame] | 140 | "scopeguard_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 141 | "stringprintf_test.cpp", | 
|  | 142 | "strings_test.cpp", | 
|  | 143 | "test_main.cpp", | 
| Josh Gao | 30171a8 | 2017-04-27 19:48:44 -0700 | [diff] [blame] | 144 | "test_utils_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 145 | ], | 
|  | 146 | target: { | 
| Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 147 | android: { | 
| Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 148 | sanitize: { | 
|  | 149 | misc_undefined: ["integer"], | 
|  | 150 | }, | 
| Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 151 | }, | 
| Dan Willemsen | bdddcab | 2017-10-03 14:17:31 -0700 | [diff] [blame] | 152 | linux: { | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 153 | srcs: ["chrono_utils_test.cpp"], | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 154 | }, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 155 | windows: { | 
|  | 156 | srcs: ["utf8_test.cpp"], | 
| Dan Willemsen | 528f144 | 2017-11-29 18:06:11 -0800 | [diff] [blame] | 157 | cflags: ["-Wno-unused-parameter"], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 158 | enabled: true, | 
|  | 159 | }, | 
|  | 160 | }, | 
|  | 161 | local_include_dirs: ["."], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 162 | shared_libs: ["libbase"], | 
|  | 163 | compile_multilib: "both", | 
|  | 164 | multilib: { | 
|  | 165 | lib32: { | 
|  | 166 | suffix: "32", | 
|  | 167 | }, | 
|  | 168 | lib64: { | 
|  | 169 | suffix: "64", | 
|  | 170 | }, | 
|  | 171 | }, | 
| Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 172 | test_suites: ["device-tests"], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 173 | } |