Skip to content

Commit 7982f5d

Browse files
committed
[nrf fromlist] modules: hal_nordic: align to BSP outside of nrfx
Align sdk-zephyr to having external BSP outside of nrfx directory. Upstream PR #: 96842 Signed-off-by: Magdalena Pastula <[email protected]>
1 parent c475e9f commit 7982f5d

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

modules/hal_nordic/nrfx/CMakeLists.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,26 @@ if(NOT DEFINED CONFIG_SOC_NORDIC_BSP_NAME)
1515
message(FATAL_ERROR "CONFIG_SOC_NORDIC_BSP_NAME has to be defined.")
1616
endif()
1717

18+
set(BSP_DIR ${NRFX_DIR}/bsp)
1819
set(INC_DIR ${NRFX_DIR}/drivers/include)
1920
set(SRC_DIR ${NRFX_DIR}/drivers/src)
20-
set(BSP_DIR ${NRFX_DIR}/bsp)
2121
set(HELPERS_DIR ${NRFX_DIR}/helpers)
22-
set(SOC_DIR ${BSP_DIR}/${CONFIG_SOC_NORDIC_BSP_NAME})
22+
23+
if(CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable")
24+
set(SOC_DIR ${BSP_DIR}/${CONFIG_SOC_NORDIC_BSP_NAME})
25+
else()
26+
string(TOUPPER ${CONFIG_SOC_NORDIC_BSP_NAME} BSP_MODULE_NAME)
27+
set(SOC_DIR "${ZEPHYR_${BSP_MODULE_NAME}_MODULE_DIR}")
28+
endif()
29+
2330
set(MDK_DIR ${SOC_DIR}/mdk)
2431

2532
if(NOT CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable")
26-
zephyr_compile_definitions(NRFX_BSP_NRF_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/mdk/nrf.h")
27-
zephyr_compile_definitions(NRFX_BSP_ERRATAS_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/mdk/nrf_erratas.h")
28-
zephyr_compile_definitions(NRFX_BSP_SOC_IRQS_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/soc/nrfx_irqs.h")
29-
zephyr_compile_definitions(NRFX_BSP_NRFX_EXT_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/nrfx_ext.h")
30-
zephyr_compile_definitions(NRFX_BSP_NRFX_COREDEP_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/soc/nrfx_coredep_defs.h")
33+
zephyr_compile_definitions(NRFX_BSP_NRF_PATH="mdk/nrf.h")
34+
zephyr_compile_definitions(NRFX_BSP_ERRATAS_PATH="mdk/nrf_erratas.h")
35+
zephyr_compile_definitions(NRFX_BSP_SOC_IRQS_PATH="soc/nrfx_irqs.h")
36+
zephyr_compile_definitions(NRFX_BSP_NRFX_EXT_PATH="nrfx_ext.h")
37+
zephyr_compile_definitions(NRFX_BSP_NRFX_COREDEP_PATH="soc/nrfx_coredep_defs.h")
3138
endif()
3239

3340
zephyr_include_directories(${NRFX_DIR})

0 commit comments

Comments
 (0)