diff options
-rw-r--r-- | meta/classes/meson.bbclass | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index 07322cf786..ed08a4058c 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass | |||
@@ -24,7 +24,11 @@ MESONOPTS = " --prefix ${prefix} \ | |||
24 | --infodir ${@noprefix('infodir', d)} \ | 24 | --infodir ${@noprefix('infodir', d)} \ |
25 | --sysconfdir ${sysconfdir} \ | 25 | --sysconfdir ${sysconfdir} \ |
26 | --localstatedir ${localstatedir} \ | 26 | --localstatedir ${localstatedir} \ |
27 | --sharedstatedir ${sharedstatedir}" | 27 | --sharedstatedir ${sharedstatedir} \ |
28 | -Dc_args='${BUILD_CPPFLAGS} ${BUILD_CFLAGS}' \ | ||
29 | -Dc_link_args='${BUILD_LDFLAGS}' \ | ||
30 | -Dcpp_args='${BUILD_CPPFLAGS} ${BUILD_CXXFLAGS}' \ | ||
31 | -Dcpp_link_args='${BUILD_LDFLAGS}'" | ||
28 | 32 | ||
29 | MESON_TOOLCHAIN_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | 33 | MESON_TOOLCHAIN_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
30 | MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}" | 34 | MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}" |
@@ -114,14 +118,15 @@ meson_do_configure() { | |||
114 | override_native_tools() { | 118 | override_native_tools() { |
115 | # Set these so that meson uses the native tools for its build sanity tests, | 119 | # Set these so that meson uses the native tools for its build sanity tests, |
116 | # which require executables to be runnable. The cross file will still | 120 | # which require executables to be runnable. The cross file will still |
117 | # override these for the target build. Note that we do *not* set CFLAGS, | 121 | # override these for the target build. |
118 | # LDFLAGS, etc. as they will be slurped in by meson and applied to the | ||
119 | # target build, causing errors. | ||
120 | export CC="${BUILD_CC}" | 122 | export CC="${BUILD_CC}" |
121 | export CXX="${BUILD_CXX}" | 123 | export CXX="${BUILD_CXX}" |
122 | export LD="${BUILD_LD}" | 124 | export LD="${BUILD_LD}" |
123 | export AR="${BUILD_AR}" | 125 | export AR="${BUILD_AR}" |
124 | 126 | # These contain *target* flags but will be used as *native* flags. The | |
127 | # correct native flags will be passed via -Dc_args and so on, unset them so | ||
128 | # they don't interfere with tools invoked by Meson (such as g-ir-scanner) | ||
129 | unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS | ||
125 | } | 130 | } |
126 | 131 | ||
127 | meson_do_configure_prepend_class-target() { | 132 | meson_do_configure_prepend_class-target() { |