diff options
author | Martin Kelly <mkelly@xevo.com> | 2018-01-17 11:22:56 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-19 12:37:14 +0000 |
commit | ff5634ad88a1d45a4b52f33afbb1e057fbf45ea9 (patch) | |
tree | ce88cb01acbe16d1c0d515bef27290f4799d2580 | |
parent | b895d1186254b58c2cbd25372a79c83187f6464d (diff) | |
download | poky-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.bbclass | 10 |
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 | ||
29 | MESON_C_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | 29 | MESON_TOOLCHAIN_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
30 | MESON_LINK_ARGS = "${MESON_C_ARGS} ${LDFLAGS}" | 30 | MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}" |
31 | MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}" | ||
32 | MESON_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 |
33 | MESON_HOST_ENDIAN = "bogus-endian" | 35 | MESON_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 | ||
44 | addtask write_config before do_configure | 46 | addtask write_config before do_configure |
45 | do_write_config[vardeps] += "MESON_C_ARGS TOOLCHAIN_OPTIONS" | 47 | do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS TOOLCHAIN_OPTIONS" |
46 | do_write_config() { | 48 | do_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' | |||
59 | needs_exe_wrapper = true | 61 | needs_exe_wrapper = true |
60 | c_args = [${@meson_array('MESON_C_ARGS', d)}] | 62 | c_args = [${@meson_array('MESON_C_ARGS', d)}] |
61 | c_link_args = [${@meson_array('MESON_LINK_ARGS', d)}] | 63 | c_link_args = [${@meson_array('MESON_LINK_ARGS', d)}] |
62 | cpp_args = [${@meson_array('MESON_C_ARGS', d)}] | 64 | cpp_args = [${@meson_array('MESON_CPP_ARGS', d)}] |
63 | cpp_link_args = [${@meson_array('MESON_LINK_ARGS', d)}] | 65 | cpp_link_args = [${@meson_array('MESON_LINK_ARGS', d)}] |
64 | gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' | 66 | gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' |
65 | 67 | ||