Skip to content

Commit

Permalink
Handle swift.swift_disable_import_underlying_module in features (#…
Browse files Browse the repository at this point in the history
…892)

When the `swift.swift_disable_import_underlying_module` is provided via
the `features` attr this would previously do nothing, now it properly
stops using `-import-underlying`
  • Loading branch information
luispadron authored Aug 12, 2024
1 parent 4c016ec commit 9bceb55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rules/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ load("@build_bazel_rules_apple//apple/internal/resource_rules:apple_intent_libra
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
load("//rules:precompiled_apple_resource_bundle.bzl", "precompiled_apple_resource_bundle")
load("//rules:hmap.bzl", "headermap")
load("//rules:features.bzl", "feature_names")
load("//rules/framework:vfs_overlay.bzl", "framework_vfs_overlay", VFS_OVERLAY_FRAMEWORK_SEARCH_PATH = "FRAMEWORK_SEARCH_PATH")
load("//rules/library:resources.bzl", "wrap_resources_in_filegroup")
load("//rules/library:xcconfig.bzl", "copts_by_build_setting_with_defaults")
Expand Down Expand Up @@ -937,7 +938,7 @@ def apple_library(

additional_swift_copts += select({
"@build_bazel_rules_ios//:swift_disable_import_underlying_module": [],
"//conditions:default": ["-import-underlying-module"],
"//conditions:default": ["-import-underlying-module"] if not feature_names.swift_disable_import_underlying_module in features else [],
})

swiftc_inputs = other_inputs + objc_hdrs + objc_private_hdrs
Expand Down

0 comments on commit 9bceb55

Please sign in to comment.