blob: 20832016ab9108833c7e66b3f21c34cf47b2ff8d [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
Andrew Geissler517393d2023-01-13 08:55:19 -06007SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main \
8 file://0001-Replace-lstat64-stat64-functions-on-linux.patch"
Andrew Geissler9347dd42023-03-03 12:38:41 -06009SRCREV = "edf6ef4b06b42c58292faea78498aff76bdf68ed"
Brad Bishopbec4ebc2022-08-03 09:55:16 -040010PV = "0+git${SRCPV}"
11
12S = "${WORKDIR}/git"
13B = "${WORKDIR}/build"
14
Brad Bishopbec4ebc2022-08-03 09:55:16 -040015# Map from our _OS strings to the GN's platform values.
16def 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
25do_configure[cleandirs] += "${B}"
26do_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
34do_compile() {
35 ninja -C ${B} --verbose
36}
37
38do_install() {
39 install -d ${D}${bindir}
40 install ${B}/gn ${D}${bindir}
41}
42
43BBCLASSEXTEND = "native"
44
45COMPATIBLE_HOST = "^(?!riscv32).*"