cmake: SPARC workaround for SDK toolchain 0.11

Zephyr SDK version 0.11.3, 0.11.4 and 0.12.0-beta-1 does not have
the required SPARC target support.

Zephyr CI is currently using SDK 0.11.3, which causes the following
build error:

CMake Error at /workdir/zephyr/cmake/compiler/gcc/target.cmake:10
(message):
  C compiler /opt/sdk/zephyr-sdk-0.11.3//bin/-gcc not found - Please
  check your toolchain installation

This patch adds a workaround such that the SDK target.cmake is picked
up from the directory 0.11 when ARCH=sparc.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
This commit is contained in:
Martin Åberg 2020-11-04 11:57:17 +01:00 committed by Andrew Boie
parent f8d1a9e5ea
commit 97f6dfdd72

View file

@ -4,6 +4,9 @@ if(${SDK_VERSION} VERSION_LESS_EQUAL 0.11.2)
# For backward compatibility with 0.11.1 and 0.11.2 # For backward compatibility with 0.11.1 and 0.11.2
# we need to source files from Zephyr repo # we need to source files from Zephyr repo
include(${CMAKE_CURRENT_LIST_DIR}/${SDK_MAJOR_MINOR}/target.cmake) include(${CMAKE_CURRENT_LIST_DIR}/${SDK_MAJOR_MINOR}/target.cmake)
elseif("${ARCH}" STREQUAL "sparc")
# SDK 0.11.3, 0.11.4 and 0.12.0-beta-1 does not have SPARC target support.
include(${CMAKE_CURRENT_LIST_DIR}/${SDK_MAJOR_MINOR}/target.cmake)
else() else()
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/target.cmake) include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/target.cmake)