blob: 8d1efb6508b9f2f0d13870ba77d248e085f60390 [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001SUMMARY = "GN is a meta-build system that generates build files for Ninja"
2DEPENDS += "ninja-native"
3
4LICENSE = "BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
6
7SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main"
Patrick Williams7784c422022-11-17 07:29:11 -06008SRCREV = "bf4e17dc67b2a2007475415e3f9e1d1cf32f6e35"
Brad Bishopbec4ebc2022-08-03 09:55:16 -04009PV = "0+git${SRCPV}"
10
11S = "${WORKDIR}/git"
12B = "${WORKDIR}/build"
13
Brad Bishopbec4ebc2022-08-03 09:55:16 -040014# Map from our _OS strings to the GN's platform values.
15def 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
24do_configure[cleandirs] += "${B}"
25do_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
33do_compile() {
34 ninja -C ${B} --verbose
35}
36
37do_install() {
38 install -d ${D}${bindir}
39 install ${B}/gn ${D}${bindir}
40}
41
42BBCLASSEXTEND = "native"
43
44COMPATIBLE_HOST = "^(?!riscv32).*"