|
1 | 1 | # -*-perl-*- hey - emacs - this is a perl file
|
2 |
| - |
| 2 | +# |
| 3 | +# Script that provides 'make' functionality for msvc builds. |
| 4 | +# |
3 | 5 | # src/tools/msvc/build.pl
|
4 |
| - |
| 6 | +# |
5 | 7 | use strict;
|
6 | 8 | use warnings;
|
7 | 9 |
|
|
12 | 14 |
|
13 | 15 | use Mkvcbuild;
|
14 | 16 |
|
| 17 | +sub usage |
| 18 | +{ |
| 19 | + die( "Usage: build.pl [ [ <configuration> ] <component> ]\n" |
| 20 | + . "Options are case-insensitive.\n" |
| 21 | + . " configuration: Release | Debug. This sets the configuration\n" |
| 22 | + . " to build. Default is Release.\n" |
| 23 | + . " component: name of component to build. An empty value means\n" |
| 24 | + . " to build all components.\n"); |
| 25 | +} |
| 26 | + |
15 | 27 | chdir('../../..') if (-d '../msvc' && -d '../../../src');
|
16 | 28 | die 'Must run from root or msvc directory'
|
17 | 29 | unless (-d 'src/tools/msvc' && -d 'src');
|
18 | 30 |
|
| 31 | +usage() unless scalar(@ARGV) <= 2; |
| 32 | + |
19 | 33 | # buildenv.pl is for specifying the build environment settings
|
20 | 34 | # it should contain lines like:
|
21 | 35 | # $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
|
|
37 | 51 | my $vcver = Mkvcbuild::mkvcbuild($config);
|
38 | 52 |
|
39 | 53 | # check what sort of build we are doing
|
40 |
| - |
41 | 54 | my $bconf = $ENV{CONFIG} || "Release";
|
42 | 55 | my $msbflags = $ENV{MSBFLAGS} || "";
|
43 | 56 | my $buildwhat = $ARGV[1] || "";
|
44 |
| -if (uc($ARGV[0]) eq 'DEBUG') |
45 |
| -{ |
46 |
| - $bconf = "Debug"; |
47 |
| -} |
48 |
| -elsif (uc($ARGV[0]) ne "RELEASE") |
| 57 | + |
| 58 | +if (defined($ARGV[0])) |
49 | 59 | {
|
50 |
| - $buildwhat = $ARGV[0] || ""; |
| 60 | + if (uc($ARGV[0]) eq 'DEBUG') |
| 61 | + { |
| 62 | + $bconf = "Debug"; |
| 63 | + } |
| 64 | + elsif (uc($ARGV[0]) ne "RELEASE") |
| 65 | + { |
| 66 | + $buildwhat = $ARGV[0] || ""; |
| 67 | + } |
51 | 68 | }
|
52 | 69 |
|
53 | 70 | # ... and do it
|
|
0 commit comments