Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | include meson.inc |
| 2 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 3 | inherit meson-routines |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 4 | inherit nativesdk |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 5 | |
| 6 | SRC_URI += "file://meson-setup.py \ |
| 7 | file://meson-wrapper" |
| 8 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 9 | # The cross file logic is similar but not identical to that in meson.bbclass, |
| 10 | # since it's generating for an SDK rather than a cross-compile. Important |
| 11 | # differences are: |
| 12 | # - We can't set vars like CC, CXX, etc. yet because they will be filled in with |
| 13 | # real paths by meson-setup.sh when the SDK is extracted. |
| 14 | # - Some overrides aren't needed, since the SDK injects paths that take care of |
| 15 | # them. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 16 | do_install:append() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 17 | install -d ${D}${datadir}/meson |
| 18 | cat >${D}${datadir}/meson/meson.cross.template <<EOF |
| 19 | [binaries] |
| 20 | c = @CC |
| 21 | cpp = @CXX |
| 22 | ar = @AR |
| 23 | nm = @NM |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 24 | strip = @STRIP |
| 25 | pkgconfig = 'pkg-config' |
| 26 | |
| 27 | [properties] |
| 28 | needs_exe_wrapper = true |
| 29 | c_args = @CFLAGS |
| 30 | c_link_args = @LDFLAGS |
| 31 | cpp_args = @CPPFLAGS |
| 32 | cpp_link_args = @LDFLAGS |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 33 | sys_root = @OECORE_TARGET_SYSROOT |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 34 | |
| 35 | [host_machine] |
| 36 | system = '${SDK_OS}' |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 37 | cpu_family = '${@meson_cpu_family("SDK_ARCH", d)}' |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | cpu = '${SDK_ARCH}' |
| 39 | endian = '${@meson_endian("SDK", d)}' |
| 40 | EOF |
| 41 | |
| 42 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d |
| 43 | install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ |
| 44 | |
| 45 | # We need to wrap the real meson with a thin env setup wrapper. |
| 46 | mv ${D}${bindir}/meson ${D}${bindir}/meson.real |
| 47 | install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson |
| 48 | } |
| 49 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 50 | RDEPENDS:${PN} += "\ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 51 | nativesdk-ninja \ |
| 52 | nativesdk-python3 \ |
| 53 | nativesdk-python3-setuptools \ |
| 54 | " |
| 55 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 56 | FILES:${PN} += "${datadir}/meson ${SDKPATHNATIVE}" |