@@ -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 ,
@@ -646,6 +652,7 @@ def _ios_app_clip_impl(ctx):
646652 avoid_deps = ctx .attr .frameworks ,
647653 build_settings = apple_xplat_toolchain_info .build_settings ,
648654 bundle_name = bundle_name ,
655+ cc_configured_features = cc_configured_features ,
649656 entitlements = entitlements .linking ,
650657 exported_symbols_lists = ctx .files .exported_symbols_lists ,
651658 platform_prerequisites = platform_prerequisites ,
@@ -915,7 +922,10 @@ def _ios_framework_impl(ctx):
915922 bundle_name = bundle_name ,
916923 suffix_default = ctx .attr ._bundle_id_suffix_default ,
917924 )
918- cc_configured_features = features_support .cc_configured_features (ctx = ctx )
925+ cc_configured_features = features_support .cc_configured_features (
926+ ctx = ctx ,
927+ extra_requested_features = ["link_dylib" ],
928+ )
919929 cc_toolchain_forwarder = ctx .split_attr ._cc_toolchain_forwarder
920930 executable_name = ctx .attr .executable_name
921931 features = cc_configured_features .enabled_features
@@ -971,6 +981,7 @@ def _ios_framework_impl(ctx):
971981 avoid_deps = ctx .attr .frameworks ,
972982 build_settings = apple_xplat_toolchain_info .build_settings ,
973983 bundle_name = bundle_name ,
984+ cc_configured_features = cc_configured_features ,
974985 # Frameworks do not have entitlements.
975986 entitlements = None ,
976987 exported_symbols_lists = ctx .files .exported_symbols_lists ,
@@ -1236,6 +1247,7 @@ def _ios_extension_impl(ctx):
12361247 avoid_deps = ctx .attr .frameworks ,
12371248 build_settings = apple_xplat_toolchain_info .build_settings ,
12381249 bundle_name = bundle_name ,
1250+ cc_configured_features = cc_configured_features ,
12391251 entitlements = entitlements .linking ,
12401252 exported_symbols_lists = ctx .files .exported_symbols_lists ,
12411253 extra_linkopts = extra_linkopts ,
@@ -1544,6 +1556,7 @@ def _ios_dynamic_framework_impl(ctx):
15441556 avoid_deps = ctx .attr .frameworks ,
15451557 build_settings = apple_xplat_toolchain_info .build_settings ,
15461558 bundle_name = bundle_name ,
1559+ cc_configured_features = cc_configured_features ,
15471560 # Frameworks do not have entitlements.
15481561 entitlements = None ,
15491562 exported_symbols_lists = ctx .files .exported_symbols_lists ,
@@ -1786,6 +1799,7 @@ def _ios_static_framework_impl(ctx):
17861799
17871800 archive_result = linking_support .register_static_library_archive_action (
17881801 ctx = ctx ,
1802+ cc_configured_features = cc_configured_features ,
17891803 cc_toolchains = cc_toolchain_forwarder ,
17901804 )
17911805 binary_artifact = archive_result .library
@@ -2201,6 +2215,7 @@ def _ios_imessage_extension_impl(ctx):
22012215 avoid_deps = ctx .attr .frameworks ,
22022216 build_settings = apple_xplat_toolchain_info .build_settings ,
22032217 bundle_name = bundle_name ,
2218+ cc_configured_features = cc_configured_features ,
22042219 entitlements = entitlements .linking ,
22052220 exported_symbols_lists = ctx .files .exported_symbols_lists ,
22062221 extra_linkopts = extra_linkopts ,
0 commit comments