blob: c6f65be469301ddb583c8a14163fa4c8c1d2aead [file] [log] [blame]
Dan Willemsen00e6a4f2015-09-11 13:07:33 -07001//
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 Albertfc8f2682018-12-06 13:57:32 -080017cc_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 Albertfc8f2682018-12-06 13:57:32 -080025 "-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 Willemsen00e6a4f2015-09-11 13:07:33 -070053// host + device static lib
54cc_library_static {
Dan Willemsen00e6a4f2015-09-11 13:07:33 -070055 name: "libc++_static",
Dan Albertfc8f2682018-12-06 13:57:32 -080056 defaults: ["libc++ defaults"],
Dan Willemsen4cef24e2017-04-07 14:12:18 -070057 vendor_available: true,
Yifan Hong5488d3c2020-01-21 16:44:28 -080058 ramdisk_available: true,
Jiyong Parkbfb14242018-04-27 21:47:53 +090059 recovery_available: true,
Jiyong Park2d6d9ab2020-03-07 16:40:05 +090060 apex_available: [
61 "//apex_available:platform",
62 "//apex_available:anyapex",
63 ],
dimitrya44472d2019-05-06 12:37:14 +020064 native_bridge_supported: true,
Colin Cross286a75e2015-11-19 14:23:11 -080065 srcs: [
66 "src/algorithm.cpp",
67 "src/any.cpp",
68 "src/bind.cpp",
Dan Albert91714f92018-12-05 16:06:16 -080069 "src/charconv.cpp",
Colin Cross286a75e2015-11-19 14:23:11 -080070 "src/chrono.cpp",
71 "src/condition_variable.cpp",
72 "src/debug.cpp",
73 "src/exception.cpp",
74 "src/future.cpp",
75 "src/hash.cpp",
76 "src/ios.cpp",
77 "src/iostream.cpp",
78 "src/locale.cpp",
79 "src/memory.cpp",
80 "src/mutex.cpp",
81 "src/new.cpp",
82 "src/optional.cpp",
83 "src/random.cpp",
84 "src/regex.cpp",
85 "src/shared_mutex.cpp",
86 "src/stdexcept.cpp",
87 "src/string.cpp",
88 "src/strstream.cpp",
89 "src/system_error.cpp",
90 "src/thread.cpp",
91 "src/typeinfo.cpp",
92 "src/utility.cpp",
93 "src/valarray.cpp",
Dan Albertc0ecf332017-01-26 18:48:00 -080094 "src/variant.cpp",
Dan Albert80bd2e42018-02-07 15:05:22 -080095 "src/vector.cpp",
Colin Cross286a75e2015-11-19 14:23:11 -080096 ],
Dan Willemsen00e6a4f2015-09-11 13:07:33 -070097 whole_static_libs: [
98 "libc++abi",
99 ],
Dan Willemseneab4a7b2016-11-04 12:26:27 -0700100 target: {
Pirama Arumuga Nainar5383d2f2018-08-08 10:31:09 -0700101 windows: {
Pirama Arumuga Nainar5383d2f2018-08-08 10:31:09 -0700102 srcs: [
103 "src/support/win32/*.cpp",
104 ]
105 },
Dan Willemseneab4a7b2016-11-04 12:26:27 -0700106 },
Dan Willemsen00e6a4f2015-09-11 13:07:33 -0700107}
108
109// host + device dynamic lib
110cc_library_shared {
Dan Willemsen00e6a4f2015-09-11 13:07:33 -0700111 name: "libc++",
Dan Willemsen4cef24e2017-04-07 14:12:18 -0700112 host_supported: true,
113 vendor_available: true,
dimitrya44472d2019-05-06 12:37:14 +0200114 native_bridge_supported: true,
Justin Yun6e22fc82017-07-24 15:19:44 +0900115 vndk: {
116 enabled: true,
117 support_system_process: true,
118 },
Yifan Hong5488d3c2020-01-21 16:44:28 -0800119 ramdisk_available: true,
Jiyong Parkbfb14242018-04-27 21:47:53 +0900120 recovery_available: true,
Jiyong Park2d6d9ab2020-03-07 16:40:05 +0900121 apex_available: [
122 "//apex_available:platform",
123 "//apex_available:anyapex",
124 ],
Dan Willemsen00e6a4f2015-09-11 13:07:33 -0700125 whole_static_libs: ["libc++_static"],
126 stl: "none",
127
128 target: {
Dan Willemsen00e6a4f2015-09-11 13:07:33 -0700129 darwin: {
Dan Willemsene368a1f2015-12-04 15:50:00 -0800130 unexported_symbols_list: "lib/libc++unexp.exp",
131 force_symbols_not_weak_list: "lib/notweak.exp",
132 force_symbols_weak_list: "lib/weak.exp",
Dan Willemseneab4a7b2016-11-04 12:26:27 -0700133 ldflags: [
Dan Willemseneab4a7b2016-11-04 12:26:27 -0700134 "-Wl,-undefined,dynamic_lookup",
135 ],
Dan Willemsen00e6a4f2015-09-11 13:07:33 -0700136 },
137
Dan Willemseneab4a7b2016-11-04 12:26:27 -0700138 linux_bionic: {
139 enabled: true,
Dan Willemseneab4a7b2016-11-04 12:26:27 -0700140 },
Dan Willemsen00e6a4f2015-09-11 13:07:33 -0700141 },
142}
143
Dan Albertfc8f2682018-12-06 13:57:32 -0800144cc_library_static {
145 name: "libc++experimental",
146 defaults: ["libc++ defaults"],
147 srcs: [
148 "src/experimental/memory_resource.cpp",
149 ],
150}
151
Dan Albert4d4d6a82018-12-12 13:45:05 -0800152cc_library_static {
153 name: "libc++fs",
Bowgo Tsai9c713b62019-04-16 16:07:53 +0800154 recovery_available: true,
Dan Albert4d4d6a82018-12-12 13:45:05 -0800155 defaults: ["libc++ defaults"],
156 srcs: [
157 "src/filesystem/directory_iterator.cpp",
158 "src/filesystem/operations.cpp",
159 ],
160 multilib: {
161 lib32: {
162 // off_t usage is constrained to within the libc++ source (not the
163 // headers), so we can build the filesystem library with a 64-bit
164 // off_t on LP32 to get large file support without needing all users
165 // of the library to match.
166 cflags: ["-D_FILE_OFFSET_BITS=64"],
167 },
168 },
169 target: {
170 windows: {
171 enabled: false,
172 },
173 },
174}
175
Peter Collingbourne26cd9b82018-11-30 20:29:22 -0800176// This target is used to extract the build commands for a test executable.
177// See run_tests.py.
178cc_binary {
179 name: "libcxx_test_template",
180 srcs: [
181 "libcxx_test_template.cpp",
182 ],
183 cppflags: [
184 "-fsized-deallocation",
185 "-fexceptions",
Dan Albertfd86c1f2019-02-28 15:11:47 -0800186 "-fcoroutines-ts",
Peter Collingbourne26cd9b82018-11-30 20:29:22 -0800187 "-Wno-format-zero-length",
188 "-Wno-implicit-fallthrough",
189 "-Wno-non-virtual-dtor",
190 "-Wno-return-stack-address",
191 "-Wno-unused-local-typedef",
Dan Willemsen00e6a4f2015-09-11 13:07:33 -0700192
Peter Collingbourne26cd9b82018-11-30 20:29:22 -0800193 "-UNDEBUG",
Dan Willemsen00e6a4f2015-09-11 13:07:33 -0700194
Peter Collingbourne26cd9b82018-11-30 20:29:22 -0800195 // Optimization is causing relocation for nothrow new to be thrown away.
196 // http://llvm.org/bugs/show_bug.cgi?id=21421
197 "-O0",
198 ],
Dan Albertfc8f2682018-12-06 13:57:32 -0800199 static_libs: [
200 "libc++experimental",
Dan Albert4d4d6a82018-12-12 13:45:05 -0800201 "libc++fs",
Dan Albertfc8f2682018-12-06 13:57:32 -0800202 ],
Peter Collingbourne26cd9b82018-11-30 20:29:22 -0800203 rtti: true,
204 local_include_dirs: [
205 "test/support",
206 ],
207 multilib: {
208 lib32: {
209 suffix: "32",
210 },
211 lib64: {
212 suffix: "64",
213 },
214 },
215 compile_multilib: "both",
216 host_supported: true,
Elliott Hughes58fffb42018-12-12 09:16:09 -0800217 target: {
218 linux: {
219 ldflags: [
220 // This makes the tests run a little faster.
221 "-Wl,--strip-all",
222 ],
223 },
224 },
Peter Collingbourne26cd9b82018-11-30 20:29:22 -0800225 gnu_extensions: false,
226 cpp_std: "c++17",
227}
Dan Albert4d4d6a82018-12-12 13:45:05 -0800228
229python_test {
230 name: "filesystem_dynamic_test_helper.py",
231 main: "test/support/filesystem_dynamic_test_helper.py",
232 srcs: [
233 "test/support/filesystem_dynamic_test_helper.py",
234 ],
235 version: {
236 py2: {
237 enabled: true,
238 embedded_launcher: true,
239 },
240 py3: {
241 enabled: false,
242 },
243 },
244}