diff options
author | 2016-09-20 21:15:36 +0000 | |
---|---|---|
committer | 2016-09-21 07:08:57 +0000 | |
commit | 5b8b3de8a2c835e4cf7eb8c5678baf4ff837aa8b (patch) | |
tree | 24344e2de3d831a73159db539d719929fe52de43 /tools/build_defs/apple | |
parent | 39900803506dd2a1aa2352d9f8e565bbae923b66 (diff) |
Add copts attribute to swift_library.
--
MOS_MIGRATED_REVID=133752908
Diffstat (limited to 'tools/build_defs/apple')
-rw-r--r-- | tools/build_defs/apple/swift.bzl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/build_defs/apple/swift.bzl b/tools/build_defs/apple/swift.bzl index 05b7a0bb0a..d68c0d017c 100644 --- a/tools/build_defs/apple/swift.bzl +++ b/tools/build_defs/apple/swift.bzl @@ -220,6 +220,7 @@ def _swift_library_impl(ctx): args.extend(framework_args) args.extend(clang_args) args.extend(define_args) + args.extend(ctx.attr.copts) xcrun_action( ctx, @@ -261,6 +262,7 @@ swift_library = rule( "deps": attr.label_list(providers=[["swift"], ["objc"]]), "module_name": attr.string(mandatory=False), "defines": attr.string_list(mandatory=False, allow_empty=True), + "copts": attr.string_list(mandatory=False, allow_empty=True), "_xcrunwrapper": attr.label( executable=True, cfg="host", @@ -280,6 +282,7 @@ Args: module_name: Optional. Sets the Swift module name for this target. By default the module name is the target path with all special symbols replaced by "_", e.g. //foo:bar can be imported as "foo_bar". + copts: A list of flags passed to swiftc command line. defines: A list of values for build configuration options (-D). These values can be then used for conditional compilation blocks in code. For example: |