From 7c61d022aa9bbba3c2f8a2df46eeb19e2772c89a Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 29 Jul 2015 14:57:14 +0300 Subject: classes/cmake: add arch conversion routine cmake expects target architecture strings in the format of uname(2), which do not always match TARGET_ARCH (e.g. powerpc vs ppc). Signed-off-by: Alexander Kanavin Signed-off-by: Ross Burton --- meta/classes/cmake.bbclass | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'meta') diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index c1742461ab..ae3cc025e8 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass @@ -30,12 +30,22 @@ OECMAKE_EXTRA_ROOT_PATH ?= "" OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY" OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH" +# CMake expects target architectures in the format of uname(2), +# which do not always match TARGET_ARCH, so all the necessary +# conversions should happen here. +def map_target_arch_to_uname_arch(target_arch): + if target_arch == "powerpc": + return "ppc" + if target_arch == "powerpc64": + return "ppc64" + return target_arch + cmake_do_generate_toolchain_file() { cat > ${WORKDIR}/toolchain.cmake <