@@ -171,6 +171,10 @@ def _ios_application_impl(ctx):
171171 apple_mac_toolchain_info = ctx .attr ._mac_toolchain [AppleMacToolsToolchainInfo ]
172172 apple_xplat_toolchain_info = ctx .attr ._xplat_toolchain [AppleXPlatToolsToolchainInfo ]
173173
174+ extra_requested_features = []
175+ if ctx .attr .testonly :
176+ extra_requested_features .append ("exported_symbols" )
177+
174178 bundle_name , bundle_extension = bundling_support .bundle_full_name (
175179 custom_bundle_name = ctx .attr .bundle_name ,
176180 label_name = ctx .label .name ,
@@ -186,6 +190,7 @@ def _ios_application_impl(ctx):
186190 bundle_verification_targets = [struct (target = ext ) for ext in ctx .attr .extensions ]
187191 cc_configured_features = features_support .cc_configured_features (
188192 ctx = ctx ,
193+ extra_requested_features = extra_requested_features ,
189194 )
190195 features = cc_configured_features .enabled_features
191196 cc_toolchain_forwarder = ctx .split_attr ._cc_toolchain_forwarder
@@ -260,6 +265,7 @@ def _ios_application_impl(ctx):
260265 avoid_deps = ctx .attr .frameworks ,
261266 build_settings = apple_xplat_toolchain_info .build_settings ,
262267 bundle_name = bundle_name ,
268+ cc_configured_features = cc_configured_features ,
263269 entitlements = entitlements .linking ,
264270 exported_symbols_lists = ctx .files .exported_symbols_lists ,
265271 extra_linkopts = extra_linkopts ,
@@ -649,6 +655,7 @@ def _ios_app_clip_impl(ctx):
649655 avoid_deps = ctx .attr .frameworks ,
650656 build_settings = apple_xplat_toolchain_info .build_settings ,
651657 bundle_name = bundle_name ,
658+ cc_configured_features = cc_configured_features ,
652659 entitlements = entitlements .linking ,
653660 exported_symbols_lists = ctx .files .exported_symbols_lists ,
654661 platform_prerequisites = platform_prerequisites ,
@@ -909,7 +916,10 @@ def _ios_framework_impl(ctx):
909916 bundle_name = bundle_name ,
910917 suffix_default = ctx .attr ._bundle_id_suffix_default ,
911918 )
912- cc_configured_features = features_support .cc_configured_features (ctx = ctx )
919+ cc_configured_features = features_support .cc_configured_features (
920+ ctx = ctx ,
921+ extra_requested_features = ["link_dylib" ],
922+ )
913923 cc_toolchain_forwarder = ctx .split_attr ._cc_toolchain_forwarder
914924 executable_name = ctx .attr .executable_name
915925 features = cc_configured_features .enabled_features
@@ -965,6 +975,7 @@ def _ios_framework_impl(ctx):
965975 avoid_deps = ctx .attr .frameworks ,
966976 build_settings = apple_xplat_toolchain_info .build_settings ,
967977 bundle_name = bundle_name ,
978+ cc_configured_features = cc_configured_features ,
968979 # Frameworks do not have entitlements.
969980 entitlements = None ,
970981 exported_symbols_lists = ctx .files .exported_symbols_lists ,
@@ -1230,6 +1241,7 @@ def _ios_extension_impl(ctx):
12301241 avoid_deps = ctx .attr .frameworks ,
12311242 build_settings = apple_xplat_toolchain_info .build_settings ,
12321243 bundle_name = bundle_name ,
1244+ cc_configured_features = cc_configured_features ,
12331245 entitlements = entitlements .linking ,
12341246 exported_symbols_lists = ctx .files .exported_symbols_lists ,
12351247 extra_linkopts = extra_linkopts ,
@@ -1541,6 +1553,7 @@ def _ios_dynamic_framework_impl(ctx):
15411553 avoid_deps = ctx .attr .frameworks ,
15421554 build_settings = apple_xplat_toolchain_info .build_settings ,
15431555 bundle_name = bundle_name ,
1556+ cc_configured_features = cc_configured_features ,
15441557 # Frameworks do not have entitlements.
15451558 entitlements = None ,
15461559 exported_symbols_lists = ctx .files .exported_symbols_lists ,
@@ -1783,6 +1796,7 @@ def _ios_static_framework_impl(ctx):
17831796
17841797 archive_result = linking_support .register_static_library_archive_action (
17851798 ctx = ctx ,
1799+ cc_configured_features = cc_configured_features ,
17861800 cc_toolchains = cc_toolchain_forwarder ,
17871801 )
17881802 binary_artifact = archive_result .library
@@ -2198,6 +2212,7 @@ def _ios_imessage_extension_impl(ctx):
21982212 avoid_deps = ctx .attr .frameworks ,
21992213 build_settings = apple_xplat_toolchain_info .build_settings ,
22002214 bundle_name = bundle_name ,
2215+ cc_configured_features = cc_configured_features ,
22012216 entitlements = entitlements .linking ,
22022217 exported_symbols_lists = ctx .files .exported_symbols_lists ,
22032218 extra_linkopts = extra_linkopts ,
0 commit comments