commit 11a9a4a

hovercats  ·  2025-02-19 10:30:26 +0000 UTC
parent b5b5f99
muon: generate embedded_files.h on buildtime, as we actually need this file
5 files changed,  +40, -23
+2, -1
1@@ -1 +1,2 @@
2-/local.ninja
3+/local.ninja
4+/tools.ninja
+0, -15
 1@@ -1,15 +0,0 @@
 2-# muon
 3-
 4-
 5-## version.c
 6-Generated with
 7-
 8-	muon setup \
 9-		-Dlibcurl=disabled \
10-		-Dsamurai=disabled \
11-		-Dlibarchive=disabled \
12-		-Dreadline=builtin \
13-		-Dlibpkgconf=disabled \
14-		build
15-
16-Note: to be correct about our configuration, we would enable `libpkgconf` here, but muon will simply error out on not being able to find them, even when pointed to using LDFLAGS and CFLAGS. The configuration however seems to be unaffected by this, so we can safely disable it to generate the above files.
+36, -0
 1@@ -5,11 +5,47 @@ cflags{
 2 	'-D MUON_PLATFORM_posix',
 3 	'-D MUON_ENDIAN=0',
 4 	'-D MUON_STATIC',
 5+	'-D MUON_BOOTSTRAPPED',
 6+	'-I $outdir',
 7 	'-I $srcdir/include',
 8 	'-I $srcdir/subprojects/tinyjson',
 9 	'-isystem $builddir/pkg/libpkgconf',
10 }
11 
12+sub('tools.ninja', function()
13+	toolchain(config.host)
14+	cflags{'-I $srcdir/include'}
15+	exe('embedder', {'tools/embedder.c'})
16+end)
17+
18+rule('embedder', '$outdir/embedder $args  >$out')
19+
20+local embedded_files = {
21+	'commands/copyfile.meson',
22+	'commands/coverage.meson',
23+	'commands/delete_suffix.meson',
24+	'commands/i18n/gettext.meson',
25+	'commands/i18n/itstool.meson',
26+	'commands/i18n/msgfmthelper.meson',
27+	'commands/vcs_tagger.meson',
28+	'lib/cmake_prelude.meson',
29+	'modules/_test.meson',
30+	'modules/gnome.meson',
31+	'modules/i18n.meson',
32+	'options/global.meson',
33+	'options/per_project.meson',
34+	'python/python_info.py',
35+	'runtime/dependencies.meson',
36+}
37+
38+local args = {}
39+for _, file in ipairs(embedded_files) do
40+	table.insert(args, '$srcdir/src/script/'..file)
41+	table.insert(args, file)
42+end
43+
44+build('embedder', '$outdir/embedded_files.h', {expand{'$srcdir/src/script', embedded_files}, '|', '$outdir/embedder'}, {args=args})
45+
46 build('copy', '$outdir/version.c', '$dir/version.c')
47 
48 pkg.deps = {'pkg/libpkgconf/headers'}
+1, -1
1@@ -1 +1 @@
2-0.4.0 r1
3+0.4.0 r2
+1, -6
 1@@ -1,14 +1,9 @@
 2-/*
 3- * SPDX-FileCopyrightText: Stone Tickle <lattis@mochiro.moe>
 4- * SPDX-License-Identifier: GPL-3.0-only
 5- */
 6-
 7 #include "compat.h"
 8 
 9 #include "version.h"
10 
11 const struct muon_version muon_version = {
12 	.version = "0.4.0",
13-	.vcs_tag = "",
14+	.vcs_tag = "4344eb5d",
15 	.meson_compat = "1.5.99",
16 };