gi-decompile-typelib: Interpret --includedir as most-important-first

This is a behaviour change from g-ir-generate, which treats it as
least-important-first (the last directory on the command-line is
searched first).

gi-compile-repository --includedir and gcc -I are most-important-first
(the first directory on the command-line is searched first) so it seems
like it makes most sense to be consistent with that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2024-02-14 11:25:46 +00:00
parent f80e978f00
commit 64762fdef6
2 changed files with 14 additions and 3 deletions

View File

@@ -87,8 +87,13 @@ main (int argc, char *argv[])
repository = gi_repository_new ();
if (includedirs != NULL)
for (i = 0; includedirs[i]; i++)
gi_repository_prepend_search_path (repository, includedirs[i]);
{
guint n = g_strv_length (includedirs);
guint j;
for (j = 1; j <= n; j++)
gi_repository_prepend_search_path (repository, includedirs[n - j]);
}
for (i = 0; input[i]; i++)
{