Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] cmake.bbclass: set ar/ld/nm/objcopy/objdump/ranlib/strip native paths
@ 2013-07-17  8:40 Jonathan Liu
  2013-07-17  9:13 ` Stefan Herbrechtsmeier
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Liu @ 2013-07-17  8:40 UTC (permalink / raw)
  To: openembedded-core

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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-07-18  9:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-17  8:40 [PATCH] cmake.bbclass: set ar/ld/nm/objcopy/objdump/ranlib/strip native paths Jonathan Liu
2013-07-17  9:13 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox