-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_wx.pl
84 lines (70 loc) · 1.44 KB
/
build_wx.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
use strict;
use Cwd;
use Data::Dumper;
use File::Spec;
use File::Find;
use Getopt::Long;
sub PrintUsage
{
# get just the binary name, not the full path to it
my $scriptName = $0;
$scriptName =~ s/^.*\\(.*?)$/$1/;
print qq{
Usage: $scriptName <location of code> [args]
};
}
my $location = shift;
my $args = shift;
if ( !defined $args )
{
$args = "";
}
if ( !-d $location )
{
$args = $location;
$location = $ENV{wxWidgets};
}
if ( !-d $location )
{
print( "Please specify the location of the code\n" );
PrintUsage();
exit 1;
}
BuildConfig();
sub BuildConfig
{
my $path = $location;
my $args = $args;
chdir "$path\\build\\msw";
my $target;
if ( $ENV{PATH} =~ /VC\\BIN\\amd64;/i )
{
$target = "TARGET_CPU=AMD64";
}
elsif ( $ENV{PATH} =~ /VC\\BIN;/i )
{
$target = "";
}
else
{
die "Microsoft Visual Studio Tools cannot be found in your PATH";
}
my $settings = "SHARED=0 USE_EXCEPTIONS=0 DEBUG_INFO=1";
Build( "BUILD=debug UNICODE=1 $settings $target $args" );
Build( "BUILD=release UNICODE=1 $settings $target $args" );
Build( "BUILD=debug UNICODE=0 $settings $target $args" );
Build( "BUILD=release UNICODE=0 $settings $target $args" );
}
sub Build
{
my $args = shift;
my $command = "nmake.exe -f makefile.vc $args";
print( $command . "\n" );
system( $command );
my $result = $? >> 8;
if ( $result != 0 )
{
print( "$command failed with error $result" );
exit 1;
}
}