]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
base.bbclass: Deferred inherit native toolchain class master
authorKhem Raj <raj.khem@gmail.com>
Fri, 4 Jul 2025 03:13:49 +0000 (20:13 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 4 Jul 2025 13:56:38 +0000 (14:56 +0100)
use TOOLCHAIN_NATIVE variable for selecting native compiler

Default it to PREFERRED_TOOLCHAIN_NATIVE, a recipe which wants
to enforce a toolchain can do so with

for cross toolchains ( e.g. target, nativesdk )

TOOLCHAIN = "gcc"

For native

TOOLCHAIN_NATIVE = "gcc"

This helps build native recipe with clang as native compiler.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/base.bbclass

index ac145d9fd640f6f9fbadabed6a6c528f10db6ed5..6be1f5c2df204e13700de360ecb14c552c50121c 100644 (file)
@@ -30,8 +30,9 @@ PREFERRED_TOOLCHAIN:class-crosssdk = "${PREFERRED_TOOLCHAIN_SDK}"
 PREFERRED_TOOLCHAIN:class-nativesdk = "${PREFERRED_TOOLCHAIN_SDK}"
 
 TOOLCHAIN ??= "${PREFERRED_TOOLCHAIN}"
+TOOLCHAIN_NATIVE ??= "${PREFERRED_TOOLCHAIN_NATIVE}"
 
-inherit toolchain/gcc-native
+inherit_defer toolchain/${TOOLCHAIN_NATIVE}-native
 inherit_defer toolchain/${TOOLCHAIN}
 
 def lsb_distro_identifier(d):