forked from Unity-Technologies/mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_runtime_win.pl
75 lines (51 loc) · 1.96 KB
/
build_runtime_win.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
sub CompileVCProj;
use File::Spec;
use File::Basename;
use File::Copy;
use File::Path;
my $root = File::Spec->rel2abs( dirname($0) );
if ($ENV{UNITY_THISISABUILDMACHINE})
{
print "rmtree-ing $root/builds because we're on a buildserver, and want to make sure we don't include old artifacts\n";
rmtree("$root/builds");
} else {
print "not rmtree-ing $root/builds, as we're not on a buildmachine";
}
CompileVCProj("$root/msvc/mono.sln","Release_eglib",0);
my $remove = "$root/builds/embedruntimes/win32/libmono.bsc";
if (-e $remove)
{
unlink($remove) or die("can't delete libmono.bsc");
}
#have a duplicate for now...
copy("$root/builds/embedruntimes/win32/mono.dll","$root/builds/monodistribution/bin/mono.dll");
copy("$root/builds/embedruntimes/win32/mono.pdb","$root/builds/monodistribution/bin/mono.pdb");
sub CompileVCProj
{
my $sln = shift(@_);
my $slnconfig = shift(@_);
my $incremental = shift(@_);
my $projectname = shift(@_);
my @optional = @_;
my @devenvlocations = ($ENV{"PROGRAMFILES(X86)"}."/Microsoft Visual Studio 9.0/Common7/IDE/devenv.com",
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 9.0/Common7/IDE/devenv.com",
"$ENV{REALVSPATH}/Common7/IDE/devenv.com");
my $devenv;
foreach my $devenvoption (@devenvlocations)
{
if (-e $devenvoption) {
$devenv = $devenvoption;
}
}
my $buildcmd = $incremental ? "/build" : "/rebuild";
if (defined $projectname)
{
print "devenv.exe $sln $buildcmd $slnconfig /project $projectname @optional \n\n";
system($devenv, $sln, $buildcmd, $slnconfig, '/project', $projectname, @optional) eq 0
or die("VisualStudio failed to build $sln");
} else {
print "devenv.exe $sln $buildcmd $slnconfig\n\n";
system($devenv, $sln, $buildcmd, $slnconfig) eq 0
or die("VisualStudio failed to build $sln");
}
}