@@ -147,6 +147,7 @@ public struct ObjcImport: BazelTarget {
147147public enum ObjcLibraryConfigurableKeys : String {
148148 case copts
149149 case deps
150+ case features
150151 case sdkFrameworks = "sdk_frameworks"
151152}
152153
@@ -173,6 +174,7 @@ public struct ObjcLibrary: BazelTarget, UserConfigurable, SourceExcludable {
173174 public var sdkFrameworks: AttrSet<[String]>
174175 public var copts: AttrSet<[String]>
175176 public var deps: AttrSet<[String]>
177+ public var features: AttrSet<[String]>
176178
177179 public let isTopLevelTarget: Bool
178180 public let externalName: String
@@ -191,6 +193,7 @@ public struct ObjcLibrary: BazelTarget, UserConfigurable, SourceExcludable {
191193 sdkDylibs: AttrSet<[String]> = AttrSet.empty,
192194 deps: AttrSet<[String]> = AttrSet.empty,
193195 copts: AttrSet<[String]> = AttrSet.empty,
196+ features: AttrSet<[String]> = AttrSet.empty,
194197 bundles: AttrSet<[String]> = AttrSet.empty,
195198 resources: AttrSet<GlobNode> = AttrSet.empty,
196199 publicHeaders: AttrSet<GlobNode> = AttrSet.empty,
@@ -211,6 +214,7 @@ public struct ObjcLibrary: BazelTarget, UserConfigurable, SourceExcludable {
211214 self.sdkDylibs = sdkDylibs
212215 self.deps = deps
213216 self.copts = copts
217+ self.features = features
214218 self.bundles = bundles
215219 self.resources = resources
216220 self.nonArcSrcs = nonArcSrcs
@@ -398,6 +402,8 @@ public struct ObjcLibrary: BazelTarget, UserConfigurable, SourceExcludable {
398402 AttrSet(basic: xcconfigCopts) <>
399403 fallbackSpec.attr(\.compilerFlags)
400404
405+ features = AttrSet.empty
406+
401407 // Select resources that are not prebuilt bundles
402408 let resourceFiles = (spec.attr(\.resources).map { (strArr: [String]) -> [String] in
403409 strArr.filter { (str: String) -> Bool in
@@ -441,6 +447,10 @@ public struct ObjcLibrary: BazelTarget, UserConfigurable, SourceExcludable {
441447 if let value = value as? String {
442448 self.deps = self.deps <> AttrSet(basic: [value])
443449 }
450+ case .features:
451+ if let value = value as? String {
452+ self.features = self.features <> AttrSet(basic: [value])
453+ }
444454 }
445455
446456 }
@@ -620,9 +630,9 @@ public struct ObjcLibrary: BazelTarget, UserConfigurable, SourceExcludable {
620630 lib.prefixHeader, includes: lib.includes,
621631 sdkFrameworks: lib.sdkFrameworks, weakSdkFrameworks:
622632 lib.weakSdkFrameworks, sdkDylibs: lib.sdkDylibs, deps:
623- deps, copts: lib.copts, bundles : lib.bundles, resources :
624- lib.resources, publicHeaders : lib.publicHeaders,
625- nonArcSrcs: nonArcSources, requiresArc:
633+ deps, copts: lib.copts, features : lib.features, bundles :
634+ lib.bundles, resources : lib.resources, publicHeaders:
635+ lib.publicHeaders, nonArcSrcs: nonArcSources, requiresArc:
626636 lib.requiresArc, isTopLevelTarget: lib.isTopLevelTarget)
627637
628638 }
@@ -891,6 +901,13 @@ public struct ObjcLibrary: BazelTarget, UserConfigurable, SourceExcludable {
891901 ) )
892902 }
893903
904+ if !lib. features. isEmpty {
905+ libArguments. append ( . named(
906+ name: " features " ,
907+ value: lib. features. toSkylark ( )
908+ ) )
909+ }
910+
894911 let buildConfigDependenctCOpts : SkylarkNode =
895912 . functionCall( name: " select " ,
896913 arguments: [
0 commit comments