diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl
index de50554e7e..782c9f4f26 100644
--- a/src/tools/msvc/build.pl
+++ b/src/tools/msvc/build.pl
@@ -1,7 +1,9 @@
# -*-perl-*- hey - emacs - this is a perl file
-
+#
+# Script that provides 'make' functionality for msvc builds.
+#
# src/tools/msvc/build.pl
-
+#
use strict;
use warnings;
@@ -36,18 +38,36 @@ do "./src/tools/msvc/config.pl" if (-f "src/tools/msvc/config.pl");
my $vcver = Mkvcbuild::mkvcbuild($config);
-# check what sort of build we are doing
+# Check what sort of build we are doing. Several patterns are
+# supported here depending on how many arguments this script is called
+# with:
+# - No arguments provided imply that all components should be built
+# with a release configuration.
+# - A first optional, case-insensitive, argument can be provided:
+# -- "Release" to trigger a build for all components with a release
+# configuration.
+# -- "Debug" to trigger a build for all components with a debug
+# build.
+# -- Specifying any other value will create a build with a release
+# configuration for the component specified as argument.
+# - A second optional argument can be provided to define a component
+# to build. This can be used with the first argument to build one
+# component at a time with a debug or release configuration.
my $bconf = $ENV{CONFIG} || "Release";
my $msbflags = $ENV{MSBFLAGS} || "";
my $buildwhat = $ARGV[1] || "";
-if (uc($ARGV[0]) eq 'DEBUG')
+
+if (defined($ARGV[0]))
{
- $bconf = "Debug";
-}
-elsif (uc($ARGV[0]) ne "RELEASE")
-{
- $buildwhat = $ARGV[0] || "";
+ if (uc($ARGV[0]) eq 'DEBUG')
+ {
+ $bconf = "Debug";
+ }
+ elsif (uc($ARGV[0]) ne "RELEASE")
+ {
+ $buildwhat = $ARGV[0] || "";
+ }
}
# ... and do it