forked from Unity-Technologies/mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_classlibs_wsl.pl
52 lines (45 loc) · 1.4 KB
/
build_classlibs_wsl.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use Cwd;
use Cwd 'abs_path';
use Getopt::Long;
use File::Basename;
use File::Path;
my $monoroot = File::Spec->rel2abs(dirname(__FILE__) . "/../..");
my $monoroot = abs_path($monoroot);
my $buildScriptsRoot = "$monoroot/external/buildscripts";
my $build = 1;
my $clean = 1;
my $mcsOnly = 0;
my $skipMonoMake = 0;
# Handy troubleshooting/niche options
# The prefix hack probably isn't needed anymore. Let's disable it by default and see how things go
my $shortPrefix = 1;
# This script should not be ran on windows, if it is, kindly switch over to wsl
if ($^O eq "MSWin32")
{
print(">>> Called from Windows. Switching over to wsl\n");
my $monoRootInBash = `bash -c pwd`;
chomp $monoRootInBash;
print(">>> monoRootInBash = $monoRootInBash\n");
my $cmdForBash = "$monoRootInBash/external/buildscripts/build_classlibs_wsl.pl @ARGV";
system("bash", "-c", "\"perl $cmdForBash\"") eq 0 or die("\n");
exit 0;
}
GetOptions(
"build=i"=>\$build,
"clean=i"=>\$clean,
"mcsOnly=i"=>\$mcsOnly,
'skipmonomake=i'=>\$skipMonoMake,
'shortprefix=i'=>\$shortPrefix,
) or die ("illegal cmdline options");
system(
"perl",
"$buildScriptsRoot/build.pl",
"--build=$build",
"--clean=$clean",
"--mcsonly=$mcsOnly",
"--skipmonomake=$skipMonoMake",
"--artifact=1",
"--artifactscommon=1",
"--forcedefaultbuilddeps=1",
"--windowssubsystemforlinux=1",
"--shortprefix=$shortPrefix") eq 0 or die ("Failed building mono\n");