Skip to content

Commit

Permalink
cmake: nrfxlib_calculate_lib_path add NS_PROVIDED to allow non-secure…
Browse files Browse the repository at this point in the history
… libs

The `nrfxlib_calculate_lib_path` cmake function is given additional
parameter `NS_PROVIDED`. This parameter allows users of this function
to use non-secure libraries if necessary.

The support is added for nrf54l15 SoC only, but can be easily extended
to other SoCs if needed.

Signed-off-by: Andrzej Kuros <[email protected]>
  • Loading branch information
ankuns authored and rlubos committed Aug 12, 2024
1 parent 3eb9429 commit e844ccc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ include_guard(GLOBAL)
#
# SOC_MODE: Use the SoC name instead of the SoC architecture when calculating the path.
# For example 'nrf52840' will be used for the path instead of 'cortex-m4'
# NS_PROVIDED Use name identifying non-secure library version for builds with
# 'CONFIG_TRUSTED_EXECUTION_NONSECURE' on supported SoCs.
# Libraries that do not distinguish between secure and non-secure version
# should not use this parameter.
# BASE_DIR: Base path from where the calculated path should start from.
# When specifying BASE_DIR the path returned will be absolute, or
# '<dir>-NOTFOUND' if the path does not exists
Expand All @@ -28,7 +32,7 @@ include_guard(GLOBAL)
# This flag requires 'BASE_DIR'
#
function(nrfxlib_calculate_lib_path lib_path)
cmake_parse_arguments(CALC_LIB_PATH "SOFT_FLOAT_FALLBACK;SOC_MODE" "BASE_DIR" "" ${ARGN})
cmake_parse_arguments(CALC_LIB_PATH "SOFT_FLOAT_FALLBACK;SOC_MODE;NS_PROVIDED" "BASE_DIR" "" ${ARGN})

if(CALC_LIB_PATH_SOFT_FLOAT_FALLBACK AND NOT DEFINED CALC_LIB_PATH_BASE_DIR)
message(WARNING "nrfxlib_calculate_lib_path(SOFT_FLOAT_FALLBACK ...) "
Expand All @@ -46,6 +50,9 @@ function(nrfxlib_calculate_lib_path lib_path)
set(arch_soc_dir ${arch_soc_dir}_cpunet)
elseif(DEFINED CONFIG_SOC_NRF54L15_ENGA_CPUAPP)
set(arch_soc_dir ${arch_soc_dir}_cpuapp)
if(DEFINED CONFIG_TRUSTED_EXECUTION_NONSECURE AND ${CALC_LIB_PATH_NS_PROVIDED})
set(arch_soc_dir ${arch_soc_dir}_ns)
endif()
elseif(DEFINED CONFIG_SOC_NRF54H20_CPURAD)
set(arch_soc_dir ${arch_soc_dir}_cpurad)
endif()
Expand Down

0 comments on commit e844ccc

Please sign in to comment.