Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2014 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 | |
Bob Badour | e120486 | 2021-02-12 21:15:54 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["external_libcxx_license"], |
| 19 | } |
| 20 | |
| 21 | // Added automatically by a large-scale-change that took the approach of |
| 22 | // 'apply every license found to every target'. While this makes sure we respect |
| 23 | // every license restriction, it may not be entirely correct. |
| 24 | // |
| 25 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 26 | // |
| 27 | // Please consider splitting the single license below into multiple licenses, |
| 28 | // taking care not to lose any license_kind information, and overriding the |
| 29 | // default license using the 'licenses: [...]' property on targets as needed. |
| 30 | // |
| 31 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 32 | // to attach the license to, and including a comment whether the files may be |
| 33 | // used in the current project. |
| 34 | // See: http://go/android-license-faq |
| 35 | license { |
| 36 | name: "external_libcxx_license", |
| 37 | visibility: [":__subpackages__"], |
| 38 | license_kinds: [ |
| 39 | "SPDX-license-identifier-Apache-2.0", |
| 40 | "SPDX-license-identifier-BSD", |
| 41 | "SPDX-license-identifier-MIT", |
| 42 | "SPDX-license-identifier-NCSA", |
| 43 | ], |
| 44 | license_text: [ |
| 45 | "LICENSE.TXT", |
| 46 | ], |
| 47 | } |
| 48 | |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 49 | cc_defaults { |
| 50 | name: "libc++ defaults", |
| 51 | host_supported: true, |
| 52 | local_include_dirs: ["include"], |
| 53 | export_include_dirs: ["include"], |
| 54 | cflags: ["-Wall", "-Werror", "-Wno-unused-parameter"], |
| 55 | cppflags: [ |
| 56 | "-std=c++14", |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 57 | "-fexceptions", |
| 58 | "-DLIBCXX_BUILDING_LIBCXXABI", |
| 59 | "-D_LIBCPP_BUILDING_LIBRARY", |
| 60 | ], |
| 61 | rtti: true, |
| 62 | stl: "none", |
| 63 | target: { |
| 64 | linux_bionic: { |
| 65 | enabled: true, |
| 66 | }, |
| 67 | windows: { |
| 68 | enabled: true, |
| 69 | cflags: [ |
| 70 | "-D_LIBCPP_HAS_THREAD_API_WIN32", |
| 71 | "-D_LIBCXXABI_BUILDING_LIBRARY", |
| 72 | "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS", |
| 73 | "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", |
| 74 | "-UWIN32_LEAN_AND_MEAN", |
| 75 | ], |
| 76 | }, |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 77 | }, |
| 78 | } |
| 79 | |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 80 | // host + device static lib |
| 81 | cc_library_static { |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 82 | name: "libc++_static", |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 83 | defaults: ["libc++ defaults"], |
Dan Willemsen | 4cef24e | 2017-04-07 14:12:18 -0700 | [diff] [blame] | 84 | vendor_available: true, |
Justin Yun | 8b6fee8 | 2020-11-11 16:25:19 +0900 | [diff] [blame] | 85 | product_available: true, |
Yifan Hong | 5488d3c | 2020-01-21 16:44:28 -0800 | [diff] [blame] | 86 | ramdisk_available: true, |
Yifan Hong | 6086566 | 2020-10-21 18:42:18 -0700 | [diff] [blame] | 87 | vendor_ramdisk_available: true, |
Jiyong Park | bfb1424 | 2018-04-27 21:47:53 +0900 | [diff] [blame] | 88 | recovery_available: true, |
Jiyong Park | 2d6d9ab | 2020-03-07 16:40:05 +0900 | [diff] [blame] | 89 | apex_available: [ |
| 90 | "//apex_available:platform", |
| 91 | "//apex_available:anyapex", |
| 92 | ], |
Jooyung Han | f65f67c | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 93 | // being part of updatable apexes, this should work on older releases |
| 94 | min_sdk_version: "apex_inherit", |
dimitry | a44472d | 2019-05-06 12:37:14 +0200 | [diff] [blame] | 95 | native_bridge_supported: true, |
Colin Cross | 286a75e | 2015-11-19 14:23:11 -0800 | [diff] [blame] | 96 | srcs: [ |
| 97 | "src/algorithm.cpp", |
| 98 | "src/any.cpp", |
| 99 | "src/bind.cpp", |
Dan Albert | 91714f9 | 2018-12-05 16:06:16 -0800 | [diff] [blame] | 100 | "src/charconv.cpp", |
Colin Cross | 286a75e | 2015-11-19 14:23:11 -0800 | [diff] [blame] | 101 | "src/chrono.cpp", |
| 102 | "src/condition_variable.cpp", |
| 103 | "src/debug.cpp", |
| 104 | "src/exception.cpp", |
| 105 | "src/future.cpp", |
| 106 | "src/hash.cpp", |
| 107 | "src/ios.cpp", |
| 108 | "src/iostream.cpp", |
| 109 | "src/locale.cpp", |
| 110 | "src/memory.cpp", |
| 111 | "src/mutex.cpp", |
| 112 | "src/new.cpp", |
| 113 | "src/optional.cpp", |
| 114 | "src/random.cpp", |
| 115 | "src/regex.cpp", |
| 116 | "src/shared_mutex.cpp", |
| 117 | "src/stdexcept.cpp", |
| 118 | "src/string.cpp", |
| 119 | "src/strstream.cpp", |
| 120 | "src/system_error.cpp", |
| 121 | "src/thread.cpp", |
| 122 | "src/typeinfo.cpp", |
| 123 | "src/utility.cpp", |
| 124 | "src/valarray.cpp", |
Dan Albert | c0ecf33 | 2017-01-26 18:48:00 -0800 | [diff] [blame] | 125 | "src/variant.cpp", |
Dan Albert | 80bd2e4 | 2018-02-07 15:05:22 -0800 | [diff] [blame] | 126 | "src/vector.cpp", |
Colin Cross | 286a75e | 2015-11-19 14:23:11 -0800 | [diff] [blame] | 127 | ], |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 128 | whole_static_libs: [ |
| 129 | "libc++abi", |
| 130 | ], |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 131 | target: { |
Pirama Arumuga Nainar | 5383d2f | 2018-08-08 10:31:09 -0700 | [diff] [blame] | 132 | windows: { |
Pirama Arumuga Nainar | 5383d2f | 2018-08-08 10:31:09 -0700 | [diff] [blame] | 133 | srcs: [ |
| 134 | "src/support/win32/*.cpp", |
| 135 | ] |
| 136 | }, |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 137 | }, |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | // host + device dynamic lib |
| 141 | cc_library_shared { |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 142 | name: "libc++", |
Dan Willemsen | 4cef24e | 2017-04-07 14:12:18 -0700 | [diff] [blame] | 143 | host_supported: true, |
| 144 | vendor_available: true, |
Justin Yun | 8b6fee8 | 2020-11-11 16:25:19 +0900 | [diff] [blame] | 145 | product_available: true, |
dimitry | a44472d | 2019-05-06 12:37:14 +0200 | [diff] [blame] | 146 | native_bridge_supported: true, |
Justin Yun | 6e22fc8 | 2017-07-24 15:19:44 +0900 | [diff] [blame] | 147 | vndk: { |
| 148 | enabled: true, |
| 149 | support_system_process: true, |
| 150 | }, |
Yifan Hong | 5488d3c | 2020-01-21 16:44:28 -0800 | [diff] [blame] | 151 | ramdisk_available: true, |
Yifan Hong | 6086566 | 2020-10-21 18:42:18 -0700 | [diff] [blame] | 152 | vendor_ramdisk_available: true, |
Jiyong Park | bfb1424 | 2018-04-27 21:47:53 +0900 | [diff] [blame] | 153 | recovery_available: true, |
Jiyong Park | 2d6d9ab | 2020-03-07 16:40:05 +0900 | [diff] [blame] | 154 | apex_available: [ |
| 155 | "//apex_available:platform", |
| 156 | "//apex_available:anyapex", |
| 157 | ], |
Jooyung Han | f65f67c | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 158 | // being part of updatable apexes, this should work on older releases |
| 159 | min_sdk_version: "apex_inherit", |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 160 | whole_static_libs: ["libc++_static"], |
| 161 | stl: "none", |
| 162 | |
Yi Kong | c74f1b6 | 2021-02-23 20:00:37 +0800 | [diff] [blame] | 163 | pgo: { |
| 164 | sampling: true, |
| 165 | }, |
| 166 | |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 167 | target: { |
Yi Kong | c74f1b6 | 2021-02-23 20:00:37 +0800 | [diff] [blame] | 168 | android: { |
| 169 | pgo: { |
| 170 | profile_file: "libc++/libc++.profdata", |
| 171 | }, |
| 172 | }, |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 173 | darwin: { |
Dan Willemsen | e368a1f | 2015-12-04 15:50:00 -0800 | [diff] [blame] | 174 | unexported_symbols_list: "lib/libc++unexp.exp", |
| 175 | force_symbols_not_weak_list: "lib/notweak.exp", |
| 176 | force_symbols_weak_list: "lib/weak.exp", |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 177 | ldflags: [ |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 178 | "-Wl,-undefined,dynamic_lookup", |
| 179 | ], |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 180 | }, |
| 181 | |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 182 | linux_bionic: { |
| 183 | enabled: true, |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 184 | }, |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 185 | }, |
| 186 | } |
| 187 | |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 188 | cc_library_static { |
| 189 | name: "libc++experimental", |
| 190 | defaults: ["libc++ defaults"], |
| 191 | srcs: [ |
| 192 | "src/experimental/memory_resource.cpp", |
| 193 | ], |
| 194 | } |
| 195 | |
Dan Albert | eda4e91 | 2020-04-13 12:08:37 -0700 | [diff] [blame] | 196 | // Not available to vendor modules until libc++ is updated and this library is |
| 197 | // merged into libc++ proper. |
Elliott Hughes | bb48d64 | 2021-08-11 11:53:45 -0700 | [diff] [blame^] | 198 | // Follow http://b/175635923 for progress. |
Dan Albert | 4d4d6a8 | 2018-12-12 13:45:05 -0800 | [diff] [blame] | 199 | cc_library_static { |
| 200 | name: "libc++fs", |
Inseob Kim | e8660a0 | 2021-06-14 11:55:25 +0900 | [diff] [blame] | 201 | ramdisk_available: true, |
Bowgo Tsai | 9c713b6 | 2019-04-16 16:07:53 +0800 | [diff] [blame] | 202 | recovery_available: true, |
Dan Albert | 4d4d6a8 | 2018-12-12 13:45:05 -0800 | [diff] [blame] | 203 | defaults: ["libc++ defaults"], |
| 204 | srcs: [ |
| 205 | "src/filesystem/directory_iterator.cpp", |
| 206 | "src/filesystem/operations.cpp", |
| 207 | ], |
| 208 | multilib: { |
| 209 | lib32: { |
| 210 | // off_t usage is constrained to within the libc++ source (not the |
| 211 | // headers), so we can build the filesystem library with a 64-bit |
| 212 | // off_t on LP32 to get large file support without needing all users |
| 213 | // of the library to match. |
| 214 | cflags: ["-D_FILE_OFFSET_BITS=64"], |
| 215 | }, |
| 216 | }, |
| 217 | target: { |
| 218 | windows: { |
| 219 | enabled: false, |
| 220 | }, |
| 221 | }, |
| 222 | } |
| 223 | |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 224 | // This target is used to extract the build commands for a test executable. |
| 225 | // See run_tests.py. |
| 226 | cc_binary { |
| 227 | name: "libcxx_test_template", |
| 228 | srcs: [ |
| 229 | "libcxx_test_template.cpp", |
| 230 | ], |
| 231 | cppflags: [ |
| 232 | "-fsized-deallocation", |
| 233 | "-fexceptions", |
Dan Albert | fd86c1f | 2019-02-28 15:11:47 -0800 | [diff] [blame] | 234 | "-fcoroutines-ts", |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 235 | "-Wno-format-zero-length", |
| 236 | "-Wno-implicit-fallthrough", |
| 237 | "-Wno-non-virtual-dtor", |
| 238 | "-Wno-return-stack-address", |
| 239 | "-Wno-unused-local-typedef", |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 240 | |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 241 | "-UNDEBUG", |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 242 | |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 243 | // Optimization is causing relocation for nothrow new to be thrown away. |
| 244 | // http://llvm.org/bugs/show_bug.cgi?id=21421 |
| 245 | "-O0", |
| 246 | ], |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 247 | static_libs: [ |
| 248 | "libc++experimental", |
Dan Albert | 4d4d6a8 | 2018-12-12 13:45:05 -0800 | [diff] [blame] | 249 | "libc++fs", |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 250 | ], |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 251 | rtti: true, |
| 252 | local_include_dirs: [ |
| 253 | "test/support", |
| 254 | ], |
| 255 | multilib: { |
| 256 | lib32: { |
| 257 | suffix: "32", |
| 258 | }, |
| 259 | lib64: { |
| 260 | suffix: "64", |
| 261 | }, |
| 262 | }, |
| 263 | compile_multilib: "both", |
| 264 | host_supported: true, |
Elliott Hughes | 58fffb4 | 2018-12-12 09:16:09 -0800 | [diff] [blame] | 265 | target: { |
| 266 | linux: { |
| 267 | ldflags: [ |
| 268 | // This makes the tests run a little faster. |
| 269 | "-Wl,--strip-all", |
| 270 | ], |
| 271 | }, |
| 272 | }, |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 273 | gnu_extensions: false, |
| 274 | cpp_std: "c++17", |
| 275 | } |
Dan Albert | 4d4d6a8 | 2018-12-12 13:45:05 -0800 | [diff] [blame] | 276 | |
| 277 | python_test { |
| 278 | name: "filesystem_dynamic_test_helper.py", |
| 279 | main: "test/support/filesystem_dynamic_test_helper.py", |
| 280 | srcs: [ |
| 281 | "test/support/filesystem_dynamic_test_helper.py", |
| 282 | ], |
| 283 | version: { |
| 284 | py2: { |
| 285 | enabled: true, |
| 286 | embedded_launcher: true, |
| 287 | }, |
| 288 | py3: { |
| 289 | enabled: false, |
| 290 | }, |
| 291 | }, |
| 292 | } |