16
16
17
17
import PackageDescription
18
18
19
- var deploymentDescriptorDependency : [ Target . Dependency ] = [ ]
20
- #if !os(Linux)
21
- deploymentDescriptorDependency = [ . product( name: " AWSLambdaDeploymentDescriptor " , package : " swift-aws-lambda-runtime " ) ]
22
- #endif
23
-
24
19
let package = Package (
25
20
name: " swift-aws-lambda-runtime-example " ,
26
21
platforms: [
@@ -44,16 +39,22 @@ let package = Package(
44
39
name: " HttpApiLambda " ,
45
40
dependencies: [
46
41
. product( name: " AWSLambdaRuntime " , package : " swift-aws-lambda-runtime " ) ,
47
- . product( name: " AWSLambdaEvents " , package : " swift-aws-lambda-events " )
48
- ] + deploymentDescriptorDependency,
42
+ . product( name: " AWSLambdaEvents " , package : " swift-aws-lambda-events " ) ,
43
+ // linking the dynamic library does not work on Linux with --static-swift-stdlib because it is a dynamic library,
44
+ // but we don't need it for packaging. Making it conditional will generate smaller ZIP files
45
+ . product( name: " AWSLambdaDeploymentDescriptor " , package : " swift-aws-lambda-runtime " , condition: . when( platforms: [ . macOS] ) )
46
+ ] ,
49
47
path: " ./HttpApiLambda "
50
48
) ,
51
49
. executableTarget(
52
50
name: " SQSLambda " ,
53
51
dependencies: [
54
52
. product( name: " AWSLambdaRuntime " , package : " swift-aws-lambda-runtime " ) ,
55
- . product( name: " AWSLambdaEvents " , package : " swift-aws-lambda-events " )
56
- ] + deploymentDescriptorDependency,
53
+ . product( name: " AWSLambdaEvents " , package : " swift-aws-lambda-events " ) ,
54
+ // linking the dynamic library does not work on Linux with --static-swift-stdlib because it is a dynamic library,
55
+ // but we don't need it for packaging. Making it conditional will generate smaller ZIP files
56
+ . product( name: " AWSLambdaDeploymentDescriptor " , package : " swift-aws-lambda-runtime " , condition: . when( platforms: [ . macOS] ) )
57
+ ] ,
57
58
path: " ./SQSLambda "
58
59
) ,
59
60
. testTarget(
0 commit comments