Skip to content

Commit 8f675d1

Browse files
committed
[gn] port f78f93b (libc++ tzdb)
1 parent 3df1a64 commit 8f675d1

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

llvm/utils/gn/secondary/libcxx/config.gni

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ declare_args() {
44

55
# libc++ inline ABI namespace. Defaults to __n, where n is the ABI version.
66
libcxx_abi_namespace = ""
7+
8+
# Build timezone database as part of libc++experimental.
9+
libcxx_enable_time_zone_database = target_os == "linux"
710
}

llvm/utils/gn/secondary/libcxx/include/BUILD.gn

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ if (current_toolchain == default_toolchain) {
5151
} else {
5252
values += [ "_LIBCPP_ABI_NAMESPACE=__" + libcxx_abi_version ]
5353
}
54+
if (!libcxx_enable_time_zone_database) {
55+
values += [ "_LIBCPP_HAS_NO_TIME_ZONE_DATABASE=1" ]
56+
} else {
57+
values += [ "_LIBCPP_HAS_NO_TIME_ZONE_DATABASE=" ]
58+
}
5459
}
5560

5661
write_cmake_config("write_modulemap") {
@@ -351,6 +356,8 @@ if (current_toolchain == default_toolchain) {
351356
"__chrono/steady_clock.h",
352357
"__chrono/system_clock.h",
353358
"__chrono/time_point.h",
359+
"__chrono/tzdb.h",
360+
"__chrono/tzdb_list.h",
354361
"__chrono/weekday.h",
355362
"__chrono/year.h",
356363
"__chrono/year_month.h",

llvm/utils/gn/secondary/libcxx/src/BUILD.gn

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ declare_args() {
1212
# Build libc++ as a static library.
1313
libcxx_enable_static = true
1414

15-
# Build filesystem as part of libc++fs.a.
15+
# Build filesystem as part of libc++.
1616
libcxx_enable_filesystem = target_os != "win"
1717

1818
# Build libc++experimental.a.
@@ -307,6 +307,12 @@ if (libcxx_enable_experimental) {
307307
output_dir = runtimes_dir
308308
output_name = "c++experimental"
309309
sources = [ "experimental/memory_resource.cpp" ]
310+
if (libcxx_enable_filesystem && libcxx_enable_time_zone_database) {
311+
sources += [
312+
"tz.cpp",
313+
"tzdb_list.cpp",
314+
]
315+
}
310316
deps = [ "//libcxx/include" ]
311317
configs += [ ":cxx_config" ]
312318
configs -= [

0 commit comments

Comments
 (0)