diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc index 5c9d9e5..ba70a29 100644 --- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc +++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc @@ -7,7 +7,7 @@ inherit ${ZEPHYR_INHERIT_CLASSES} # filesystem. IMAGE_NO_MANIFEST = "1" -ZEPHYR_TOOLCHAIN_VARIANT ?= "yocto" +ZEPHYR_TOOLCHAIN_VARIANT ?= "cross-compile" require zephyr-toolchain-${ZEPHYR_TOOLCHAIN_VARIANT}.inc ZEPHYR_MAKE_OUTPUT = "zephyr.elf" diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-toolchain-cross-compile.inc b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-toolchain-cross-compile.inc new file mode 100644 index 0000000..2f1ea37 --- /dev/null +++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-toolchain-cross-compile.inc @@ -0,0 +1,12 @@ +# Additional definitions to use the cross-compile toolchain + +CROSS_COMPILE = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}" +SYSROOT_DIR="${STAGING_DIR_TARGET}" + +EXTRA_OECMAKE:append = " \ + -DCROSS_COMPILE=${CROSS_COMPILE} \ + -DSYSROOT_DIR=${SYSROOT_DIR} \ + " + +OE_TERMINAL_EXPORTS += "CROSS_COMPILE" +OE_TERMINAL_EXPORTS += "SYSROOT_DIR"