Skip to content
Snippets Groups Projects
Commit fa7a7eb9 authored by Stefan Schmidt's avatar Stefan Schmidt
Browse files

gn: add gn recipe from meta-arm to offer gn-native

With OpenHarmony and Matter we have two projects using GN as their build
system. To support the gn.bbclass we have in Oniro we need a gn-native
recipe as well to support building these projects.

While progress is being made to upstream gn-native to meta-oe we keep a
copy here to have a working build. The alternative would be to add two
extra layers to our build for just one recipe.

This file need to be removed once upstreamed into meta-oe.

The original source of this file is here:
https://git.yoctoproject.org/meta-arm/tree/meta-arm/recipes-devtools/gn/gn_git.bb



Signed-off-by: default avatarStefan Schmidt <stefan.schmidt@huawei.com>
parent 09291225
No related branches found
No related tags found
1 merge request!30flavours/zephyr/local.conf.sample: Bump CONF_VERSION
SUMMARY = "GN is a meta-build system that generates build files for Ninja"
DEPENDS += "ninja-native"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main"
SRCREV = "69ec4fca1fa69ddadae13f9e6b7507efa0675263"
PV = "0+git${SRCPV}"
S = "${WORKDIR}/git"
B = "${WORKDIR}/build"
# Currently fails to build with clang, eg:
# https://errors.yoctoproject.org/Errors/Details/610602/
# https://errors.yoctoproject.org/Errors/Details/610486/
TOOLCHAIN = "gcc"
# Map from our _OS strings to the GN's platform values.
def gn_platform(variable, d):
os = d.getVar(variable)
if "linux" in os:
return "linux"
elif "mingw" in os:
return "mingw"
else:
return os
do_configure[cleandirs] += "${B}"
do_configure() {
python3 ${S}/build/gen.py \
--platform=${@gn_platform("TARGET_OS", d)} \
--out-path=${B} \
--no-static-libstdc++ \
--no-strip
}
do_compile() {
ninja -C ${B} --verbose
}
do_install() {
install -d ${D}${bindir}
install ${B}/gn ${D}${bindir}
}
BBCLASSEXTEND = "native"
COMPATIBLE_HOST = "^(?!riscv32).*"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment