diff options
| author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2017-03-11 05:58:54 +0100 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-03-16 23:32:40 +0100 |
| commit | 7fb45590ff7d10b4a32a6f702b79ab855fd62948 (patch) | |
| tree | 20dc2cef278887c8d7dedee602c87139980c5d78 | |
| parent | 08164e4c9d8347b06b170b73228aacbc701314ce (diff) | |
| download | meta-openembedded-7fb45590ff7d10b4a32a6f702b79ab855fd62948.tar.gz | |
meson.bbclass: Support building for native
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
| -rw-r--r-- | meta-oe/classes/meson.bbclass | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/meta-oe/classes/meson.bbclass b/meta-oe/classes/meson.bbclass index 8da06da7f9..e3489dd12b 100644 --- a/meta-oe/classes/meson.bbclass +++ b/meta-oe/classes/meson.bbclass | |||
| @@ -9,9 +9,11 @@ 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 the *native* tools not the cross, | 12 | # These variables in the environment override the *native* tools, not the cross. |
| 13 | # so they need to be unexported. | 13 | export CC = "${BUILD_CC}" |
| 14 | CC[unexport] = "1" | 14 | export CXX = "${BUILD_CXX}" |
| 15 | export LD = "${BUILD_LD}" | ||
| 16 | export AR = "${BUILD_AR}" | ||
| 15 | 17 | ||
| 16 | def noprefix(var, d): | 18 | def noprefix(var, d): |
| 17 | return d.getVar(var, True).replace(d.getVar('prefix', True) + '/', '', 1) | 19 | return d.getVar(var, True).replace(d.getVar('prefix', True) + '/', '', 1) |
| @@ -37,6 +39,9 @@ MESON_TARGET_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'big', | |||
| 37 | 39 | ||
| 38 | EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}" | 40 | EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}" |
| 39 | 41 | ||
| 42 | MESON_CROSS_FILE = "" | ||
| 43 | MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross" | ||
| 44 | |||
| 40 | def meson_array(var, d): | 45 | def meson_array(var, d): |
| 41 | return "', '".join(d.getVar(var, True).split()).join(("'", "'")) | 46 | return "', '".join(d.getVar(var, True).split()).join(("'", "'")) |
| 42 | 47 | ||
| @@ -75,7 +80,7 @@ EOF | |||
| 75 | CONFIGURE_FILES = "meson.build" | 80 | CONFIGURE_FILES = "meson.build" |
| 76 | 81 | ||
| 77 | meson_do_configure() { | 82 | meson_do_configure() { |
| 78 | if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" --cross-file ${WORKDIR}/meson.cross ${EXTRA_OEMESON}; then | 83 | if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then |
| 79 | cat ${B}/meson-logs/meson-log.txt | 84 | cat ${B}/meson-logs/meson-log.txt |
| 80 | bbfatal_log meson failed | 85 | bbfatal_log meson failed |
| 81 | fi | 86 | fi |
