Skip to content

Commit 5d1c1ba

Browse files
Add CMakeLists for new modules
1 parent 13075b8 commit 5d1c1ba

File tree

5 files changed

+73
-2
lines changed

5 files changed

+73
-2
lines changed

.github/workflows/pull_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
{ "name": "CCryptoBoringSSL", "type": "source", "exceptions": [] },
4545
{ "name": "CCryptoBoringSSLShims", "type": "source", "exceptions": [] },
4646
{ "name": "CryptoBoringWrapper", "type": "source", "exceptions": [] },
47+
{ "name": "CXKCP", "type": "source", "exceptions": [] },
48+
{ "name": "CXKCPShims", "type": "source", "exceptions": [] },
4749
{ "name": "Crypto", "type": "source", "exceptions": [] },
4850
{ "name": "_CryptoExtras", "type": "source", "exceptions": [] },
4951
{ "name": "CCryptoBoringSSL", "type": "assembly", "exceptions": [ "*/AES/*.swift" ] }

Sources/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
add_subdirectory(CCryptoBoringSSL)
1616
add_subdirectory(CCryptoBoringSSLShims)
17+
add_subdirectory(CXKCP)
18+
add_subdirectory(CXKCPShims)
1719
add_subdirectory(CryptoBoringWrapper)
1820
add_subdirectory(Crypto)
1921
add_subdirectory(_CryptoExtras)

Sources/CXKCP/CMakeLists.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
##===----------------------------------------------------------------------===##
2+
##
3+
## This source file is part of the SwiftCrypto open source project
4+
##
5+
## Copyright (c) 2021 Apple Inc. and the SwiftCrypto project authors
6+
## Licensed under Apache License v2.0
7+
##
8+
## See LICENSE.txt for license information
9+
## See CONTRIBUTORS.txt for the list of SwiftCrypto project authors
10+
##
11+
## SPDX-License-Identifier: Apache-2.0
12+
##
13+
##===----------------------------------------------------------------------===##
14+
15+
add_library(CXKCP STATIC
16+
"FIPS202-opt64/KeccakHash.c"
17+
"FIPS202-opt64/KeccakP-1600-opt64.c"
18+
"FIPS202-opt64/KeccakSponge.c"
19+
"FIPS202-opt64/SimpleFIPS202.c"
20+
)
21+
22+
target_include_directories(CXKCP PUBLIC
23+
include)
24+
25+
target_compile_definitions(CXKCP PRIVATE
26+
$<$<PLATFORM_ID:Windows>:WIN32_LEAN_AND_MEAN>)
27+
target_link_libraries(CXKCP PUBLIC
28+
$<$<NOT:$<PLATFORM_ID:Darwin>>:dispatch>
29+
$<$<NOT:$<PLATFORM_ID:Darwin>>:Foundation>
30+
SwiftASN1)
31+
set_target_properties(CXKCP PROPERTIES
32+
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include;${CMAKE_Swift_MODULE_DIRECTORY}")
33+
34+
set_property(GLOBAL APPEND PROPERTY SWIFT_CRYPTO_EXPORTS CXKCP)

Sources/CXKCPShims/CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
##===----------------------------------------------------------------------===##
2+
##
3+
## This source file is part of the SwiftCrypto open source project
4+
##
5+
## Copyright (c) 2021 Apple Inc. and the SwiftCrypto project authors
6+
## Licensed under Apache License v2.0
7+
##
8+
## See LICENSE.txt for license information
9+
## See CONTRIBUTORS.txt for the list of SwiftCrypto project authors
10+
##
11+
## SPDX-License-Identifier: Apache-2.0
12+
##
13+
##===----------------------------------------------------------------------===##
14+
15+
add_library(CXKCPShims STATIC
16+
"shims.c"
17+
)
18+
19+
target_include_directories(CXKCPShims PUBLIC
20+
include
21+
$<TARGET_PROPERTY:CXKCP,INCLUDE_DIRECTORIES>)
22+
23+
target_link_libraries(CXKCPShims PUBLIC
24+
CXKCP)
25+
26+
set_target_properties(CXKCPShims PROPERTIES
27+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
28+
29+
set_property(GLOBAL APPEND PROPERTY SWIFT_CRYPTO_EXPORTS CXKCPShims)

Sources/Crypto/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,17 @@ endif()
118118
target_include_directories(Crypto PRIVATE
119119
$<TARGET_PROPERTY:CCryptoBoringSSL,INCLUDE_DIRECTORIES>
120120
$<TARGET_PROPERTY:CCryptoBoringSSLShims,INCLUDE_DIRECTORIES>
121-
$<TARGET_PROPERTY:CryptoBoringWrapper,INCLUDE_DIRECTORIES>)
121+
$<TARGET_PROPERTY:CryptoBoringWrapper,INCLUDE_DIRECTORIES>
122+
$<TARGET_PROPERTY:CXKCP,INCLUDE_DIRECTORIES>
123+
$<TARGET_PROPERTY:CXKCPShims,INCLUDE_DIRECTORIES>)
122124
target_link_libraries(Crypto PUBLIC
123125
$<$<NOT:$<PLATFORM_ID:Darwin>>:dispatch>
124126
$<$<NOT:$<PLATFORM_ID:Darwin>>:Foundation>
125127
CCryptoBoringSSL
126128
CCryptoBoringSSLShims
127-
CryptoBoringWrapper)
129+
CryptoBoringWrapper
130+
CXKCP
131+
CXKCPShims)
128132
target_compile_options(Crypto PRIVATE ${SWIFT_CRYPTO_COMPILE_OPTIONS})
129133
set_target_properties(Crypto PROPERTIES
130134
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})

0 commit comments

Comments
 (0)