Skip to content

Commit

Permalink
latest submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Nov 15, 2024
1 parent 93ac601 commit b1b19d7
Show file tree
Hide file tree
Showing 12 changed files with 153 additions and 113 deletions.
243 changes: 141 additions & 102 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
// swift-tools-version:5.7
import PackageDescription

let excludesFromAll = ["tests", "cmake", "CONTRIBUTING.md",
"LICENSE", "format-check.py", "NOTICE", "builder.json",
"CMakeLists.txt", "README.md"]
let excludesFromAll = [
"tests", "cmake", "CONTRIBUTING.md",
"LICENSE", "format-check.py", "NOTICE", "builder.json",
"CMakeLists.txt", "README.md",
]
var packageTargets: [Target] = []

var package = Package(name: "aws-crt-swift",
platforms: [.iOS(.v13), .macOS(.v10_15), .tvOS(.v13), .watchOS(.v6)],
products: [
.library(name: "AwsCommonRuntimeKit", targets: ["AwsCommonRuntimeKit"]),
.executable(name: "Elasticurl", targets: ["Elasticurl"])
]
packageTargets.append(
.target(
name: "AwsCPlatformConfig",
path: "aws-common-runtime/config",
publicHeadersPath: ".",
cSettings: cSettings
))
var package = Package(
name: "aws-crt-swift",
platforms: [.iOS(.v13), .macOS(.v10_15), .tvOS(.v13), .watchOS(.v6)],
products: [
.library(name: "AwsCommonRuntimeKit", targets: ["AwsCommonRuntimeKit"]),
.executable(name: "Elasticurl", targets: ["Elasticurl"]),
]
)

let cSettings: [CSetting] = [
Expand All @@ -28,110 +37,128 @@ let cSettings: [CSetting] = [
/// We are also not using any architecture based conditionals due to lack of proper cross compilation support.
/// Configure aws-c-common
//////////////////////////////////////////////////////////////////////
var awsCCommonPlatformExcludes = ["source/android",
"AWSCRTAndroidTestRunner", "verification",
"include/aws/common/",
"scripts/appverifier_ctest.py",
"scripts/appverifier_xml.py",
"source/linux/system_info.c",
"bin/"] + excludesFromAll
var awsCCommonPlatformExcludes =
[
"source/android",
"AWSCRTAndroidTestRunner", "verification",
"include/aws/common/",
"scripts/appverifier_ctest.py",
"scripts/appverifier_xml.py",
"source/linux/system_info.c",
"bin/",
] + excludesFromAll

// includes arch/generic because the SwiftPM doesn't like the necessary compiler flags.
awsCCommonPlatformExcludes.append("source/arch/intel")
awsCCommonPlatformExcludes.append("source/arch/arm")
#if !os(Windows)
awsCCommonPlatformExcludes.append("source/windows")
awsCCommonPlatformExcludes.append("source/windows")
#endif
let cSettingsCommon: [CSetting] = [
.headerSearchPath("source/external/libcbor"),
.define("DEBUG_BUILD", .when(configuration: .debug))
.define("DEBUG_BUILD", .when(configuration: .debug)),
]

//////////////////////////////////////////////////////////////////////
/// aws-c-cal
//////////////////////////////////////////////////////////////////////
var calDependencies: [Target.Dependency] = ["AwsCCommon"]
#if os(Linux)
packageTargets.append( .systemLibrary(
name: "LibCrypto",
pkgConfig: "libcrypto",
providers: [
.apt(["openssl libssl-dev"]),
.yum(["openssl openssl-devel"])
]
))
calDependencies.append("LibCrypto")
packageTargets.append(
.systemLibrary(
name: "LibCrypto",
pkgConfig: "libcrypto",
providers: [
.apt(["openssl libssl-dev"]),
.yum(["openssl openssl-devel"]),
]
))
calDependencies.append("LibCrypto")
#endif

var awsCCalPlatformExcludes = [
"bin",
"include/aws/cal/private",
"CODE_OF_CONDUCT.md",
"ecdsa-fuzz-corpus/windows/p256_sig_corpus.txt",
"ecdsa-fuzz-corpus/darwin/p256_sig_corpus.txt"] + excludesFromAll
var awsCCalPlatformExcludes =
[
"bin",
"include/aws/cal/private",
"CODE_OF_CONDUCT.md",
"ecdsa-fuzz-corpus/windows/p256_sig_corpus.txt",
"ecdsa-fuzz-corpus/darwin/p256_sig_corpus.txt",
] + excludesFromAll

#if os(Windows)
awsCCalPlatformExcludes.append("source/darwin")
awsCCalPlatformExcludes.append("source/unix")
awsCCalPlatformExcludes.append("source/darwin")
awsCCalPlatformExcludes.append("source/unix")
#elseif os(Linux)
awsCCalPlatformExcludes.append("source/windows")
awsCCalPlatformExcludes.append("source/darwin")
awsCCalPlatformExcludes.append("source/windows")
awsCCalPlatformExcludes.append("source/darwin")
#else // macOS, iOS, watchOS, tvOS
awsCCalPlatformExcludes.append("source/windows")
awsCCalPlatformExcludes.append("source/unix")
awsCCalPlatformExcludes.append("source/windows")
awsCCalPlatformExcludes.append("source/unix")
#endif

//////////////////////////////////////////////////////////////////////
/// s2n-tls
//////////////////////////////////////////////////////////////////////
#if os(Linux)
let s2nExcludes = ["bin", "codebuild", "coverage", "docker-images",
"docs", "lib",
"libcrypto-build", "scram",
"s2n.mk", "Makefile", "stuffer/Makefile", "crypto/Makefile",
"tls/Makefile", "utils/Makefile", "error/Makefile", "tls/extensions/Makefile",
"scripts/", "codebuild", "bindings/rust", "VERSIONING.rst", "tests",
"cmake/s2n-config.cmake", "CMakeLists.txt", "README.md", "cmake", "NOTICE", "LICENSE"]
packageTargets.append(.target(
name: "S2N_TLS",
dependencies: ["LibCrypto"],
path: "aws-common-runtime/s2n",
exclude: s2nExcludes,
publicHeadersPath: "api",
cSettings: [
.headerSearchPath("./"),
.define("POSIX_C_SOURCE=200809L"),
.define("S2N_NO_PQ")
let s2nExcludes = [
"bin", "codebuild", "coverage", "docker-images",
"docs", "lib",
"libcrypto-build", "scram",
"s2n.mk", "Makefile", "stuffer/Makefile", "crypto/Makefile",
"tls/Makefile", "utils/Makefile", "error/Makefile", "tls/extensions/Makefile",
"scripts/", "codebuild", "bindings/rust", "VERSIONING.rst", "tests",
"cmake/s2n-config.cmake", "CMakeLists.txt", "README.md", "cmake", "NOTICE", "LICENSE",
]
))
packageTargets.append(
.target(
name: "S2N_TLS",
dependencies: ["LibCrypto"],
path: "aws-common-runtime/s2n",
exclude: s2nExcludes,
publicHeadersPath: "api",
cSettings: [
.headerSearchPath("./"),
.define("S2N_NO_PQ"),
// This is a hack to get around the fact that S2N uses the compiler option `-include`
// to include `s2n_prelude.h` in all .c files. Since SwiftPM doesn't support compiler flags,
// we manually define the macros from `s2n_prelude.h`.
.define("_S2N_PRELUDE_INCLUDED"),
.define("S2N_BUILD_RELEASE"),
.define("_FORTIFY_SOURCE", to: "2"),
.define("POSIX_C_SOURCE", to: "200809L"),
]
))
#endif

//////////////////////////////////////////////////////////////////////
/// aws-c-io
//////////////////////////////////////////////////////////////////////
var ioDependencies: [Target.Dependency] = ["AwsCCommon", "AwsCCal"]
var awsCIoPlatformExcludes = ["docs", "CODE_OF_CONDUCT.md", "codebuild", "PKCS11.md",
"source/pkcs11/v2.40"] + excludesFromAll
var awsCIoPlatformExcludes =
[
"docs", "CODE_OF_CONDUCT.md", "codebuild", "PKCS11.md",
"source/pkcs11/v2.40",
] + excludesFromAll
var cSettingsIO = cSettings

#if os(Linux)
ioDependencies.append("S2N_TLS")
cSettingsIO.append(.define("USE_S2N"))
ioDependencies.append("S2N_TLS")
cSettingsIO.append(.define("USE_S2N"))
#endif

#if os(Windows)
awsCIoPlatformExcludes.append("source/posix")
awsCIoPlatformExcludes.append("source/linux")
awsCIoPlatformExcludes.append("source/s2n")
awsCIoPlatformExcludes.append("source/darwin")
awsCIoPlatformExcludes.append("source/posix")
awsCIoPlatformExcludes.append("source/linux")
awsCIoPlatformExcludes.append("source/s2n")
awsCIoPlatformExcludes.append("source/darwin")
#elseif os(Linux)
awsCIoPlatformExcludes.append("source/windows")
awsCIoPlatformExcludes.append("source/bsd")
awsCIoPlatformExcludes.append("source/darwin")
awsCIoPlatformExcludes.append("source/windows")
awsCIoPlatformExcludes.append("source/bsd")
awsCIoPlatformExcludes.append("source/darwin")
#else // macOS, iOS, watchOS, tvOS
awsCIoPlatformExcludes.append("source/windows")
awsCIoPlatformExcludes.append("source/linux")
awsCIoPlatformExcludes.append("source/s2n")
awsCIoPlatformExcludes.append("source/windows")
awsCIoPlatformExcludes.append("source/linux")
awsCIoPlatformExcludes.append("source/s2n")
#endif

//////////////////////////////////////////////////////////////////////
Expand All @@ -144,7 +171,8 @@ var awsCChecksumsExcludes = [
"builder.json",
"README.md",
"cmake",
"tests"]
"tests",
]

// swift never uses Microsoft Visual C++ compiler
awsCChecksumsExcludes.append("source/intel/visualc")
Expand All @@ -166,18 +194,23 @@ let awsCSdkUtilsPlatformExcludes = ["CODE_OF_CONDUCT.md"] + excludesFromAll
//////////////////////////////////////////////////////////////////////
/// aws-c-compression
//////////////////////////////////////////////////////////////////////
var awsCCompressionPlatformExcludes = ["source/huffman_generator/", "CODE_OF_CONDUCT.md",
"codebuild"] + excludesFromAll
var awsCCompressionPlatformExcludes =
[
"source/huffman_generator/", "CODE_OF_CONDUCT.md",
"codebuild",
] + excludesFromAll

//////////////////////////////////////////////////////////////////////
/// aws-c-http
//////////////////////////////////////////////////////////////////////
var awsCHttpPlatformExcludes = [
"bin",
"integration-testing",
"include/aws/http/private",
"CODE_OF_CONDUCT.md",
"codebuild/linux-integration-tests.yml"] + excludesFromAll
var awsCHttpPlatformExcludes =
[
"bin",
"integration-testing",
"include/aws/http/private",
"CODE_OF_CONDUCT.md",
"codebuild/linux-integration-tests.yml",
] + excludesFromAll

//////////////////////////////////////////////////////////////////////
/// aws-c-auth
Expand All @@ -187,18 +220,20 @@ let awsCAuthPlatformExcludes = ["CODE_OF_CONDUCT.md"] + excludesFromAll
//////////////////////////////////////////////////////////////////////
/// aws-c-eventstreams
//////////////////////////////////////////////////////////////////////
let awsCEventStreamExcludes = [
"bin",
"CODE_OF_CONDUCT.md",
"clang-tidy/run-clang-tidy.sh"] + excludesFromAll
let awsCEventStreamExcludes =
[
"bin",
"CODE_OF_CONDUCT.md",
"clang-tidy/run-clang-tidy.sh",
] + excludesFromAll

packageTargets.append(contentsOf: [
.target(
name: "AwsCPlatformConfig",
path: "aws-common-runtime/config",
publicHeadersPath: ".",
cSettings: cSettings
),
// .target(
// name: "AwsCPlatformConfig",
// path: "aws-common-runtime/config",
// publicHeadersPath: ".",
// cSettings: cSettings
// ),
.target(
name: "AwsCCommon",
dependencies: ["AwsCPlatformConfig"],
Expand Down Expand Up @@ -243,7 +278,9 @@ packageTargets.append(contentsOf: [
),
.target(
name: "AwsCAuth",
dependencies: ["AwsCHttp", "AwsCCompression", "AwsCCal", "AwsCIo", "AwsCSdkUtils", "AwsCCommon"],
dependencies: [
"AwsCHttp", "AwsCCompression", "AwsCCal", "AwsCIo", "AwsCSdkUtils", "AwsCCommon",
],
path: "aws-common-runtime/aws-c-auth",
exclude: awsCAuthPlatformExcludes,
cSettings: cSettings
Expand All @@ -264,14 +301,16 @@ packageTargets.append(contentsOf: [
),
.target(
name: "AwsCommonRuntimeKit",
dependencies: [ "AwsCAuth",
"AwsCHttp",
"AwsCCal",
"AwsCCompression",
"AwsCIo",
"AwsCCommon",
"AwsCChecksums",
"AwsCEventStream"],
dependencies: [
"AwsCAuth",
"AwsCHttp",
"AwsCCal",
"AwsCCompression",
"AwsCIo",
"AwsCCommon",
"AwsCChecksums",
"AwsCEventStream",
],
path: "Source/AwsCommonRuntimeKit",
resources: [
.copy("PrivacyInfo.xcprivacy")
Expand All @@ -289,6 +328,6 @@ packageTargets.append(contentsOf: [
name: "Elasticurl",
dependencies: ["AwsCommonRuntimeKit"],
path: "Source/Elasticurl"
)
] )
),
])
package.targets = packageTargets
2 changes: 1 addition & 1 deletion aws-common-runtime/aws-c-auth
Submodule aws-c-auth updated 2 files
+1 −5 CMakeLists.txt
+2 −2 README.md
2 changes: 1 addition & 1 deletion aws-common-runtime/aws-c-cal
Submodule aws-c-cal updated 2 files
+2 −6 CMakeLists.txt
+1 −1 README.md
2 changes: 1 addition & 1 deletion aws-common-runtime/aws-c-compression
2 changes: 1 addition & 1 deletion aws-common-runtime/aws-c-event-stream
2 changes: 1 addition & 1 deletion aws-common-runtime/aws-c-io
3 changes: 2 additions & 1 deletion aws-common-runtime/config/aws/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#ifndef AWS_COMMON_CONFIG_H
#define AWS_COMMON_CONFIG_H

/*
* This header exposes compiler feature test results determined during cmake
* configure time to inline function implementations. The macros defined here
Expand All @@ -13,7 +14,7 @@
*/
#ifdef __APPLE__
/* This is a trick to skip OpenSSL header on Apple platforms since Swift Package Manager is not smart enough to exclude
* some headers.
* some headers.
*/
# define AWS_C_CAL_OPENSSLCRYPTO_COMMON_H
#endif
Expand Down
2 changes: 1 addition & 1 deletion aws-common-runtime/s2n
Submodule s2n updated 151 files

0 comments on commit b1b19d7

Please sign in to comment.