From 440cc18d1b36fc9f4ecc22a3b5475b5b38df0f9c Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 22 Feb 2018 09:25:03 -0600 Subject: [PATCH] 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 --- CMakeLists.txt | 10 ---------- cmake/app/boilerplate.cmake | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18b37b75c15..14c2b1723ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/cmake/app/boilerplate.cmake b/cmake/app/boilerplate.cmake index edf5b45fb15..b711e25fa24 100644 --- a/cmake/app/boilerplate.cmake +++ b/cmake/app/boilerplate.cmake @@ -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