1# SPDX-License-Identifier: Apache-2.0
2
3zephyr_library()
4
5if(CONFIG_ARM)
6  set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "SoC Linker script")
7endif()
8
9zephyr_library_sources(
10  validate_base_addresses.c
11  validate_binding_headers.c
12  validate_enabled_instances.c
13  )
14
15# Include dt-bindings headers into the build. This lets us validate all required
16# DT values against the MDK, without having to conditionally include different
17# headers for different SoCs.
18set(dt_binding_includes ${DTS_INCLUDE_FILES})
19list(FILTER dt_binding_includes INCLUDE REGEX "/dt-bindings/.*\.h$")
20
21set(include_flag $<TARGET_PROPERTY:compiler,include_file>$<SEMICOLON>)
22
23set_source_files_properties(
24  validate_binding_headers.c
25  DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
26  PROPERTIES COMPILE_OPTIONS "${include_flag}$<JOIN:${dt_binding_includes},;${include_flag}>"
27)
28
29if(CONFIG_SOC_HAS_TIMING_FUNCTIONS AND NOT CONFIG_BOARD_HAS_TIMING_FUNCTIONS)
30  if(CONFIG_TIMING_FUNCTIONS)
31    # Use nRF-specific timing calculations only if DWT is not present
32    if(NOT CONFIG_CORTEX_M_DWT)
33      zephyr_library_sources(timing.c)
34    endif()
35  endif()
36endif()
37
38if(CONFIG_BUILD_WITH_TFM)
39  set_property(TARGET zephyr_property_target
40    APPEND PROPERTY TFM_CMAKE_OPTIONS -DHAL_NORDIC_PATH=${ZEPHYR_HAL_NORDIC_MODULE_DIR}
41    )
42
43  set_property(TARGET zephyr_property_target
44    APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_NS_STORAGE=${CONFIG_TFM_NRF_NS_STORAGE}
45    )
46endif()
47
48add_subdirectory(${SOC_SERIES})
49add_subdirectory(common)
50