Skip to content

Commit c6d8d84

Browse files
Googlerbrentleyjones
authored andcommitted
Add copts parameter to compile_module_interface()
PiperOrigin-RevId: 487024190 (cherry picked from commit 4e48b7a) Signed-off-by: Brentley Jones <[email protected]>
1 parent 6beacf8 commit c6d8d84

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ A `struct` with the following fields:
163163
## swift_common.compile_module_interface
164164

165165
<pre>
166-
swift_common.compile_module_interface(<a href="#swift_common.compile_module_interface-actions">actions</a>, <a href="#swift_common.compile_module_interface-compilation_contexts">compilation_contexts</a>, <a href="#swift_common.compile_module_interface-exec_group">exec_group</a>,
166+
swift_common.compile_module_interface(<a href="#swift_common.compile_module_interface-actions">actions</a>, <a href="#swift_common.compile_module_interface-compilation_contexts">compilation_contexts</a>, <a href="#swift_common.compile_module_interface-copts">copts</a>, <a href="#swift_common.compile_module_interface-exec_group">exec_group</a>,
167167
<a href="#swift_common.compile_module_interface-feature_configuration">feature_configuration</a>, <a href="#swift_common.compile_module_interface-module_name">module_name</a>, <a href="#swift_common.compile_module_interface-swiftinterface_file">swiftinterface_file</a>,
168168
<a href="#swift_common.compile_module_interface-swift_infos">swift_infos</a>, <a href="#swift_common.compile_module_interface-swift_toolchain">swift_toolchain</a>, <a href="#swift_common.compile_module_interface-target_name">target_name</a>)
169169
</pre>
@@ -177,6 +177,7 @@ Compiles a Swift module interface.
177177
| :------------- | :------------- | :------------- |
178178
| <a id="swift_common.compile_module_interface-actions"></a>actions | The context's `actions` object. | none |
179179
| <a id="swift_common.compile_module_interface-compilation_contexts"></a>compilation_contexts | A list of `CcCompilationContext`s that represent C/Objective-C requirements of the target being compiled, such as Swift-compatible preprocessor defines, header search paths, and so forth. These are typically retrieved from the `CcInfo` providers of a target's dependencies. | none |
180+
| <a id="swift_common.compile_module_interface-copts"></a>copts | A list of compiler flags that apply to the target being built. | `[]` |
180181
| <a id="swift_common.compile_module_interface-exec_group"></a>exec_group | Runs the Swift compilation action under the given execution group's context. If `None`, the default execution group is used. | `None` |
181182
| <a id="swift_common.compile_module_interface-feature_configuration"></a>feature_configuration | A feature configuration obtained from `swift_common.configure_features`. | none |
182183
| <a id="swift_common.compile_module_interface-module_name"></a>module_name | The name of the Swift module being compiled. This must be present and valid; use `swift_common.derive_module_name` to generate a default from the target's label if needed. | none |

swift/internal/compiling.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def compile_module_interface(
205205
*,
206206
actions,
207207
compilation_contexts,
208+
copts = [],
208209
exec_group = None,
209210
feature_configuration,
210211
module_name,
@@ -221,6 +222,7 @@ def compile_module_interface(
221222
Swift-compatible preprocessor defines, header search paths, and so
222223
forth. These are typically retrieved from the `CcInfo` providers of
223224
a target's dependencies.
225+
copts: A list of compiler flags that apply to the target being built.
224226
exec_group: Runs the Swift compilation action under the given execution
225227
group's context. If `None`, the default execution group is used.
226228
feature_configuration: A feature configuration obtained from
@@ -323,7 +325,7 @@ def compile_module_interface(
323325
target_label = feature_configuration._label,
324326
transitive_modules = transitive_modules,
325327
transitive_swiftmodules = transitive_swiftmodules,
326-
user_compile_flags = [],
328+
user_compile_flags = copts,
327329
vfsoverlay_file = vfsoverlay_file,
328330
vfsoverlay_search_path = _SWIFTMODULES_VFS_ROOT,
329331
)

0 commit comments

Comments
 (0)