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