summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gn
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-09-29 08:36:47 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-02 11:28:03 +0100
commitf5fdf6ed3f2a7b1b086d2e41b855d03e76e3b4d7 (patch)
tree8d626324613f5b822ef638749adc80e67514126c /meta/recipes-devtools/gn
parent743a9983247e7d0ad1460adb1e984f66c9be25b2 (diff)
downloadpoky-f5fdf6ed3f2a7b1b086d2e41b855d03e76e3b4d7.tar.gz
gn: Add recipe
gn is a commonly used build tool to generate ninja files, used in a lot of recipes e.g. chromium, qtwebengine, perfetto, hafnium etc. these recipes come from different layers e.g. meta-qt6/meta-arm/meta-oe since not all layers depend on meta-oe ( meta-arm does not ), its not a possible option. Given the usecases, putting it in core will benefit the ecosystem and reduce some duplication. This recipe is taken from meta-arm Disable maybe-initialized is a gcc specific option as error Disable format warnings as errors, it adds -Wno-format explictly in its build system (From OE-Core rev: e8dbf41f1f40ae3a5f9641429cad974f716f1f3e) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gn')
-rw-r--r--meta/recipes-devtools/gn/gn_git.bb52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gn/gn_git.bb b/meta/recipes-devtools/gn/gn_git.bb
new file mode 100644
index 0000000000..d8896609b1
--- /dev/null
+++ b/meta/recipes-devtools/gn/gn_git.bb
@@ -0,0 +1,52 @@
1SUMMARY = "GN is a meta-build system that generates build files for Ninja"
2HOMEPAGE = "https://gn.googlesource.com/gn/"
3LICENSE = "BSD-3-Clause"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
5
6DEPENDS += "ninja-native"
7UPSTREAM_CHECK_COMMITS = "1"
8
9SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main"
10SRCREV = "81b24e01531ecf0eff12ec9359a555ec3944ec4e"
11PV = "0+git"
12
13BB_GIT_SHALLOW = ""
14
15B = "${WORKDIR}/build"
16
17# Map from our _OS strings to the GN's platform values.
18def gn_platform(variable, d):
19 os = d.getVar(variable)
20 if "linux" in os:
21 return "linux"
22 elif "mingw" in os:
23 return "mingw"
24 else:
25 return os
26
27do_configure[cleandirs] += "${B}"
28do_configure() {
29 python3 ${S}/build/gen.py \
30 --platform=${@gn_platform("TARGET_OS", d)} \
31 --out-path=${B} \
32 --no-static-libstdc++ \
33 --no-strip
34}
35
36# Catch build progress from ninja
37do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
38
39do_compile() {
40 ninja -C ${B} --verbose
41}
42
43do_install() {
44 install -d ${D}${bindir}
45 install ${B}/gn ${D}${bindir}
46}
47
48BBCLASSEXTEND = "native"
49
50COMPATIBLE_HOST = "^(?!riscv32).*"
51
52CFLAGS:append:toolchain-gcc = " -Wno-error=maybe-uninitialized"