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 | |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 17 | cc_defaults { |
| 18 | name: "libc++ defaults", |
| 19 | host_supported: true, |
| 20 | local_include_dirs: ["include"], |
| 21 | export_include_dirs: ["include"], |
| 22 | cflags: ["-Wall", "-Werror", "-Wno-unused-parameter"], |
| 23 | cppflags: [ |
| 24 | "-std=c++14", |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 25 | "-fexceptions", |
| 26 | "-DLIBCXX_BUILDING_LIBCXXABI", |
| 27 | "-D_LIBCPP_BUILDING_LIBRARY", |
| 28 | ], |
| 29 | rtti: true, |
| 30 | stl: "none", |
| 31 | target: { |
| 32 | linux_bionic: { |
| 33 | enabled: true, |
| 34 | }, |
| 35 | windows: { |
| 36 | enabled: true, |
| 37 | cflags: [ |
| 38 | "-D_LIBCPP_HAS_THREAD_API_WIN32", |
| 39 | "-D_LIBCXXABI_BUILDING_LIBRARY", |
| 40 | "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS", |
| 41 | "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", |
| 42 | "-UWIN32_LEAN_AND_MEAN", |
| 43 | ], |
| 44 | }, |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 45 | }, |
| 46 | } |
| 47 | |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 48 | // host + device static lib |
| 49 | cc_library_static { |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 50 | name: "libc++_static", |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 51 | defaults: ["libc++ defaults"], |
Dan Willemsen | 4cef24e | 2017-04-07 14:12:18 -0700 | [diff] [blame] | 52 | vendor_available: true, |
Justin Yun | 8b6fee8 | 2020-11-11 16:25:19 +0900 | [diff] [blame^] | 53 | product_available: true, |
Yifan Hong | 5488d3c | 2020-01-21 16:44:28 -0800 | [diff] [blame] | 54 | ramdisk_available: true, |
Yifan Hong | 6086566 | 2020-10-21 18:42:18 -0700 | [diff] [blame] | 55 | vendor_ramdisk_available: true, |
Jiyong Park | bfb1424 | 2018-04-27 21:47:53 +0900 | [diff] [blame] | 56 | recovery_available: true, |
Jiyong Park | 2d6d9ab | 2020-03-07 16:40:05 +0900 | [diff] [blame] | 57 | apex_available: [ |
| 58 | "//apex_available:platform", |
| 59 | "//apex_available:anyapex", |
| 60 | ], |
Jooyung Han | f65f67c | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 61 | // being part of updatable apexes, this should work on older releases |
| 62 | min_sdk_version: "apex_inherit", |
dimitry | a44472d | 2019-05-06 12:37:14 +0200 | [diff] [blame] | 63 | native_bridge_supported: true, |
Colin Cross | 286a75e | 2015-11-19 14:23:11 -0800 | [diff] [blame] | 64 | srcs: [ |
| 65 | "src/algorithm.cpp", |
| 66 | "src/any.cpp", |
| 67 | "src/bind.cpp", |
Dan Albert | 91714f9 | 2018-12-05 16:06:16 -0800 | [diff] [blame] | 68 | "src/charconv.cpp", |
Colin Cross | 286a75e | 2015-11-19 14:23:11 -0800 | [diff] [blame] | 69 | "src/chrono.cpp", |
| 70 | "src/condition_variable.cpp", |
| 71 | "src/debug.cpp", |
| 72 | "src/exception.cpp", |
| 73 | "src/future.cpp", |
| 74 | "src/hash.cpp", |
| 75 | "src/ios.cpp", |
| 76 | "src/iostream.cpp", |
| 77 | "src/locale.cpp", |
| 78 | "src/memory.cpp", |
| 79 | "src/mutex.cpp", |
| 80 | "src/new.cpp", |
| 81 | "src/optional.cpp", |
| 82 | "src/random.cpp", |
| 83 | "src/regex.cpp", |
| 84 | "src/shared_mutex.cpp", |
| 85 | "src/stdexcept.cpp", |
| 86 | "src/string.cpp", |
| 87 | "src/strstream.cpp", |
| 88 | "src/system_error.cpp", |
| 89 | "src/thread.cpp", |
| 90 | "src/typeinfo.cpp", |
| 91 | "src/utility.cpp", |
| 92 | "src/valarray.cpp", |
Dan Albert | c0ecf33 | 2017-01-26 18:48:00 -0800 | [diff] [blame] | 93 | "src/variant.cpp", |
Dan Albert | 80bd2e4 | 2018-02-07 15:05:22 -0800 | [diff] [blame] | 94 | "src/vector.cpp", |
Colin Cross | 286a75e | 2015-11-19 14:23:11 -0800 | [diff] [blame] | 95 | ], |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 96 | whole_static_libs: [ |
| 97 | "libc++abi", |
| 98 | ], |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 99 | target: { |
Pirama Arumuga Nainar | 5383d2f | 2018-08-08 10:31:09 -0700 | [diff] [blame] | 100 | windows: { |
Pirama Arumuga Nainar | 5383d2f | 2018-08-08 10:31:09 -0700 | [diff] [blame] | 101 | srcs: [ |
| 102 | "src/support/win32/*.cpp", |
| 103 | ] |
| 104 | }, |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 105 | }, |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | // host + device dynamic lib |
| 109 | cc_library_shared { |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 110 | name: "libc++", |
Dan Willemsen | 4cef24e | 2017-04-07 14:12:18 -0700 | [diff] [blame] | 111 | host_supported: true, |
| 112 | vendor_available: true, |
Justin Yun | 8b6fee8 | 2020-11-11 16:25:19 +0900 | [diff] [blame^] | 113 | product_available: true, |
dimitry | a44472d | 2019-05-06 12:37:14 +0200 | [diff] [blame] | 114 | native_bridge_supported: true, |
Justin Yun | 6e22fc8 | 2017-07-24 15:19:44 +0900 | [diff] [blame] | 115 | vndk: { |
| 116 | enabled: true, |
| 117 | support_system_process: true, |
| 118 | }, |
Yifan Hong | 5488d3c | 2020-01-21 16:44:28 -0800 | [diff] [blame] | 119 | ramdisk_available: true, |
Yifan Hong | 6086566 | 2020-10-21 18:42:18 -0700 | [diff] [blame] | 120 | vendor_ramdisk_available: true, |
Jiyong Park | bfb1424 | 2018-04-27 21:47:53 +0900 | [diff] [blame] | 121 | recovery_available: true, |
Jiyong Park | 2d6d9ab | 2020-03-07 16:40:05 +0900 | [diff] [blame] | 122 | apex_available: [ |
| 123 | "//apex_available:platform", |
| 124 | "//apex_available:anyapex", |
| 125 | ], |
Jooyung Han | f65f67c | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 126 | // being part of updatable apexes, this should work on older releases |
| 127 | min_sdk_version: "apex_inherit", |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 128 | whole_static_libs: ["libc++_static"], |
| 129 | stl: "none", |
| 130 | |
| 131 | target: { |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 132 | darwin: { |
Dan Willemsen | e368a1f | 2015-12-04 15:50:00 -0800 | [diff] [blame] | 133 | unexported_symbols_list: "lib/libc++unexp.exp", |
| 134 | force_symbols_not_weak_list: "lib/notweak.exp", |
| 135 | force_symbols_weak_list: "lib/weak.exp", |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 136 | ldflags: [ |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 137 | "-Wl,-undefined,dynamic_lookup", |
| 138 | ], |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 139 | }, |
| 140 | |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 141 | linux_bionic: { |
| 142 | enabled: true, |
Dan Willemsen | eab4a7b | 2016-11-04 12:26:27 -0700 | [diff] [blame] | 143 | }, |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 144 | }, |
| 145 | } |
| 146 | |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 147 | cc_library_static { |
| 148 | name: "libc++experimental", |
| 149 | defaults: ["libc++ defaults"], |
| 150 | srcs: [ |
| 151 | "src/experimental/memory_resource.cpp", |
| 152 | ], |
| 153 | } |
| 154 | |
Dan Albert | eda4e91 | 2020-04-13 12:08:37 -0700 | [diff] [blame] | 155 | // Not available to vendor modules until libc++ is updated and this library is |
| 156 | // merged into libc++ proper. |
| 157 | // https://issuetracker.google.com/147469372 |
Dan Albert | 4d4d6a8 | 2018-12-12 13:45:05 -0800 | [diff] [blame] | 158 | cc_library_static { |
| 159 | name: "libc++fs", |
Bowgo Tsai | 9c713b6 | 2019-04-16 16:07:53 +0800 | [diff] [blame] | 160 | recovery_available: true, |
Dan Albert | 4d4d6a8 | 2018-12-12 13:45:05 -0800 | [diff] [blame] | 161 | defaults: ["libc++ defaults"], |
| 162 | srcs: [ |
| 163 | "src/filesystem/directory_iterator.cpp", |
| 164 | "src/filesystem/operations.cpp", |
| 165 | ], |
| 166 | multilib: { |
| 167 | lib32: { |
| 168 | // off_t usage is constrained to within the libc++ source (not the |
| 169 | // headers), so we can build the filesystem library with a 64-bit |
| 170 | // off_t on LP32 to get large file support without needing all users |
| 171 | // of the library to match. |
| 172 | cflags: ["-D_FILE_OFFSET_BITS=64"], |
| 173 | }, |
| 174 | }, |
| 175 | target: { |
| 176 | windows: { |
| 177 | enabled: false, |
| 178 | }, |
| 179 | }, |
| 180 | } |
| 181 | |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 182 | // This target is used to extract the build commands for a test executable. |
| 183 | // See run_tests.py. |
| 184 | cc_binary { |
| 185 | name: "libcxx_test_template", |
| 186 | srcs: [ |
| 187 | "libcxx_test_template.cpp", |
| 188 | ], |
| 189 | cppflags: [ |
| 190 | "-fsized-deallocation", |
| 191 | "-fexceptions", |
Dan Albert | fd86c1f | 2019-02-28 15:11:47 -0800 | [diff] [blame] | 192 | "-fcoroutines-ts", |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 193 | "-Wno-format-zero-length", |
| 194 | "-Wno-implicit-fallthrough", |
| 195 | "-Wno-non-virtual-dtor", |
| 196 | "-Wno-return-stack-address", |
| 197 | "-Wno-unused-local-typedef", |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 198 | |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 199 | "-UNDEBUG", |
Dan Willemsen | 00e6a4f | 2015-09-11 13:07:33 -0700 | [diff] [blame] | 200 | |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 201 | // Optimization is causing relocation for nothrow new to be thrown away. |
| 202 | // http://llvm.org/bugs/show_bug.cgi?id=21421 |
| 203 | "-O0", |
| 204 | ], |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 205 | static_libs: [ |
| 206 | "libc++experimental", |
Dan Albert | 4d4d6a8 | 2018-12-12 13:45:05 -0800 | [diff] [blame] | 207 | "libc++fs", |
Dan Albert | fc8f268 | 2018-12-06 13:57:32 -0800 | [diff] [blame] | 208 | ], |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 209 | rtti: true, |
| 210 | local_include_dirs: [ |
| 211 | "test/support", |
| 212 | ], |
| 213 | multilib: { |
| 214 | lib32: { |
| 215 | suffix: "32", |
| 216 | }, |
| 217 | lib64: { |
| 218 | suffix: "64", |
| 219 | }, |
| 220 | }, |
| 221 | compile_multilib: "both", |
| 222 | host_supported: true, |
Elliott Hughes | 58fffb4 | 2018-12-12 09:16:09 -0800 | [diff] [blame] | 223 | target: { |
| 224 | linux: { |
| 225 | ldflags: [ |
| 226 | // This makes the tests run a little faster. |
| 227 | "-Wl,--strip-all", |
| 228 | ], |
| 229 | }, |
| 230 | }, |
Peter Collingbourne | 26cd9b8 | 2018-11-30 20:29:22 -0800 | [diff] [blame] | 231 | gnu_extensions: false, |
| 232 | cpp_std: "c++17", |
| 233 | } |
Dan Albert | 4d4d6a8 | 2018-12-12 13:45:05 -0800 | [diff] [blame] | 234 | |
| 235 | python_test { |
| 236 | name: "filesystem_dynamic_test_helper.py", |
| 237 | main: "test/support/filesystem_dynamic_test_helper.py", |
| 238 | srcs: [ |
| 239 | "test/support/filesystem_dynamic_test_helper.py", |
| 240 | ], |
| 241 | version: { |
| 242 | py2: { |
| 243 | enabled: true, |
| 244 | embedded_launcher: true, |
| 245 | }, |
| 246 | py3: { |
| 247 | enabled: false, |
| 248 | }, |
| 249 | }, |
| 250 | } |