1# SPDX-License-Identifier: Apache-2.0
2#
3# Copyright (c) 2021, Nordic Semiconductor ASA
4
5# Configure SoC settings based on Kconfig settings.
6#
7# This CMake module will set the following variables in the build system based
8# on Kconfig settings for the selected SoC.
9#
10# Outcome:
11# The following variables will be defined when this CMake module completes:
12#
13# - SOC_NAME:   Name of the SoC in use, identical to CONFIG_SOC
14# - SOC_SERIES: Name of the SoC series in use, identical to CONFIG_SOC_SERIES
15# - SOC_FAMILY: Name of the SoC family, identical to CONFIG_SOC_FAMILY
16#
17# Variables set by this module and not mentioned above are considered internal
18# use only and may be removed, renamed, or re-purposed without prior notice.
19
20include_guard(GLOBAL)
21
22include(kconfig)
23
24set(SOC_NAME   ${CONFIG_SOC})
25set(SOC_SERIES ${CONFIG_SOC_SERIES})
26set(SOC_TOOLCHAIN_NAME ${CONFIG_SOC_TOOLCHAIN_NAME})
27set(SOC_FAMILY ${CONFIG_SOC_FAMILY})
28set(SOC_V2_DIR ${SOC_${SOC_NAME}_DIR})
29set(SOC_FULL_DIR ${SOC_V2_DIR} CACHE PATH "Path to the SoC directory." FORCE)
30set(SOC_DIRECTORIES ${SOC_${SOC_NAME}_DIRECTORIES} CACHE INTERNAL
31    "List of SoC directories for SoC (${SOC_NAME})" FORCE
32)
33foreach(dir ${SOC_DIRECTORIES})
34  set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/soc.yml)
35endforeach()
36