diff --git a/rules/library.bzl b/rules/library.bzl index b77a9afa..c3b8aa83 100644 --- a/rules/library.bzl +++ b/rules/library.bzl @@ -1106,6 +1106,7 @@ def apple_library( if module_map: objc_hdrs.append(module_map) + default_alwayslink = kwargs.pop("alwayslink", True) # ensure symbols from any static deps are always included (see https://github.com/bazelbuild/rules_apple/issues/1938) native.objc_library( name = objc_libname, srcs = objc_sources + objc_private_hdrs + objc_non_exported_hdrs, @@ -1124,7 +1125,7 @@ def apple_library( defines = defines + objc_defines, testonly = testonly, features = features, - alwayslink = True, # ensure symbols from any static deps are always included (see https://github.com/bazelbuild/rules_apple/issues/1938) + alwayslink = default_alwayslink, **kwargs ) launch_screen_storyboard_name = name + "_launch_screen_storyboard"