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 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 7 | SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main \ |
| 8 | file://0001-Replace-lstat64-stat64-functions-on-linux.patch" |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame^] | 9 | SRCREV = "edf6ef4b06b42c58292faea78498aff76bdf68ed" |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 10 | PV = "0+git${SRCPV}" |
| 11 | |
| 12 | S = "${WORKDIR}/git" |
| 13 | B = "${WORKDIR}/build" |
| 14 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 15 | # Map from our _OS strings to the GN's platform values. |
| 16 | def gn_platform(variable, d): |
| 17 | os = d.getVar(variable) |
| 18 | if "linux" in os: |
| 19 | return "linux" |
| 20 | elif "mingw" in os: |
| 21 | return "mingw" |
| 22 | else: |
| 23 | return os |
| 24 | |
| 25 | do_configure[cleandirs] += "${B}" |
| 26 | do_configure() { |
| 27 | python3 ${S}/build/gen.py \ |
| 28 | --platform=${@gn_platform("TARGET_OS", d)} \ |
| 29 | --out-path=${B} \ |
| 30 | --no-static-libstdc++ \ |
| 31 | --no-strip |
| 32 | } |
| 33 | |
| 34 | do_compile() { |
| 35 | ninja -C ${B} --verbose |
| 36 | } |
| 37 | |
| 38 | do_install() { |
| 39 | install -d ${D}${bindir} |
| 40 | install ${B}/gn ${D}${bindir} |
| 41 | } |
| 42 | |
| 43 | BBCLASSEXTEND = "native" |
| 44 | |
| 45 | COMPATIBLE_HOST = "^(?!riscv32).*" |