Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 1 | SUMMARY = "GN is a meta-build system that generates build files for Ninja" |
| 2 | DEPENDS += "ninja-native" |
| 3 | |
| 4 | LICENSE = "BSD-3-Clause" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d" |
| 6 | |
| 7 | SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main" |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame^] | 8 | SRCREV = "bf4e17dc67b2a2007475415e3f9e1d1cf32f6e35" |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 9 | PV = "0+git${SRCPV}" |
| 10 | |
| 11 | S = "${WORKDIR}/git" |
| 12 | B = "${WORKDIR}/build" |
| 13 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 14 | # Map from our _OS strings to the GN's platform values. |
| 15 | def gn_platform(variable, d): |
| 16 | os = d.getVar(variable) |
| 17 | if "linux" in os: |
| 18 | return "linux" |
| 19 | elif "mingw" in os: |
| 20 | return "mingw" |
| 21 | else: |
| 22 | return os |
| 23 | |
| 24 | do_configure[cleandirs] += "${B}" |
| 25 | do_configure() { |
| 26 | python3 ${S}/build/gen.py \ |
| 27 | --platform=${@gn_platform("TARGET_OS", d)} \ |
| 28 | --out-path=${B} \ |
| 29 | --no-static-libstdc++ \ |
| 30 | --no-strip |
| 31 | } |
| 32 | |
| 33 | do_compile() { |
| 34 | ninja -C ${B} --verbose |
| 35 | } |
| 36 | |
| 37 | do_install() { |
| 38 | install -d ${D}${bindir} |
| 39 | install ${B}/gn ${D}${bindir} |
| 40 | } |
| 41 | |
| 42 | BBCLASSEXTEND = "native" |
| 43 | |
| 44 | COMPATIBLE_HOST = "^(?!riscv32).*" |