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
24if(HWMv2)
25  set(SOC_NAME   ${CONFIG_SOC})
26  set(SOC_SERIES ${CONFIG_SOC_SERIES})
27  set(SOC_TOOLCHAIN_NAME ${CONFIG_SOC_TOOLCHAIN_NAME})
28  set(SOC_FAMILY ${CONFIG_SOC_FAMILY})
29  set(SOC_V2_DIR ${SOC_${SOC_NAME}_DIR})
30  set(SOC_FULL_DIR ${SOC_V2_DIR} CACHE PATH "Path to the SoC directory." FORCE)
31  set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${SOC_V2_DIR}/soc.yml)
32endif()
33