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