cmake: Move SOC_* var defines to cmake/app/boilerplate.cmake

We need access to SOC_PATH in dts.cmake so we need to move the
definitions of SOC_NAME, SOC_SERIES, SOC_FAMILY, and SOC_PATH out of the
toplevel CMakeLists.txt and into cmake/app/boilerplate.cmake.  We place
them before we include cmake/dts.cmake so they will be available to use
in it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2018-02-22 09:25:03 -06:00 committed by Kumar Gala
commit 440cc18d1b
2 changed files with 11 additions and 10 deletions

View file

@ -19,16 +19,6 @@ assert(toolchain_is_ok "The toolchain is unable to build a dummy C file. See CMa
set(CMAKE_EXECUTABLE_SUFFIX .elf)
set(SOC_NAME ${CONFIG_SOC})
set(SOC_SERIES ${CONFIG_SOC_SERIES})
set(SOC_FAMILY ${CONFIG_SOC_FAMILY})
if("${SOC_SERIES}" STREQUAL "")
set(SOC_PATH ${SOC_NAME})
else()
set(SOC_PATH ${SOC_FAMILY}/${SOC_SERIES})
endif()
if(NOT PROPERTY_LINKER_SCRIPT_DEFINES)
set_property(GLOBAL PROPERTY PROPERTY_LINKER_SCRIPT_DEFINES -D__GCC_LINKER_CMD__)
endif()

View file

@ -239,6 +239,17 @@ include(${ZEPHYR_BASE}/cmake/host-tools.cmake)
include(${ZEPHYR_BASE}/cmake/kconfig.cmake)
include(${ZEPHYR_BASE}/cmake/toolchain.cmake)
set(SOC_NAME ${CONFIG_SOC})
set(SOC_SERIES ${CONFIG_SOC_SERIES})
set(SOC_FAMILY ${CONFIG_SOC_FAMILY})
if("${SOC_SERIES}" STREQUAL "")
set(SOC_PATH ${SOC_NAME})
else()
set(SOC_PATH ${SOC_FAMILY}/${SOC_SERIES})
endif()
# DTS should be run directly after kconfig because CONFIG_ variables
# from kconfig and dts should be available at the same time. But
# running DTS involves running the preprocessor, so we put it behind