All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Liu <net147@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] cmake.bbclass: set ar/ld/nm/objcopy/objdump/ranlib/strip native paths
Date: Wed, 17 Jul 2013 18:40:22 +1000	[thread overview]
Message-ID: <1374050422-5056-1-git-send-email-net147@gmail.com> (raw)

The CMAKE_{AR,LINKER,NM,OBJCOPY,OBJDUMP,RANLIB,STRIP} cmake variables
are currently set to values like CMAKE_LINKER-NOTFOUND for native
recipes because the host paths are not searched. This is because the
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM cmake variable is set to ONLY.

To resolve this, explicitly set the variables using FIND_PROGRAM and
pass the CMAKE_FIND_ROOT_PATH_BOTH option so the host paths are also
searched.

Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 meta/classes/cmake.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 310242e..31166e0 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -69,6 +69,18 @@ set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir})
 EOF
 }
 
+cmake_do_generate_toolchain_file_append_class-native() {
+	cat >> ${WORKDIR}/toolchain.cmake <<EOF
+FIND_PROGRAM(CMAKE_AR ${AR} CMAKE_FIND_ROOT_PATH_BOTH)
+FIND_PROGRAM(CMAKE_LINKER ${LD} CMAKE_FIND_ROOT_PATH_BOTH)
+FIND_PROGRAM(CMAKE_NM ${NM} CMAKE_FIND_ROOT_PATH_BOTH)
+FIND_PROGRAM(CMAKE_OBJCOPY ${OBJCOPY} CMAKE_FIND_ROOT_PATH_BOTH)
+FIND_PROGRAM(CMAKE_OBJDUMP ${OBJDUMP} CMAKE_FIND_ROOT_PATH_BOTH)
+FIND_PROGRAM(CMAKE_RANLIB ${RANLIB} CMAKE_FIND_ROOT_PATH_BOTH)
+FIND_PROGRAM(CMAKE_STRIP ${STRIP} CMAKE_FIND_ROOT_PATH_BOTH)
+EOF
+}
+
 addtask generate_toolchain_file after do_patch before do_configure
 
 cmake_do_configure() {
-- 
1.8.3.2



             reply	other threads:[~2013-07-17  8:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17  8:40 Jonathan Liu [this message]
2013-07-17  9:13 ` [PATCH] cmake.bbclass: set ar/ld/nm/objcopy/objdump/ranlib/strip native paths Stefan Herbrechtsmeier
2013-07-17  9:49   ` Jonathan Liu
2013-07-17 10:57     ` Jonathan Liu
2013-07-17 12:12       ` Stefan Herbrechtsmeier
2013-07-18  0:47         ` Jonathan Liu
2013-07-18  9:46           ` Stefan Herbrechtsmeier

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=1374050422-5056-1-git-send-email-net147@gmail.com \
    --to=net147@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.