Skip to content

Commit 5d4bed5

Browse files
committed
Adding support for 0.18 zephyr sdk
* Changes have been partly taken from here: zephyrproject-rtos/zephyr@15c3776#diff-529decabf18d860968a987c34f75a7102c007194f1ee3a845fd6016b9b7538f7 * This is needed because of change to the folder structure: Old: opt/zephyr-sdk/arm-zephyr-eabi New: opt/zephyr-sdk/gnu/arm-zephyr-eabi opt/zephyr-sdk/llvm/arm-zephyr-eabi This structure has been adapet from the zephyr toolchain install script. Signed-off-by: Sebastian Wezel <[email protected]>
1 parent 4789325 commit 5d4bed5

File tree

8 files changed

+22
-8
lines changed

8 files changed

+22
-8
lines changed

cmake/modules/FindHostTools.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ zephyr_file(APPLICATION_ROOT TOOLCHAIN_ROOT)
9696

9797
# Host-tools don't unconditionally set TOOLCHAIN_HOME anymore,
9898
# but in case Zephyr's SDK toolchain is used, set TOOLCHAIN_HOME
99-
if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr")
99+
if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr-gnu")
100100
set(TOOLCHAIN_HOME ${HOST_TOOLS_HOME})
101101
endif()
102102

cmake/modules/FindZephyr-sdk.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ endif()
5454
# 1) Zephyr specified as toolchain (ZEPHYR_SDK_INSTALL_DIR still used if defined)
5555
# 2) No toolchain specified == Default to Zephyr toolchain
5656
# Until we completely deprecate it
57-
if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
57+
if(("zephyr-gnu" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
5858
(NOT DEFINED ZEPHYR_TOOLCHAIN_VARIANT) OR
5959
(DEFINED ZEPHYR_SDK_INSTALL_DIR) OR
6060
(Zephyr-sdk_FIND_REQUIRED))

cmake/toolchain/zephyr/generic.cmake renamed to cmake/toolchain/zephyr-gnu/generic.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/generic.cmake)
3+
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/generic.cmake)
44

55
set(TOOLCHAIN_KCONFIG_DIR ${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr)
66

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/target.cmake)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/llvm/generic.cmake)
4+
5+
set(TOOLCHAIN_KCONFIG_DIR ${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr)
6+
7+
message(STATUS "Found toolchain: zephyr ${SDK_VERSION} (${ZEPHYR_SDK_INSTALL_DIR})")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/llvm/target.cmake)

cmake/toolchain/zephyr/target.cmake

Lines changed: 0 additions & 3 deletions
This file was deleted.

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,14 @@ if (CONFIG_BUILD_WITH_TFM)
202202
# Get the toolchain variant
203203
# TODO: Add support for cross-compile toolchain variant
204204
# TODO: Enforce GCC version check against TF-M compiler requirements
205-
if(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "zephyr")
205+
if(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "zephyr-gnu")
206206
set(TFM_TOOLCHAIN_FILE "toolchain_GNUARM.cmake")
207207
set(TFM_TOOLCHAIN_PREFIX "arm-zephyr-eabi")
208-
set(TFM_TOOLCHAIN_PATH ${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi/bin)
208+
set(TFM_TOOLCHAIN_PATH ${ZEPHYR_SDK_INSTALL_DIR}/gnu/arm-zephyr-eabi/bin)
209+
elseif(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "zephyr-llvm")
210+
set(TFM_TOOLCHAIN_FILE "toolchain_GNUARM.cmake")
211+
set(TFM_TOOLCHAIN_PREFIX "arm-zephyr-eabi")
212+
set(TFM_TOOLCHAIN_PATH ${ZEPHYR_SDK_INSTALL_DIR}/llvm/bin)
209213
elseif(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "gnuarmemb")
210214
set(TFM_TOOLCHAIN_FILE "toolchain_GNUARM.cmake")
211215
set(TFM_TOOLCHAIN_PREFIX "arm-none-eabi")

0 commit comments

Comments
 (0)