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" |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 9 | SRCREV = "4bd1a77e67958fb7f6739bd4542641646f264e5d" |
Andrew Geissler | 80d4184 | 2023-09-11 08:36:15 -0400 | [diff] [blame] | 10 | PV = "0+git${SRCPV}" |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 11 | |
| 12 | S = "${WORKDIR}/git" |
| 13 | B = "${WORKDIR}/build" |
| 14 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 15 | # Work around this fatal warning: |
| 16 | # ../git/src/gn/desc_builder.cc: In member function 'base::Value {anonymous}::BaseDescBuilder::ToBaseValue(const Scope*)': |
| 17 | # ../git/src/gn/desc_builder.cc:179:21: error: redundant move in return statement [-Werror=redundant-move] |
| 18 | # 179 | return std::move(res); |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 19 | CXXFLAGS += "-Wno-error=redundant-move" |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 20 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 21 | # Map from our _OS strings to the GN's platform values. |
| 22 | def gn_platform(variable, d): |
| 23 | os = d.getVar(variable) |
| 24 | if "linux" in os: |
| 25 | return "linux" |
| 26 | elif "mingw" in os: |
| 27 | return "mingw" |
| 28 | else: |
| 29 | return os |
| 30 | |
| 31 | do_configure[cleandirs] += "${B}" |
| 32 | do_configure() { |
| 33 | python3 ${S}/build/gen.py \ |
| 34 | --platform=${@gn_platform("TARGET_OS", d)} \ |
| 35 | --out-path=${B} \ |
| 36 | --no-static-libstdc++ \ |
| 37 | --no-strip |
| 38 | } |
| 39 | |
| 40 | do_compile() { |
| 41 | ninja -C ${B} --verbose |
| 42 | } |
| 43 | |
| 44 | do_install() { |
| 45 | install -d ${D}${bindir} |
| 46 | install ${B}/gn ${D}${bindir} |
| 47 | } |
| 48 | |
| 49 | BBCLASSEXTEND = "native" |
| 50 | |
| 51 | COMPATIBLE_HOST = "^(?!riscv32).*" |