forked from nrfconnect/sdk-nrf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
72 lines (61 loc) · 1.73 KB
/
Copy pathCMakeLists.txt
File metadata and controls
72 lines (61 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Copyright (c) 2021-2022 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
# Get the include-folders from the imported CC3XX library
get_target_property(NRF_CC3XX_MBEDCRYPTO_INCLUDE_PATH
nrf_cc3xx_core_imported INTERFACE_INCLUDE_DIRECTORIES)
# Add nrf_cc3xx PSA Crypto Driver includes to psa_crypto_library_config
target_include_directories(psa_crypto_library_config
INTERFACE
${NRF_CC3XX_MBEDCRYPTO_INCLUDE_PATH}
)
if(CONFIG_PSA_NEED_CC3XX_ASYMMETRIC_SIGNATURE_DRIVER)
list(APPEND src_crypto_cc3xx
public_cc3xx_psa_asymmetric_signature.c
)
endif()
if(CONFIG_PSA_NEED_CC3XX_KEY_AGREEMENT_DRIVER)
list(APPEND src_crypto_cc3xx
public_cc3xx_psa_key_agreement.c
)
endif()
if(CONFIG_PSA_NEED_CC3XX_KEY_MANAGEMENT_DRIVER)
list(APPEND src_crypto_cc3xx
public_cc3xx_psa_key_management.c
)
endif()
# Add the PSA crypto driver only if any of the source files are added
if(src_crypto_cc3xx)
add_library(cc3xx_psa_driver STATIC
${src_crypto_cc3xx}
)
# Link to the PSA interface and library PSA crypto configurations
target_link_libraries(cc3xx_psa_driver
PRIVATE
psa_crypto_library_config
psa_interface
)
# Link psa_core with this driver
target_link_libraries(psa_core
PRIVATE
cc3xx_psa_driver
)
# Link to imported libraries for CC3XX APIs.
target_link_libraries(cc3xx_psa_driver
PRIVATE
nrf_cc3xx_psa_crypto_imported
nrf_cc3xx_core_imported
nrf_security_utils
)
nrf_security_add_zephyr_options_library(cc3xx_psa_driver)
endif()
# Link psa_core with the imported libraries
target_link_libraries(psa_core
INTERFACE
$<TARGET_NAME_IF_EXISTS:cc3xx_psa_driver>
nrf_cc3xx_psa_crypto_imported
nrf_cc3xx_core_imported
c
)