Skip to content

Commit efa06a1

Browse files
Takuto Ikutacopybara-github
authored andcommitted
Handle module.modulemap.in for Clang module build of libc++
This generates modulemap file from module.modulemap.in like llvm/llvm-project#134699 does. This also copies __config_site to build directory for modulemap update too. Bug: 412530604 Change-Id: I6e50cfee13f834deabed593d3f770d758b686caf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6475190 Commit-Queue: Takuto Ikuta <[email protected]> Reviewed-by: Junji Watanabe <[email protected]> Auto-Submit: Takuto Ikuta <[email protected]> Cr-Commit-Position: refs/heads/main@{#1449776} NOKEYCHECK=True GitOrigin-RevId: 5c1d47c83879575c1460cedddedb5ebc110f24eb
1 parent 6e083ac commit efa06a1

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

third_party/libc++/BUILD.gn

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,21 @@ configs_to_remove = [
126126
]
127127

128128
if (use_explicit_libcxx_modules) {
129-
# We need to have libc++ headers and __assertion_handler in the same directory
130-
# for clang modules build.
129+
# We need to have libc++ headers, __assertion_handler and __config_site in the
130+
# same directory for clang modules build.
131131
copy("copy_libcxx_headers") {
132132
sources = libcxx_headers
133133
outputs = [ "{{source_gen_dir}}/{{source_file_part}}" ]
134134
}
135135

136-
copy("copy_assertion_handler") {
137-
sources = [ "__assertion_handler" ]
138-
outputs =
139-
[ "${root_gen_dir}/third_party/libc++/src/include/__assertion_handler" ]
136+
copy("copy_custom_headers") {
137+
sources = [
138+
"__assertion_handler",
139+
"__config_site",
140+
]
141+
outputs = [
142+
"${root_gen_dir}/third_party/libc++/src/include/{{source_file_part}}",
143+
]
140144
}
141145
}
142146

@@ -149,7 +153,7 @@ template("libcxx_modules") {
149153
sources =
150154
[ "${root_gen_dir}/third_party/libc++/src/include/module.modulemap" ]
151155
deps += [
152-
":copy_assertion_handler",
156+
":copy_custom_headers",
153157
":copy_libcxx_headers",
154158
]
155159
}

third_party/libc++/libcxx_headers.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ libcxx_headers = [
10381038
"//third_party/libc++/src/include/mdspan",
10391039
"//third_party/libc++/src/include/memory",
10401040
"//third_party/libc++/src/include/memory_resource",
1041-
"//third_party/libc++/src/include/module.modulemap",
1041+
"//third_party/libc++/src/include/module.modulemap.in",
10421042
"//third_party/libc++/src/include/mutex",
10431043
"//third_party/libc++/src/include/new",
10441044
"//third_party/libc++/src/include/numbers",

0 commit comments

Comments
 (0)