From: Alexander Kanavin <alexander.kanavin@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 03/22] Add arch conversion routine to cmake.bbclass
Date: Wed, 17 Jun 2015 16:19:13 +0300 [thread overview]
Message-ID: <1434547172-24620-4-git-send-email-alexander.kanavin@linux.intel.com> (raw)
In-Reply-To: <1434547172-24620-1-git-send-email-alexander.kanavin@linux.intel.com>
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 <alexander.kanavin@linux.intel.com>
---
meta/classes/cmake.bbclass | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 1ebb936..40115a0 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -27,12 +27,22 @@ OECMAKE_RPATH ?= ""
OECMAKE_PERLNATIVE_DIR ??= ""
OECMAKE_EXTRA_ROOT_PATH ?= ""
+# 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 <<EOF
# CMake system name must be something like "Linux".
# This is important for cross-compiling.
set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` )
-set( CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCH} )
+set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH', True))} )
set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )
set( CMAKE_ASM_COMPILER ${OECMAKE_C_COMPILER} )
--
2.1.4
next prev parent reply other threads:[~2015-06-17 13:19 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-17 13:19 [PATCH 00/22] Update webkitgtk to latest stable upstream; replace midori with epiphany Alexander Kanavin
2015-06-17 13:19 ` [PATCH 01/22] Change tarball compression to xz for gnome recipes Alexander Kanavin
2015-06-17 13:19 ` [PATCH 02/22] Enable icu feature in harfbuzz recipe Alexander Kanavin
2015-06-17 13:19 ` Alexander Kanavin [this message]
2015-06-17 13:19 ` [PATCH 04/22] Update jpeg recipe to version 9a Alexander Kanavin
2015-06-17 13:19 ` [PATCH 05/22] Update libnotify to version 0.7.6 Alexander Kanavin
2015-06-17 14:59 ` Jussi Kukkonen
2015-06-18 11:23 ` Alexander Kanavin
2015-06-18 12:35 ` Andreas Müller
2015-06-18 13:02 ` Martin Jansa
2015-06-18 13:16 ` Alexander Kanavin
2015-06-18 14:42 ` Andreas Müller
2015-06-19 21:41 ` Andreas Müller
2015-06-22 12:34 ` Alexander Kanavin
[not found] ` <CALbNGRS5T12OGFK-C9B4DSyWsz-nRe8zsm=8_xnv4xtqhBHUXg@mail.gmail.com>
2015-06-17 15:01 ` Andreas Müller
2015-06-17 13:19 ` [PATCH 06/22] Add a recipe for giflib Alexander Kanavin
2015-06-17 13:19 ` [PATCH 07/22] Add a recipe for libyaml Alexander Kanavin
2015-06-17 13:19 ` [PATCH 08/22] Add a recipe for ruby Alexander Kanavin
2015-06-17 13:19 ` [PATCH 09/22] Add a recipe for libsecret Alexander Kanavin
2015-06-17 15:05 ` Andreas Müller
2015-06-17 18:54 ` akuster808
2015-06-18 11:54 ` Alexander Kanavin
2015-06-18 11:31 ` Alexander Kanavin
2015-06-17 13:19 ` [PATCH 10/22] Add a recipe for libwebp Alexander Kanavin
2015-06-17 13:19 ` [PATCH 11/22] Add a recipe for webkitgtk 2.8.3 Alexander Kanavin
2015-06-17 13:19 ` [PATCH 12/22] Add a recipe for p11-kit Alexander Kanavin
2015-06-17 13:19 ` [PATCH 13/22] Add a recipe for gcr Alexander Kanavin
2015-06-17 13:19 ` [PATCH 14/22] Add a recipe for iso-codes Alexander Kanavin
2015-06-17 13:19 ` [PATCH 15/22] Add a recipe for libwnck3 Alexander Kanavin
2015-06-17 13:19 ` [PATCH 16/22] Add a recipe for gnome-desktop3 Alexander Kanavin
2015-06-17 13:19 ` [PATCH 17/22] Add a warning suppression patch to glib Alexander Kanavin
2015-06-17 13:19 ` [PATCH 18/22] Add a recipe gsettings-desktop-schemas Alexander Kanavin
2015-06-17 13:19 ` [PATCH 19/22] Add a recipe for epiphany Alexander Kanavin
2015-06-17 13:19 ` [PATCH 20/22] Remove the recipe for the obsolete webkit-gtk 1.8.3 Alexander Kanavin
2015-06-17 13:19 ` [PATCH 21/22] Remove the midori recipe and replace references to midori with epiphany Alexander Kanavin
2015-06-17 13:19 ` [PATCH 22/22] poky: update distro files related to webkitgtk update and epiphany addition Alexander Kanavin
2015-06-17 16:01 ` [PATCH 00/22] Update webkitgtk to latest stable upstream; replace midori with epiphany Paul Eggleton
2015-06-18 11:46 ` Alexander Kanavin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1434547172-24620-4-git-send-email-alexander.kanavin@linux.intel.com \
--to=alexander.kanavin@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox