build.pl
38 lines
| 1.0 KiB
| text/plain
|
PerlLexer
Jani Honkonen
|
r1132 | use File::Basename; | |
use feature "switch"; | |||
Jani Honkonen
|
r1134 | use lib 'test/scripts'; | |
use Jobs; | |||
Jani Honkonen
|
r1132 | ||
# read command line params | |||
my $jobname = shift; | |||
Jani Honkonen
|
r1134 | # get script directory | |
my $scriptdir = File::Basename::dirname($0); | |||
Jani Honkonen
|
r1133 | ||
Jani Honkonen
|
r1132 | # read ini file | |
my $inifile = $scriptdir . "/jobs.ini"; | |||
Jani Honkonen
|
r1134 | my %job = Jobs::get($inifile, $jobname); | |
Jani Honkonen
|
r1132 | ||
# examine the platform | |||
Jani Honkonen
|
r1134 | given ($job{'Platform'}) { | |
Jani Honkonen
|
r1132 | when ("Win7") { | |
# construct a build command | |||
my @cmd; | |||
Jani Honkonen
|
r1134 | if ($job{'ToolChain'} eq "mingw") { | |
@cmd = ($scriptdir . "\\build_win_mingw.bat", $job{'QtDir'}, $job{'Config'}, $job{'MinGWDir'}); | |||
Jani Honkonen
|
r1132 | } | |
Jani Honkonen
|
r1134 | if ($job{'ToolChain'} eq "vs2005") { | |
@cmd = ($scriptdir . "\\build_win_vs2005.bat", $job{'QtDir'}, $job{'Config'}); | |||
Jani Honkonen
|
r1132 | } | |
Jani Honkonen
|
r1134 | if ($job{'ToolChain'} eq "vs2008") { | |
@cmd = ($scriptdir . "\\build_win_vs2008.bat", $job{'QtDir'}, $job{'Config'}); | |||
Jani Honkonen
|
r1132 | } | |
Jani Honkonen
|
r1134 | if ($job{'ToolChain'} eq "vs2010") { | |
@cmd = ($scriptdir . "\\build_win_vs2010.bat", $job{'QtDir'}, $job{'Config'}); | |||
Jani Honkonen
|
r1132 | } | |
# run the build command | |||
system (@cmd) == 0 or die "system @cmd failed: $?"; | |||
} | |||
default { | |||
Jani Honkonen
|
r1134 | die "Unknown platform " . $job{'Platform'}; | |
Jani Honkonen
|
r1132 | } | |
} |