cmake bbclass: fix support for native builds

Message ID 1435670336-17154-1-git-send-email-koen.kooi@linaro.org
State New
Headers show

Commit Message

Koen Kooi June 30, 2015, 1:18 p.m.
For native builds  of recipes (e.g. mariadb-native) cmake *must* look outside of its sysroot to find the compiler, so instruct it to do so.

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
---
 meta/classes/cmake.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index b0a3972..29a78e5 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -27,6 +27,9 @@  OECMAKE_RPATH ?= ""
 OECMAKE_PERLNATIVE_DIR ??= ""
 OECMAKE_EXTRA_ROOT_PATH ?= ""
 
+OECMAKE_PATHS ?= ""
+OECMAKE_PATHS_class-native = "set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH )"
+
 cmake_do_generate_toolchain_file() {
 	cat > ${WORKDIR}/toolchain.cmake <<EOF
 # CMake system name must be something like "Linux".
@@ -67,6 +70,8 @@  list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
 # add for non /usr/lib libdir, e.g. /usr/lib64
 set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir})
 
+${OECMAKE_PATHS}
+
 EOF
 }