Skip to content

Commit c23d2f3

Browse files
committed
wixl: add --wxidir option
1 parent 482ea41 commit c23d2f3

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ wixl_CPPFLAGS = \
9090
$(WIXL_CFLAGS) \
9191
-DG_LOG_DOMAIN=\""wixl"\" \
9292
-DLOCALEDIR=\""$(localedir)"\" \
93-
-DPKGDATADIR=\""$(datadir)/wixl-0.1/"\" \
93+
-DPKGDATADIR=\""$(datadir)/wixl-$(VERSION)/"\" \
9494
-DPKGLIBDIR=\""$(pkglibdir)"\" \
9595
$(NULL)
9696

atlocal.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ _msibuild() {
2424
}
2525

2626
_wixl() {
27-
wixl$EXEEXT "$@"
27+
wixl$EXEEXT --wxidir "$abs_top_srcdir/data/wixl" "$@"
2828
}
2929
_wixl_heat() {
3030
wixl-heat$EXEEXT "$@"

tests/wixl.at

+11
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@ AT_CHECK_WIXL([-D Foo -o out.msi IncludeTest.wxs], [0], [ignore],
9999
AT_CHECK([test -f out.msi], [0])
100100
AT_CLEANUP
101101

102+
AT_SETUP([System include directory])
103+
AT_DATA([include.wxs], [<?xml version='1.0' encoding='windows-1252'?>
104+
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
105+
<?include gtk2.wxi ?>
106+
</Wix>
107+
])
108+
109+
AT_CHECK_WIXL([-E include.wxs -D SourceDir=foo], [0], [stdout])
110+
AT_CHECK([grep -F gtk-demo.exe stdout], [0], [ignore])
111+
AT_CLEANUP
112+
102113
AT_SETUP([ARP example])
103114
AT_WIXLDATA([test-arp.wxs])
104115
AT_WIXLDATA([FoobarAppl10.exe])

tools/wixl/builder.vala

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ namespace Wixl {
66
add_path (".");
77
foreach (var i in includedirs)
88
this.includedirs.append (File.new_for_path (i));
9-
this.includedirs.append (File.new_for_path (Config.PKGDATADIR + "include"));
109
}
1110

1211
WixRoot root;

tools/wixl/wixl.vala

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ namespace Wixl {
1111
[CCode (array_length = false, array_null_terminated = true)]
1212
static string[] defines;
1313
[CCode (array_length = false, array_null_terminated = true)]
14+
static string[] opt_includedirs;
15+
1416
static string[] includedirs;
17+
static string wxidir;
1518

1619
private const OptionEntry[] options = {
1720
{ "version", 0, 0, OptionArg.NONE, ref version, N_("Display version number"), null },
1821
{ "verbose", 'v', 0, OptionArg.NONE, ref verbose, N_("Verbose output"), null },
1922
{ "output", 'o', 0, OptionArg.FILENAME, ref output, N_("Output file"), null },
2023
{ "define", 'D', 0, OptionArg.STRING_ARRAY, ref defines, N_("Define variable"), null },
21-
{ "includedir", 'I', 0, OptionArg.STRING_ARRAY, ref includedirs, N_("Include directory"), null },
24+
{ "includedir", 'I', 0, OptionArg.STRING_ARRAY, ref opt_includedirs, N_("Include directory"), null },
25+
{ "wxidir", 0, 0, OptionArg.STRING, ref wxidir, N_("System include directory"), null },
2226
{ "only-preproc", 'E', 0, OptionArg.NONE, ref preproc, N_("Stop after the preprocessing stage"), null },
2327
{ "", 0, 0, OptionArg.FILENAME_ARRAY, ref files, null, N_("INPUT_FILE...") },
2428
{ null }
@@ -35,6 +39,8 @@ namespace Wixl {
3539
opt_context.set_help_enabled (true);
3640
opt_context.add_main_entries (options, null);
3741

42+
wxidir = Config.PKGDATADIR + "/include";
43+
3844
try {
3945
opt_context.parse (ref args);
4046
} catch (OptionError.BAD_VALUE err) {
@@ -44,6 +50,10 @@ namespace Wixl {
4450
warning (error.message);
4551
}
4652

53+
/* fixme vala, does not support += on arrays without length. */
54+
includedirs = opt_includedirs;
55+
includedirs += wxidir;
56+
4757
if (version) {
4858
GLib.stdout.printf ("%s\n", Config.PACKAGE_VERSION);
4959
exit (0);

0 commit comments

Comments
 (0)