@@ -21,6 +21,9 @@ let package = Package(
2121 targets: [ " _JSONCore " ]
2222 ) ,
2323 ] ,
24+ traits: [
25+ . trait( name: " FoundationSupport " , enabledTraits: [ ] )
26+ ] ,
2427 dependencies: [
2528 // Dependencies declare other packages that this package depends on.
2629 . package ( url: " https://github.com/apple/swift-nio.git " , from: " 2.0.0 " )
@@ -38,17 +41,20 @@ let package = Package(
3841 . target(
3942 name: " _NIOJSON " ,
4043 dependencies: [
41- . product( name: " NIOCore " , package : " swift-nio " ) ,
42- . product( name: " NIOFoundationCompat " , package : " swift-nio " ) ,
44+ . product( name: " NIOCore " , package : " swift-nio " , condition : . when ( traits : [ " FoundationSupport " ] ) ) ,
45+ . product( name: " NIOFoundationCompat " , package : " swift-nio " , condition : . when ( traits : [ " FoundationSupport " ] ) ) ,
4346 . target( name: " _JSONCore " ) ,
4447 ]
4548 ) ,
4649 . target(
4750 name: " IkigaJSON " ,
4851 dependencies: [
49- . product( name: " NIOCore " , package : " swift-nio " ) ,
52+ . product( name: " NIOCore " , package : " swift-nio " , condition : . when ( traits : [ " FoundationSupport " ] ) ) ,
5053 . target( name: " _JSONCore " ) ,
51- . target( name: " _NIOJSON " ) ,
54+ . target( name: " _NIOJSON " , condition: . when( traits: [ " FoundationSupport " ] ) ) ,
55+ ] ,
56+ swiftSettings: [
57+ . define( " FOUNDATION_SUPPORT " , . when( traits: [ " FoundationSupport " ] ) ) ,
5258 ]
5359 ) ,
5460 . testTarget(
0 commit comments