diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2018-02-20 14:16:34 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-02-24 10:31:47 +0000 |
commit | eaa93567449293c482e0175158c5abef1dddcbdf (patch) | |
tree | 77a95d9ce7afb0ede5cdb302d6127bb9c93cffd7 | |
parent | b487251b868dcd8eb541246a49e9708a688cec36 (diff) | |
download | poky-eaa93567449293c482e0175158c5abef1dddcbdf.tar.gz |
meson.bbclass: Add support for nativesdk
We need to use the meson.cross file when building for nativesdk.
Additionally, we need to trick meson's sanity tests, just as it is
done for target builds.
(From OE-Core rev: abcb330c462c2c06d36f8f3681a6bd07d562c1fe)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/meson.bbclass | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index cd3497a802..31d32a56f6 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass | |||
@@ -39,6 +39,7 @@ EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}" | |||
39 | 39 | ||
40 | MESON_CROSS_FILE = "" | 40 | MESON_CROSS_FILE = "" |
41 | MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross" | 41 | MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross" |
42 | MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross" | ||
42 | 43 | ||
43 | CCOMPILER ?= "gcc" | 44 | CCOMPILER ?= "gcc" |
44 | CXXCOMPILER ?= "g++" | 45 | CXXCOMPILER ?= "g++" |
@@ -105,6 +106,18 @@ meson_do_configure_prepend_class-target() { | |||
105 | export AR="${BUILD_AR}" | 106 | export AR="${BUILD_AR}" |
106 | } | 107 | } |
107 | 108 | ||
109 | meson_do_configure_prepend_class-nativesdk() { | ||
110 | # Set these so that meson uses the native tools for its build sanity tests, | ||
111 | # which require executables to be runnable. The cross file will still | ||
112 | # override these for the nativesdk build. Note that we do *not* set CFLAGS, | ||
113 | # LDFLAGS, etc. as they will be slurped in by meson and applied to the | ||
114 | # nativesdk build, causing errors. | ||
115 | export CC="${BUILD_CC}" | ||
116 | export CXX="${BUILD_CXX}" | ||
117 | export LD="${BUILD_LD}" | ||
118 | export AR="${BUILD_AR}" | ||
119 | } | ||
120 | |||
108 | meson_do_configure_prepend_class-native() { | 121 | meson_do_configure_prepend_class-native() { |
109 | export PKG_CONFIG="pkg-config-native" | 122 | export PKG_CONFIG="pkg-config-native" |
110 | } | 123 | } |