diff --git a/doc/api.md b/doc/api.md index 39eb56ce3..621656352 100644 --- a/doc/api.md +++ b/doc/api.md @@ -163,7 +163,7 @@ A `struct` with the following fields: ## swift_common.compile_module_interface
-swift_common.compile_module_interface(actions, compilation_contexts, exec_group,
+swift_common.compile_module_interface(actions, compilation_contexts, copts, exec_group,
feature_configuration, module_name, swiftinterface_file,
swift_infos, swift_toolchain, target_name)
@@ -177,6 +177,7 @@ Compiles a Swift module interface.
| :------------- | :------------- | :------------- |
| actions | The context's `actions` object. | none |
| 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 |
+| copts | A list of compiler flags that apply to the target being built. | `[]` |
| exec_group | Runs the Swift compilation action under the given execution group's context. If `None`, the default execution group is used. | `None` |
| feature_configuration | A feature configuration obtained from `swift_common.configure_features`. | none |
| 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 |
diff --git a/swift/internal/compiling.bzl b/swift/internal/compiling.bzl
index a9796eb07..7a3dfa91a 100644
--- a/swift/internal/compiling.bzl
+++ b/swift/internal/compiling.bzl
@@ -205,6 +205,7 @@ def compile_module_interface(
*,
actions,
compilation_contexts,
+ copts = [],
exec_group = None,
feature_configuration,
module_name,
@@ -221,6 +222,7 @@ def compile_module_interface(
Swift-compatible preprocessor defines, header search paths, and so
forth. These are typically retrieved from the `CcInfo` providers of
a target's dependencies.
+ copts: A list of compiler flags that apply to the target being built.
exec_group: Runs the Swift compilation action under the given execution
group's context. If `None`, the default execution group is used.
feature_configuration: A feature configuration obtained from
@@ -323,7 +325,7 @@ def compile_module_interface(
target_label = feature_configuration._label,
transitive_modules = transitive_modules,
transitive_swiftmodules = transitive_swiftmodules,
- user_compile_flags = [],
+ user_compile_flags = copts,
vfsoverlay_file = vfsoverlay_file,
vfsoverlay_search_path = _SWIFTMODULES_VFS_ROOT,
)