Browse Source

cmake: Fix uses of old SOC path

In quite a few places in the cmake files
${SOC_DIR}/${ARCH}/${SOC_PATH}
was used to get to something in the soc folder,
but these are only defined for soc_v1.
socv2 defines a full SOC_V2_DIR.
Let's define a common variable for the full path which
can be used in other cmake files,
and correct the current uses.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
pull/69687/head
Alberto Escolar Piedras 1 year ago committed by Carles Cufi
parent
commit
95e06e8663
  1. 2
      CMakeLists.txt
  2. 2
      arch/xtensa/core/CMakeLists.txt
  3. 4
      cmake/compiler/gcc/target_arc.cmake
  4. 2
      cmake/modules/FindDeprecated.cmake
  5. 2
      cmake/modules/soc_v1.cmake
  6. 1
      cmake/modules/soc_v2.cmake

2
CMakeLists.txt

@ -118,7 +118,7 @@ zephyr_include_directories( @@ -118,7 +118,7 @@ zephyr_include_directories(
include(${ZEPHYR_BASE}/cmake/linker_script/${ARCH}/linker.cmake OPTIONAL)
zephyr_include_directories(${SOC_DIR}/${ARCH}/${SOC_PATH})
zephyr_include_directories(${SOC_FULL_DIR})
# Don't inherit compiler flags from the environment
foreach(var AFLAGS CFLAGS CXXFLAGS CPPFLAGS LDFLAGS)

2
arch/xtensa/core/CMakeLists.txt

@ -53,7 +53,7 @@ file(WRITE ${CORE_ISA_IN} "#include <xtensa/config/core-isa.h>\n") @@ -53,7 +53,7 @@ file(WRITE ${CORE_ISA_IN} "#include <xtensa/config/core-isa.h>\n")
add_custom_command(OUTPUT ${CORE_ISA_DM}
COMMAND ${CMAKE_C_COMPILER} -E -dM -U__XCC__
-I${ZEPHYR_XTENSA_MODULE_DIR}/zephyr/soc/${CONFIG_SOC}
-I${SOC_DIR}/${ARCH}/${SOC_PATH}
-I${SOC_FULL_DIR}
${CORE_ISA_IN} -o ${CORE_ISA_DM})
# Generates a list of device-specific scratch register choices

4
cmake/compiler/gcc/target_arc.cmake

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
if(EXISTS ${SOC_DIR}/${ARCH}/${SOC_PATH}/tune_build_ops.cmake)
include(${SOC_DIR}/${ARCH}/${SOC_PATH}/tune_build_ops.cmake)
if(EXISTS ${SOC_FULL_DIR}/tune_build_ops.cmake)
include(${SOC_FULL_DIR}/tune_build_ops.cmake)
endif()
if(NOT DEFINED GCC_ARC_TUNED_CPU)

2
cmake/modules/FindDeprecated.cmake

@ -112,7 +112,7 @@ if("SEARCHED_LINKER_SCRIPT" IN_LIST Deprecated_FIND_COMPONENTS) @@ -112,7 +112,7 @@ if("SEARCHED_LINKER_SCRIPT" IN_LIST Deprecated_FIND_COMPONENTS)
set(LINKER_SCRIPT ${BOARD_DIR}/linker.ld)
if(NOT EXISTS ${LINKER_SCRIPT})
# If not available, try an SoC specific linker file
set(LINKER_SCRIPT ${SOC_DIR}/${ARCH}/${SOC_PATH}/linker.ld)
set(LINKER_SCRIPT ${SOC_FULL_DIR}/linker.ld)
endif()
message(DEPRECATION
"Pre-defined `linker.ld` script is deprecated. Please set "

2
cmake/modules/soc_v1.cmake

@ -73,4 +73,6 @@ if(HWMv1) @@ -73,4 +73,6 @@ if(HWMv1)
"${SOC_ROOT}\n"
)
endif()
set(SOC_FULL_DIR ${SOC_DIR}/${ARCH}/${SOC_PATH})
endif()

1
cmake/modules/soc_v2.cmake

@ -27,4 +27,5 @@ if(HWMv2) @@ -27,4 +27,5 @@ if(HWMv2)
set(SOC_TOOLCHAIN_NAME ${CONFIG_SOC_TOOLCHAIN_NAME})
set(SOC_FAMILY ${CONFIG_SOC_FAMILY})
set(SOC_V2_DIR ${SOC_${SOC_NAME}_DIR})
set(SOC_FULL_DIR ${SOC_V2_DIR})
endif()

Loading…
Cancel
Save