From f0472633702012b9cf75213b4e3bb272c21ec09f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 12 Feb 2023 00:31:27 +0000 Subject: gir: Generate GLib-2.0.gir using a --filelist This was an attempt to bypass Windows' cmd.exe command-line length limit (8191 characters according to Microsoft documentation) by ensuring we only need enough space in argv for the list of files (passed to the small script that generates the file-list) *or* all the other options such as --include, but not both at the same time; but it seems that limit is not the root cause of #456. Signed-off-by: Simon McVittie --- gir/meson.build | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/gir/meson.build b/gir/meson.build index 09714cc1..102768e4 100644 --- a/gir/meson.build +++ b/gir/meson.build @@ -232,10 +232,31 @@ if not get_option('gi_cross_use_prebuilt_gi') gir_giscanner_built_files = giscanner_built_files endif +print_argv = ''' +import sys +for x in sys.argv[1:]: + print(x) +''' + +# There are enough files in GLib and GObject to overflow the Windows cmd.exe +# command-line length limit of 8191 characters, so write them into a +# response file and pass that to g-ir-scanner instead +glib_filelist = custom_target( + input: glib_files, + output: 'glib-files.txt', + capture: true, + command: [ + python, + '-c', + print_argv, + '@INPUT@', + ], +) + glib_gir = custom_target('gir-glib', input: glib_files, output: 'GLib-2.0.gir', - depends: [gir_giscanner_pymod, glib_gir_dep], + depends: [gir_giscanner_pymod, glib_gir_dep, glib_filelist], depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, @@ -247,8 +268,8 @@ glib_gir = custom_target('gir-glib', '-D__G_I18N_LIB_H__', '-DGETTEXT_PACKAGE=Dummy', '--cflags-end', - '@INPUT@', - ] + '--filelist' + ] + glib_filelist, ) gir_files += glib_gir -- cgit v1.2.1