From c23d2f3151eb15160c4d63b189ca7629fd333635 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 17 Jan 2013 11:20:16 +0100 Subject: wixl: add --wxidir option --- tools/wixl/builder.vala | 1 - tools/wixl/wixl.vala | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'tools/wixl') diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala index f269852..9c1c9e8 100644 --- a/tools/wixl/builder.vala +++ b/tools/wixl/builder.vala @@ -6,7 +6,6 @@ namespace Wixl { add_path ("."); foreach (var i in includedirs) this.includedirs.append (File.new_for_path (i)); - this.includedirs.append (File.new_for_path (Config.PKGDATADIR + "include")); } WixRoot root; diff --git a/tools/wixl/wixl.vala b/tools/wixl/wixl.vala index 220d292..1cd2a76 100644 --- a/tools/wixl/wixl.vala +++ b/tools/wixl/wixl.vala @@ -11,14 +11,18 @@ namespace Wixl { [CCode (array_length = false, array_null_terminated = true)] static string[] defines; [CCode (array_length = false, array_null_terminated = true)] + static string[] opt_includedirs; + static string[] includedirs; + static string wxidir; private const OptionEntry[] options = { { "version", 0, 0, OptionArg.NONE, ref version, N_("Display version number"), null }, { "verbose", 'v', 0, OptionArg.NONE, ref verbose, N_("Verbose output"), null }, { "output", 'o', 0, OptionArg.FILENAME, ref output, N_("Output file"), null }, { "define", 'D', 0, OptionArg.STRING_ARRAY, ref defines, N_("Define variable"), null }, - { "includedir", 'I', 0, OptionArg.STRING_ARRAY, ref includedirs, N_("Include directory"), null }, + { "includedir", 'I', 0, OptionArg.STRING_ARRAY, ref opt_includedirs, N_("Include directory"), null }, + { "wxidir", 0, 0, OptionArg.STRING, ref wxidir, N_("System include directory"), null }, { "only-preproc", 'E', 0, OptionArg.NONE, ref preproc, N_("Stop after the preprocessing stage"), null }, { "", 0, 0, OptionArg.FILENAME_ARRAY, ref files, null, N_("INPUT_FILE...") }, { null } @@ -35,6 +39,8 @@ namespace Wixl { opt_context.set_help_enabled (true); opt_context.add_main_entries (options, null); + wxidir = Config.PKGDATADIR + "/include"; + try { opt_context.parse (ref args); } catch (OptionError.BAD_VALUE err) { @@ -44,6 +50,10 @@ namespace Wixl { warning (error.message); } + /* fixme vala, does not support += on arrays without length. */ + includedirs = opt_includedirs; + includedirs += wxidir; + if (version) { GLib.stdout.printf ("%s\n", Config.PACKAGE_VERSION); exit (0); -- cgit