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