diff --git a/apple/apple_common.bzl b/apple/apple_common.bzl index fc5ae2170..278ba00c1 100644 --- a/apple/apple_common.bzl +++ b/apple/apple_common.bzl @@ -158,6 +158,11 @@ def _serialize_debugging_options_arg(): "serialize_debugging_options": attrs.bool(default = True), } +def _uses_explicit_modules_arg(): + return { + "uses_explicit_modules": attrs.bool(default = False), + } + apple_common = struct( headers_arg = _headers_arg, exported_headers_arg = _exported_headers_arg, @@ -171,4 +176,5 @@ apple_common = struct( privacy_manifest_arg = _privacy_manifest_arg, debug_artifacts_validators_arg = _debug_artifacts_validators_arg, serialize_debugging_options_arg = _serialize_debugging_options_arg, + uses_explicit_modules_arg = _uses_explicit_modules_arg, ) diff --git a/decls/cxx_rules.bzl b/decls/cxx_rules.bzl index 8b0ceaa1a..b0310d98f 100644 --- a/decls/cxx_rules.bzl +++ b/decls/cxx_rules.bzl @@ -553,6 +553,7 @@ cxx_library = prelude_rule( cxx_common.precompiled_header_arg() | apple_common.extra_xcode_sources() | apple_common.extra_xcode_files() | + apple_common.uses_explicit_modules_arg() | { "bridging_header": attrs.option(attrs.source(), default = None), "can_be_asset": attrs.option(attrs.bool(), default = None), @@ -587,7 +588,6 @@ cxx_library = prelude_rule( "thin_lto": attrs.bool(default = False), "use_archive": attrs.option(attrs.bool(), default = None), "uses_cxx_explicit_modules": attrs.bool(default = False), - "uses_explicit_modules": attrs.bool(default = False), "version_universe": attrs.option(attrs.string(), default = None), "weak_framework_names": attrs.list(attrs.string(), default = []), "use_header_units": attrs.bool(default = False), diff --git a/decls/ios_rules.bzl b/decls/ios_rules.bzl index 5d7a5e3d6..bbb7bdbd4 100644 --- a/decls/ios_rules.bzl +++ b/decls/ios_rules.bzl @@ -163,6 +163,7 @@ apple_binary = prelude_rule( apple_common.extra_xcode_sources() | apple_common.extra_xcode_files() | apple_common.serialize_debugging_options_arg() | + apple_common.uses_explicit_modules_arg() | { "bridging_header": attrs.option(attrs.source(), default = None), "can_be_asset": attrs.option(attrs.bool(), default = None), @@ -231,7 +232,6 @@ apple_binary = prelude_rule( "thin_lto": attrs.bool(default = False), "use_submodules": attrs.bool(default = True), "uses_cxx_explicit_modules": attrs.bool(default = False), - "uses_explicit_modules": attrs.bool(default = False), "uses_modules": attrs.bool(default = False), } | buck.allow_cache_upload_arg() @@ -457,6 +457,7 @@ apple_library = prelude_rule( apple_common.extra_xcode_sources() | apple_common.extra_xcode_files() | apple_common.serialize_debugging_options_arg() | + apple_common.uses_explicit_modules_arg() | { "bridging_header": attrs.option(attrs.source(), default = None), "can_be_asset": attrs.option(attrs.bool(), default = None), @@ -521,7 +522,6 @@ apple_library = prelude_rule( "thin_lto": attrs.bool(default = False), "use_submodules": attrs.bool(default = True), "uses_cxx_explicit_modules": attrs.bool(default = False), - "uses_explicit_modules": attrs.bool(default = False), "uses_modules": attrs.bool(default = False), } | buck.allow_cache_upload_arg() @@ -705,6 +705,7 @@ apple_test = prelude_rule( apple_common.extra_xcode_sources() | apple_common.extra_xcode_files() | apple_common.serialize_debugging_options_arg() | + apple_common.uses_explicit_modules_arg() | { "asset_catalogs_compilation_options": attrs.dict(key = attrs.string(), value = attrs.any(), default = {}), "bridging_header": attrs.option(attrs.source(), default = None), @@ -790,7 +791,6 @@ apple_test = prelude_rule( "ui_test_target_app": attrs.option(attrs.dep(), default = None), "use_submodules": attrs.bool(default = True), "uses_cxx_explicit_modules": attrs.bool(default = False), - "uses_explicit_modules": attrs.bool(default = False), "uses_modules": attrs.bool(default = False), "xcode_product_type": attrs.option(attrs.string(), default = None), } | @@ -982,9 +982,9 @@ swift_library = prelude_rule( "srcs": attrs.list(attrs.source(), default = []), "supported_platforms_regex": attrs.option(attrs.regex(), default = None), "target_sdk_version": attrs.option(attrs.string(), default = None), - "uses_explicit_modules": attrs.bool(default = False), "version": attrs.option(attrs.string(), default = None), - } + } | + apple_common.uses_explicit_modules_arg() ), )