diff options
| -rw-r--r-- | meta/classes/meson.bbclass | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index 5953b5d698..b72e5207ab 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass | |||
| @@ -9,13 +9,6 @@ do_configure[cleandirs] = "${B}" | |||
| 9 | # Where the meson.build build configuration is | 9 | # Where the meson.build build configuration is |
| 10 | MESON_SOURCEPATH = "${S}" | 10 | MESON_SOURCEPATH = "${S}" |
| 11 | 11 | ||
| 12 | # These variables in the environment override meson's *native* tools settings. | ||
| 13 | # We have to unset them, so that meson doesn't pick up the cross tools and | ||
| 14 | # use them for native builds. | ||
| 15 | unset CC | ||
| 16 | unset CXX | ||
| 17 | unset AR | ||
| 18 | |||
| 19 | def noprefix(var, d): | 12 | def noprefix(var, d): |
| 20 | return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1) | 13 | return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1) |
| 21 | 14 | ||
| @@ -92,6 +85,18 @@ meson_do_configure() { | |||
| 92 | fi | 85 | fi |
| 93 | } | 86 | } |
| 94 | 87 | ||
| 88 | meson_do_configure_prepend_class-target() { | ||
| 89 | # Set these so that meson uses the native tools for its build sanity tests, | ||
| 90 | # which require executables to be runnable. The cross file will still | ||
| 91 | # override these for the target build. Note that we do *not* set CFLAGS, | ||
| 92 | # LDFLAGS, etc. as they will be slurped in by meson and applied to the | ||
| 93 | # target build, causing errors. | ||
| 94 | export CC="${BUILD_CC}" | ||
| 95 | export CXX="${BUILD_CXX}" | ||
| 96 | export LD="${BUILD_LD}" | ||
| 97 | export AR="${BUILD_AR}" | ||
| 98 | } | ||
| 99 | |||
| 95 | meson_do_configure_prepend_class-native() { | 100 | meson_do_configure_prepend_class-native() { |
| 96 | export PKG_CONFIG="pkg-config-native" | 101 | export PKG_CONFIG="pkg-config-native" |
| 97 | } | 102 | } |
