summaryrefslogtreecommitdiffstats
path: root/meta/classes/meson.bbclass
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:18:04 +0000
commitf435d1b75d3775f6ec0df6027766008b40209fd7 (patch)
tree8a50bc74bae6ce9db6800aa6f367f7907b053ac7 /meta/classes/meson.bbclass
parent73ff85986d82c8da601d7c7cf9a02961f2f66a09 (diff)
downloadopenembedded-core-contrib-f435d1b75d3775f6ec0df6027766008b40209fd7.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. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/meson.bbclass')
-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 f9cee00c078..4ab242dcfdf 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -26,8 +26,10 @@ MESONOPTS = " --prefix ${prefix} \
--localstatedir ${localstatedir} \
--sharedstatedir ${sharedstatedir}"
-MESON_C_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
-MESON_LINK_ARGS = "${MESON_C_ARGS} ${LDFLAGS}"
+MESON_TOOLCHAIN_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}"
+MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}"
+MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}"
# both are required but not used by meson
MESON_HOST_ENDIAN = "bogus-endian"
@@ -42,7 +44,7 @@ def meson_array(var, d):
return "', '".join(d.getVar(var).split()).join(("'", "'"))
addtask write_config before do_configure
-do_write_config[vardeps] += "MESON_C_ARGS TOOLCHAIN_OPTIONS"
+do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS TOOLCHAIN_OPTIONS"
do_write_config() {
# This needs to be Py to split the args into single-element lists
cat >${WORKDIR}/meson.cross <<EOF
@@ -59,7 +61,7 @@ pkgconfig = 'pkg-config'
needs_exe_wrapper = true
c_args = [${@meson_array('MESON_C_ARGS', d)}]
c_link_args = [${@meson_array('MESON_LINK_ARGS', d)}]
-cpp_args = [${@meson_array('MESON_C_ARGS', d)}]
+cpp_args = [${@meson_array('MESON_CPP_ARGS', d)}]
cpp_link_args = [${@meson_array('MESON_LINK_ARGS', d)}]
gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'