##// END OF EJS Templates
build.pl: path fix for windows builds
Jani Honkonen -
r1143:053a00f586e9
parent child
Show More
@@ -1,73 +1,75
1 use File::Basename;
1 use File::Basename;
2 use feature "switch";
2 use feature "switch";
3 use lib 'test/scripts';
3 use lib 'test/scripts';
4 use Jobs;
4 use Jobs;
5
5
6 # read command line params
6 # read command line params
7 my $jobname = shift;
7 my $jobname = shift;
8
8
9 # get script directory
9 # get script directory
10 my $scriptdir = File::Basename::dirname($0);
10 my $scriptdir = File::Basename::dirname($0);
11
11
12 # read ini file
12 # read ini file
13 my $inifile = $scriptdir . "/jobs.ini";
13 my $inifile = $scriptdir . "/jobs.ini";
14 my %job = Jobs::get($inifile, $jobname);
14 my %job = Jobs::get($inifile, $jobname);
15
15
16 # examine the platform
16 # examine the platform
17 given ($job{'Platform'}) {
17 given ($job{'Platform'}) {
18
18
19 when ("Win7") {
19 when ("Win7") {
20
21 $scriptdir =~ s/\//\\/g; # replace / -> \
20
22
21 # construct a build command
23 # construct a build command
22 if ($job{'ToolChain'} eq "mingw") {
24 if ($job{'ToolChain'} eq "mingw") {
23 run($scriptdir . "\\build_win_mingw.bat", $job{'QtDir'}, $job{'Config'}, $job{'MinGWDir'});
25 run($scriptdir . "\\build_win_mingw.bat", $job{'QtDir'}, $job{'Config'}, $job{'MinGWDir'});
24 }
26 }
25 elsif ($job{'ToolChain'} eq "vs2005") {
27 elsif ($job{'ToolChain'} eq "vs2005") {
26 run($scriptdir . "\\build_win_vs2005.bat", $job{'QtDir'}, $job{'Config'});
28 run($scriptdir . "\\build_win_vs2005.bat", $job{'QtDir'}, $job{'Config'});
27 }
29 }
28 elsif ($job{'ToolChain'} eq "vs2008") {
30 elsif ($job{'ToolChain'} eq "vs2008") {
29 run($scriptdir . "\\build_win_vs2008.bat", $job{'QtDir'}, $job{'Config'});
31 run($scriptdir . "\\build_win_vs2008.bat", $job{'QtDir'}, $job{'Config'});
30 }
32 }
31 elsif ($job{'ToolChain'} eq "vs2010") {
33 elsif ($job{'ToolChain'} eq "vs2010") {
32 run($scriptdir . "\\build_win_vs2010.bat", $job{'QtDir'}, $job{'Config'});
34 run($scriptdir . "\\build_win_vs2010.bat", $job{'QtDir'}, $job{'Config'});
33 }
35 }
34 else {
36 else {
35 die "Unknown toolchain!";
37 die "Unknown toolchain!";
36 }
38 }
37 }
39 }
38
40
39 when ("Mac") {
41 when ("Mac") {
40
42
41 # setup build environment
43 # setup build environment
42 $ENV{'QTDIR'} = $job{'QtDir'};
44 $ENV{'QTDIR'} = $job{'QtDir'};
43 $ENV{'PATH'} = $job{'QtDir'} . "/bin:" . $ENV{'PATH'};
45 $ENV{'PATH'} = $job{'QtDir'} . "/bin:" . $ENV{'PATH'};
44
46
45 # run qmake
47 # run qmake
46 my $cmd;
48 my $cmd;
47 if ($job{'ToolChain'} eq "clang") {
49 if ($job{'ToolChain'} eq "clang") {
48 run("qmake -r -spec unsupported/macx-clang CONFIG+=" . $job{'Config'});
50 run("qmake -r -spec unsupported/macx-clang CONFIG+=" . $job{'Config'});
49 }
51 }
50 elsif ($job{'ToolChain'} eq "gcc") {
52 elsif ($job{'ToolChain'} eq "gcc") {
51 run("qmake -r CONFIG+=" . $job{'Config'});
53 run("qmake -r CONFIG+=" . $job{'Config'});
52 }
54 }
53 else {
55 else {
54 die "Unknown toolchain!";
56 die "Unknown toolchain!";
55 }
57 }
56
58
57 # run make
59 # run make
58 run("make");
60 run("make");
59 }
61 }
60
62
61 default {
63 default {
62 die "Unknown platform " . $job{'Platform'};
64 die "Unknown platform " . $job{'Platform'};
63 }
65 }
64 }
66 }
65
67
66 sub run {
68 sub run {
67 my $cmd;
69 my $cmd;
68 foreach (@_) {
70 foreach (@_) {
69 $cmd .= "$_ ";
71 $cmd .= "$_ ";
70 }
72 }
71 print "running : $cmd\n";
73 print "running : $cmd\n";
72 system(@_) == 0 or die "system \"$cmd\" failed: $?";
74 system(@_) == 0 or die "system \"$cmd\" failed: $?";
73 } No newline at end of file
75 }
General Comments 0
You need to be logged in to leave comments. Login now