-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
81 lines (69 loc) · 2.29 KB
/
CMakeLists.txt
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
73
74
75
76
77
78
79
80
81
#-------------------------------------------------------------------------------
# Copyright (c) 2023-2024 NXP.
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
# set path of crypto modules in zephyre subsystem
set(NXP_MODULE_CRYPTO_PATH ${ZEPHYR_HAL_NXP_MODULE_DIR}/../../crypto)
add_library(McuxElsPkc)
target_compile_options(
McuxElsPkc
PUBLIC
${TOOLCHAIN_C_FLAGS}
-mcmse # Why is this not even part of the default zephyr build options?
)
target_link_options(
McuxElsPkc
PRIVATE
${TOOLCHAIN_LD_FLAGS}
)
target_include_directories(McuxElsPkc
PRIVATE
# SDK driver header files
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/drivers/common
# psa/crypto.h and psa/crypto_types.h
${NXP_MODULE_CRYPTO_PATH}/mbedtls/include
${NXP_MODULE_CRYPTO_PATH}/mbedtls/include/psa
# for psa driver wrapper
${NXP_MODULE_CRYPTO_PATH}/mbedtls/library
)
if(CONFIG_BUILD_WITH_TFM)
target_compile_options(
McuxElsPkc
PUBLIC
${COMPILER_CP_FLAG}
)
endif()
if(CONFIG_SOC_SERIES_RW6XX)
target_compile_definitions(
McuxElsPkc
PUBLIC
CPU_RW612ETA1I
CPU_RW612ETA2I
)
target_include_directories(McuxElsPkc
PRIVATE
# cmsis required to build els_pkc
${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/rw61x/cmsis_cortex_m_5_5_1/inc
)
target_include_directories(McuxElsPkc
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/rw61x/
${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/rw61x/inc
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/devices/RW612
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/devices/RW612/drivers
)
target_sources(McuxElsPkc
PRIVATE
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/devices/RW612/drivers/fsl_ocotp.c
${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/rw61x/mcux_els.c
${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/rw61x/mcux_pkc.c
)
endif()
if(CONFIG_EXPORT_MCUX_ELS_PKC_TARGETS)
export(TARGETS McuxElsPkc
FILE "${CMAKE_CURRENT_BINARY_DIR}/McuxElsPkcTargets.cmake"
NAMESPACE McuxElsPkc::
)
endif()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src)