diff --git a/doc/rules.md b/doc/rules.md index 1c87de69f..a7cddf7ad 100644 --- a/doc/rules.md +++ b/doc/rules.md @@ -992,15 +992,16 @@ swift_library(
 mixed_language_library(name, always_include_developer_search_paths, alwayslink, clang_copts,
-                       clang_defines, clang_srcs, data, enable_modules, hdrs, includes, linkopts,
-                       module_map, module_name, non_arc_srcs, package_name, private_deps, sdk_dylibs,
-                       sdk_frameworks, swift_copts, swift_defines, swift_srcs, swiftc_inputs,
-                       textual_hdrs, umbrella_header, weak_sdk_frameworks, deps, kwargs)
+                       clang_defines, clang_deps, clang_srcs, data, enable_modules, hdrs, includes,
+                       linkopts, module_map, module_name, non_arc_srcs, package_name, private_deps,
+                       sdk_dylibs, sdk_frameworks, swift_copts, swift_defines, swift_srcs,
+                       swiftc_inputs, textual_hdrs, umbrella_header, weak_sdk_frameworks, deps,
+                       kwargs)
 
Creates a mixed language library from a Clang and Swift library target pair. -Note: In the future `swift_library` will support mixed-langauge libraries. +Note: In the future `swift_library` will support mixed-language libraries. Once that is the case, this macro will be deprecated. @@ -1014,6 +1015,7 @@ Once that is the case, this macro will be deprecated. | alwayslink | If true, any binary that depends (directly or indirectly) on this library will link in all the object files for the files listed in `clang_srcs` and `swift_srcs`, even if some contain no symbols referenced by the binary. This is useful if your code isn't explicitly called by code in the binary; for example, if you rely on runtime checks for protocol conformances added in extensions in the library but do not directly reference any other symbols in the object file that adds that conformance. | `False` | | clang_copts | The compiler flags for the clang library. These will only be used for the clang library. If you want them to affect the swift library as well, you need to pass them with `-Xcc` in `swift_copts`. | `[]` | | clang_defines | Extra clang `-D` flags to pass to the compiler. They should be in the form `KEY=VALUE` or simply `KEY` and are passed not only to the compiler for this target (as `clang_copts` are) but also to all dependers of this target. Subject to "Make variable" substitution and Bourne shell tokenization. | `[]` | +| clang_deps | A list of targets that are dependencies of only the clang library. | `[]` | | clang_srcs | The list of C, C++, Objective-C, or Objective-C++ sources for the clang library. | none | | data | The list of files needed by this target at runtime.

Files and targets named in the `data` attribute will appear in the `*.runfiles` area of this target, if it has one. This may include data files needed by a binary or library, or other programs needed by it. | `[]` | | enable_modules | Enables clang module support (via `-fmodules`). Setting this to `True` will allow you to `@import` system headers and other targets: `@import UIKit;` `@import path_to_package_target;`. | `False` | diff --git a/mixed_language/mixed_language_library.bzl b/mixed_language/mixed_language_library.bzl index cc144d6ee..6c7d5bd7b 100644 --- a/mixed_language/mixed_language_library.bzl +++ b/mixed_language/mixed_language_library.bzl @@ -39,6 +39,7 @@ def mixed_language_library( alwayslink = False, clang_copts = [], clang_defines = [], + clang_deps = [], clang_srcs, data = [], enable_modules = False, @@ -64,7 +65,7 @@ def mixed_language_library( """Creates a mixed language library from a Clang and Swift library target \ pair. - Note: In the future `swift_library` will support mixed-langauge libraries. + Note: In the future `swift_library` will support mixed-language libraries. Once that is the case, this macro will be deprecated. Args: @@ -89,6 +90,8 @@ def mixed_language_library( only to the compiler for this target (as `clang_copts` are) but also to all dependers of this target. Subject to "Make variable" substitution and Bourne shell tokenization. + clang_deps: A list of targets that are dependencies of only the + clang library. clang_srcs: The list of C, C++, Objective-C, or Objective-C++ sources for the clang library. data: The list of files needed by this target at runtime. @@ -376,7 +379,7 @@ a mixed language Swift library, use a clang only library rule like \ testonly = testonly, textual_hdrs = textual_hdrs, weak_sdk_frameworks = weak_sdk_frameworks, - deps = deps, + deps = deps + clang_deps, **kwargs )