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