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