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