| 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 |  | 
|  | 17 | libbase_cppflags = [ | 
|  | 18 | "-Wall", | 
|  | 19 | "-Wextra", | 
|  | 20 | "-Werror", | 
|  | 21 | ] | 
|  | 22 |  | 
| Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 23 | cc_library_headers { | 
|  | 24 | name: "libbase_headers", | 
|  | 25 | vendor_available: true, | 
|  | 26 | host_supported: true, | 
|  | 27 | export_include_dirs: ["include"], | 
|  | 28 |  | 
| Steven Moreland | 3c71bbd | 2017-04-14 00:54:46 -0700 | [diff] [blame] | 29 | target: { | 
|  | 30 | linux_bionic: { | 
|  | 31 | enabled: true, | 
|  | 32 | }, | 
|  | 33 | windows: { | 
|  | 34 | enabled: true, | 
|  | 35 | }, | 
|  | 36 | }, | 
|  | 37 | } | 
|  | 38 |  | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 39 | cc_library { | 
|  | 40 | name: "libbase", | 
| 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 | aeb68e8 | 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 | cppflags: libbase_cppflags, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 63 | shared_libs: ["liblog"], | 
|  | 64 | target: { | 
|  | 65 | android: { | 
| Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 66 | srcs: [ | 
|  | 67 | "errors_unix.cpp", | 
|  | 68 | "properties.cpp", | 
| Josh Gao | 0b35b18 | 2017-05-01 21:56:28 +0000 | [diff] [blame] | 69 | "chrono_utils.cpp", | 
| Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 70 | ], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 71 | cppflags: ["-Wexit-time-destructors"], | 
| Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 72 | sanitize: { | 
|  | 73 | misc_undefined: ["integer"], | 
|  | 74 | }, | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 75 |  | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 76 | }, | 
|  | 77 | darwin: { | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 78 | srcs: [ | 
| Josh Gao | 0b35b18 | 2017-05-01 21:56:28 +0000 | [diff] [blame] | 79 | "chrono_utils.cpp", | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 80 | "errors_unix.cpp", | 
|  | 81 | ], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 82 | cppflags: ["-Wexit-time-destructors"], | 
|  | 83 | }, | 
| Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 84 | linux_bionic: { | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 85 | srcs: [ | 
| Josh Gao | 0b35b18 | 2017-05-01 21:56:28 +0000 | [diff] [blame] | 86 | "chrono_utils.cpp", | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 87 | "errors_unix.cpp", | 
|  | 88 | ], | 
| Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 89 | cppflags: ["-Wexit-time-destructors"], | 
|  | 90 | enabled: true, | 
|  | 91 | }, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 92 | linux: { | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 93 | srcs: [ | 
| Josh Gao | 0b35b18 | 2017-05-01 21:56:28 +0000 | [diff] [blame] | 94 | "chrono_utils.cpp", | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 95 | "errors_unix.cpp", | 
|  | 96 | ], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 97 | cppflags: ["-Wexit-time-destructors"], | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 98 | host_ldlibs: ["-lrt"], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 99 | }, | 
|  | 100 | windows: { | 
|  | 101 | srcs: [ | 
|  | 102 | "errors_windows.cpp", | 
|  | 103 | "utf8.cpp", | 
|  | 104 | ], | 
|  | 105 | enabled: true, | 
|  | 106 | }, | 
|  | 107 | }, | 
|  | 108 | } | 
|  | 109 |  | 
|  | 110 | // Tests | 
|  | 111 | // ------------------------------------------------------------------------------ | 
|  | 112 | cc_test { | 
|  | 113 | name: "libbase_test", | 
|  | 114 | host_supported: true, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 115 | srcs: [ | 
| Elliott Hughes | 1dbd976 | 2017-02-24 14:02:05 -0800 | [diff] [blame] | 116 | "endian_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 117 | "errors_test.cpp", | 
|  | 118 | "file_test.cpp", | 
|  | 119 | "logging_test.cpp", | 
| Yabin Cui | 997cba4 | 2016-10-05 10:54:35 -0700 | [diff] [blame] | 120 | "parsedouble_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 121 | "parseint_test.cpp", | 
|  | 122 | "parsenetaddress_test.cpp", | 
| Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 123 | "quick_exit_test.cpp", | 
| Tom Cherry | c996a8e | 2017-04-05 14:15:31 -0700 | [diff] [blame] | 124 | "scopeguard_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 125 | "stringprintf_test.cpp", | 
|  | 126 | "strings_test.cpp", | 
|  | 127 | "test_main.cpp", | 
|  | 128 | ], | 
|  | 129 | target: { | 
| Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 130 | android: { | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 131 | srcs: [ | 
|  | 132 | "chrono_utils_test.cpp", | 
|  | 133 | "properties_test.cpp" | 
|  | 134 | ], | 
| Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 135 | sanitize: { | 
|  | 136 | misc_undefined: ["integer"], | 
|  | 137 | }, | 
| Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 138 | }, | 
| James Hawkins | e78ea77 | 2017-03-24 11:43:02 -0700 | [diff] [blame] | 139 | linux: { | 
|  | 140 | srcs: ["chrono_utils_test.cpp"], | 
|  | 141 | host_ldlibs: ["-lrt"], | 
|  | 142 | }, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 143 | windows: { | 
|  | 144 | srcs: ["utf8_test.cpp"], | 
|  | 145 | enabled: true, | 
|  | 146 | }, | 
|  | 147 | }, | 
|  | 148 | local_include_dirs: ["."], | 
|  | 149 | cppflags: libbase_cppflags, | 
|  | 150 | shared_libs: ["libbase"], | 
|  | 151 | compile_multilib: "both", | 
|  | 152 | multilib: { | 
|  | 153 | lib32: { | 
|  | 154 | suffix: "32", | 
|  | 155 | }, | 
|  | 156 | lib64: { | 
|  | 157 | suffix: "64", | 
|  | 158 | }, | 
|  | 159 | }, | 
|  | 160 | } |