summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kelly <mkelly@xevo.com>2018-01-17 11:22:56 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-19 12:37:14 +0000
commitff5634ad88a1d45a4b52f33afbb1e057fbf45ea9 (patch)
treece88cb01acbe16d1c0d515bef27290f4799d2580
parentb895d1186254b58c2cbd25372a79c83187f6464d (diff)
downloadpoky-ff5634ad88a1d45a4b52f33afbb1e057fbf45ea9.tar.gz
meson.bbclass: include C{, XX}FLAGS in cross args
Currently, CFLAGS and CXXFLAGS are not making it into the compile line. This is because meson appends CFLAGS/CXXFLAGS from the environment only for native but not for cross builds (probably to keep cross-builds more isolated). As a result, we need to make sure these vars goes into meson.cross. This is similar to what cmake.bbclass does with OECMAKE_C_FLAGS and OECMAKE_CXX_FLAGS. Change c_args and cpp_args in meson.cross to include these vars, and update write_config[vardeps] accordingly. (From OE-Core rev: f435d1b75d3775f6ec0df6027766008b40209fd7) Signed-off-by: Martin Kelly <mkelly@xevo.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.bbclass10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index f9cee00c07..4ab242dcfd 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -26,8 +26,10 @@ MESONOPTS = " --prefix ${prefix} \
26 --localstatedir ${localstatedir} \ 26 --localstatedir ${localstatedir} \
27 --sharedstatedir ${sharedstatedir}" 27 --sharedstatedir ${sharedstatedir}"
28 28
29MESON_C_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 29MESON_TOOLCHAIN_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
30MESON_LINK_ARGS = "${MESON_C_ARGS} ${LDFLAGS}" 30MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}"
31MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}"
32MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}"
31 33
32# both are required but not used by meson 34# both are required but not used by meson
33MESON_HOST_ENDIAN = "bogus-endian" 35MESON_HOST_ENDIAN = "bogus-endian"
@@ -42,7 +44,7 @@ def meson_array(var, d):
42 return "', '".join(d.getVar(var).split()).join(("'", "'")) 44 return "', '".join(d.getVar(var).split()).join(("'", "'"))
43 45
44addtask write_config before do_configure 46addtask write_config before do_configure
45do_write_config[vardeps] += "MESON_C_ARGS TOOLCHAIN_OPTIONS" 47do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS TOOLCHAIN_OPTIONS"
46do_write_config() { 48do_write_config() {
47 # This needs to be Py to split the args into single-element lists 49 # This needs to be Py to split the args into single-element lists
48 cat >${WORKDIR}/meson.cross <<EOF 50 cat >${WORKDIR}/meson.cross <<EOF
@@ -59,7 +61,7 @@ pkgconfig = 'pkg-config'
59needs_exe_wrapper = true 61needs_exe_wrapper = true
60c_args = [${@meson_array('MESON_C_ARGS', d)}] 62c_args = [${@meson_array('MESON_C_ARGS', d)}]
61c_link_args = [${@meson_array('MESON_LINK_ARGS', d)}] 63c_link_args = [${@meson_array('MESON_LINK_ARGS', d)}]
62cpp_args = [${@meson_array('MESON_C_ARGS', d)}] 64cpp_args = [${@meson_array('MESON_CPP_ARGS', d)}]
63cpp_link_args = [${@meson_array('MESON_LINK_ARGS', d)}] 65cpp_link_args = [${@meson_array('MESON_LINK_ARGS', d)}]
64gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' 66gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
65 67