mirror of
https://github.com/apple/swift-crypto
synced 2026-11-28 05:04:21 +00:00
Set up CMake build for _CryptoExtras (#144)
* Set up CMake build for _CryptoExtras * Add CMakeLists.txt to exclude list
This commit is contained in:
1 parent
75ec60b8b4
commit
935c74be2f
5 files changed
+66
-6
No files matched your search
+13
-2
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// This source file is part of the SwiftCrypto open source project
|
||||
//
|
||||
// Copyright (c) 2019 Apple Inc. and the SwiftCrypto project authors
|
||||
// Copyright (c) 2019-2023 Apple Inc. and the SwiftCrypto project authors
|
||||
// Licensed under Apache License v2.0
|
||||
//
|
||||
// See LICENSE.txt for license information
|
||||
@@ -107,7 +107,18 @@ let package = Package(
|
||||
],
|
||||
swiftSettings: swiftSettings
|
||||
),
|
||||
.target(name: "_CryptoExtras", dependencies: ["CCryptoBoringSSL", "CCryptoBoringSSLShims", "CryptoBoringWrapper", "Crypto"]),
|
||||
.target(
|
||||
name: "_CryptoExtras",
|
||||
dependencies: [
|
||||
"CCryptoBoringSSL",
|
||||
"CCryptoBoringSSLShims",
|
||||
"CryptoBoringWrapper",
|
||||
"Crypto"
|
||||
],
|
||||
exclude: [
|
||||
"CMakeLists.txt",
|
||||
]
|
||||
),
|
||||
.target(
|
||||
name: "CryptoBoringWrapper",
|
||||
dependencies: [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
##
|
||||
## This source file is part of the SwiftCrypto open source project
|
||||
##
|
||||
## Copyright (c) 2021 Apple Inc. and the SwiftCrypto project authors
|
||||
## Copyright (c) 2021-2023 Apple Inc. and the SwiftCrypto project authors
|
||||
## Licensed under Apache License v2.0
|
||||
##
|
||||
## See LICENSE.txt for license information
|
||||
@@ -16,3 +16,4 @@ add_subdirectory(CCryptoBoringSSL)
|
||||
add_subdirectory(CCryptoBoringSSLShims)
|
||||
add_subdirectory(CryptoBoringWrapper)
|
||||
add_subdirectory(Crypto)
|
||||
add_subdirectory(_CryptoExtras)
|
||||
@@ -0,0 +1,46 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
##
|
||||
## This source file is part of the SwiftCrypto open source project
|
||||
##
|
||||
## Copyright (c) 2023 Apple Inc. and the SwiftCrypto project authors
|
||||
## Licensed under Apache License v2.0
|
||||
##
|
||||
## See LICENSE.txt for license information
|
||||
## See CONTRIBUTORS.md for the list of SwiftCrypto project authors
|
||||
##
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
##
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
add_library(_CryptoExtras
|
||||
"AES/AES_GCM_SIV.swift"
|
||||
"AES/Block Function.swift"
|
||||
"AES/BoringSSL/AES_GCM_SIV_boring.swift"
|
||||
"RSA/RSA.swift"
|
||||
"RSA/RSA_boring.swift"
|
||||
"RSA/RSA_security.swift"
|
||||
"Util/BoringSSLHelpers.swift"
|
||||
"Util/CryptoKitErrors_boring.swift"
|
||||
"Util/DigestType.swift"
|
||||
"Util/Error.swift"
|
||||
"Util/PEMDocument.swift"
|
||||
"Util/RandomBytes.swift")
|
||||
|
||||
target_include_directories(_CryptoExtras PRIVATE
|
||||
$<TARGET_PROPERTY:CCryptoBoringSSL,INCLUDE_DIRECTORIES>
|
||||
$<TARGET_PROPERTY:CCryptoBoringSSLShims,INCLUDE_DIRECTORIES>)
|
||||
|
||||
target_link_libraries(_CryptoExtras PUBLIC
|
||||
$<$<NOT:$<PLATFORM_ID:Darwin>>:Foundation>
|
||||
Crypto
|
||||
CryptoBoringWrapper
|
||||
CCryptoBoringSSL
|
||||
CCryptoBoringSSLShims)
|
||||
|
||||
target_link_options(_CryptoExtras PRIVATE
|
||||
"$<$<PLATFORM_ID:Darwin>:SHELL:-Xlinker -framework -Xlinker Security>")
|
||||
|
||||
set_target_properties(_CryptoExtras PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY SWIFT_CRYPTO_EXPORTS _CryptoExtras)
|
||||
@@ -3,7 +3,7 @@
|
||||
##
|
||||
## This source file is part of the SwiftCrypto open source project
|
||||
##
|
||||
## Copyright (c) 2019-2021 Apple Inc. and the SwiftCrypto project authors
|
||||
## Copyright (c) 2019-2023 Apple Inc. and the SwiftCrypto project authors
|
||||
## Licensed under Apache License v2.0
|
||||
##
|
||||
## See LICENSE.txt for license information
|
||||
@@ -17,7 +17,7 @@ set -eu
|
||||
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
function replace_acceptable_years() {
|
||||
# this needs to replace all acceptable forms with 'YEARS'
|
||||
sed -e 's/20[12][890]-20[12][1290]/YEARS/' -e 's/20[12][90123]/YEARS/'
|
||||
sed -e 's/20[12][8901]-20[12][90123]/YEARS/' -e 's/20[12][90123]/YEARS/'
|
||||
}
|
||||
|
||||
printf "=> Checking for unacceptable language... "
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
##
|
||||
## This source file is part of the SwiftCrypto open source project
|
||||
##
|
||||
## Copyright (c) 2021 Apple Inc. and the SwiftCrypto project authors
|
||||
## Copyright (c) 2021-2023 Apple Inc. and the SwiftCrypto project authors
|
||||
## Licensed under Apache License v2.0
|
||||
##
|
||||
## See LICENSE.txt for license information
|
||||
@@ -80,6 +80,8 @@ function update_cmakelists_assembly() {
|
||||
|
||||
update_cmakelists_source "CCryptoBoringSSL" "*.c"
|
||||
update_cmakelists_source "CCryptoBoringSSLShims" "*.c"
|
||||
update_cmakelists_source "CryptoBoringWrapper" "*.swift"
|
||||
update_cmakelists_source "Crypto" "*.swift"
|
||||
update_cmakelists_source "_CryptoExtras" "*.swift"
|
||||
|
||||
update_cmakelists_assembly "CCryptoBoringSSL"
|
||||
Reference in new issue
Block a user