File tree 4 files changed +36
-20
lines changed
4 files changed +36
-20
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ package Mkvcbuild;
6
6
# src/tools/msvc/Mkvcbuild.pm
7
7
#
8
8
use Carp;
9
- use Win32;
9
+ use if ($^O eq " MSWin32 " ), ' Win32' ;
10
10
use strict;
11
11
use warnings;
12
12
use Project;
@@ -648,9 +648,11 @@ sub mkvcbuild
648
648
# 'Can't spawn "conftest.exe"'; suppress that.
649
649
no warnings;
650
650
651
+ no strict ' subs' ;
652
+
651
653
# Disable error dialog boxes like we do in the postmaster.
652
654
# Here, we run code that triggers relevant errors.
653
- use Win32API::File qw( SetErrorMode :SEM_) ;
655
+ use if ($^O eq " MSWin32 " ), ' Win32API::File' , qw( SetErrorMode :SEM_) ;
654
656
my $oldmode = SetErrorMode(
655
657
SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
656
658
system (" .\\ $exe " );
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ sub _new
22
22
my $self = {
23
23
name => $name ,
24
24
type => $type ,
25
- guid => Win32::GuidGen(),
25
+ guid => $^O eq " MSWin32 " ? Win32::GuidGen() : ' FAKE ' ,
26
26
files => {},
27
27
references => [],
28
28
libraries => [],
Original file line number Diff line number Diff line change @@ -60,10 +60,17 @@ sub DeterminePlatform
60
60
{
61
61
my $self = shift ;
62
62
63
- # Examine CL help output to determine if we are in 32 or 64-bit mode.
64
- my $output = ` cl /? 2>&1` ;
65
- $? >> 8 == 0 or die " cl command not found" ;
66
- $self -> {platform } = ($output =~ / ^\/ favor:<.+AMD64/m ) ? ' x64' : ' Win32' ;
63
+ if ($^O eq " MSWin32" )
64
+ {
65
+ # Examine CL help output to determine if we are in 32 or 64-bit mode.
66
+ my $output = ` cl /? 2>&1` ;
67
+ $? >> 8 == 0 or die " cl command not found" ;
68
+ $self -> {platform } = ($output =~ / ^\/ favor:<.+AMD64/m ) ? ' x64' : ' Win32' ;
69
+ }
70
+ else
71
+ {
72
+ $self -> {platform } = ' FAKE' ;
73
+ }
67
74
print " Detected hardware platform: $self ->{platform}\n " ;
68
75
return ;
69
76
}
@@ -1061,7 +1068,7 @@ EOF
1061
1068
}
1062
1069
if ($fld ne " " )
1063
1070
{
1064
- $flduid {$fld } = Win32::GuidGen();
1071
+ $flduid {$fld } = $^O eq " MSWin32 " ? Win32::GuidGen() : ' FAKE ' ;
1065
1072
print $sln <<EOF ;
1066
1073
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "$fld ", "$fld ", "$flduid {$fld }"
1067
1074
EndProject
Original file line number Diff line number Diff line change @@ -111,21 +111,28 @@ sub CreateProject
111
111
112
112
sub DetermineVisualStudioVersion
113
113
{
114
+ if ($^O eq " MSWin32" )
115
+ {
116
+ # To determine version of Visual Studio we use nmake as it has
117
+ # existed for a long time and still exists in current Visual
118
+ # Studio versions.
119
+ my $output = ` nmake /? 2>&1` ;
120
+ $? >> 8 == 0
121
+ or croak
122
+ " Unable to determine Visual Studio version: The nmake command wasn't found." ;
123
+ if ($output =~ / (\d +)\. (\d +)\.\d +(\.\d +)?$ /m )
124
+ {
125
+ return _GetVisualStudioVersion($1 , $2 );
126
+ }
114
127
115
- # To determine version of Visual Studio we use nmake as it has
116
- # existed for a long time and still exists in current Visual
117
- # Studio versions.
118
- my $output = ` nmake /? 2>&1` ;
119
- $? >> 8 == 0
120
- or croak
121
- " Unable to determine Visual Studio version: The nmake command wasn't found." ;
122
- if ($output =~ / (\d +)\. (\d +)\.\d +(\.\d +)?$ /m )
128
+ croak
129
+ " Unable to determine Visual Studio version: The nmake version could not be determined." ;
130
+ }
131
+ else
123
132
{
124
- return _GetVisualStudioVersion($1 , $2 );
133
+ # fake version
134
+ return ' 16.00' ;
125
135
}
126
-
127
- croak
128
- " Unable to determine Visual Studio version: The nmake version could not be determined." ;
129
136
}
130
137
131
138
sub _GetVisualStudioVersion
You can’t perform that action at this time.
0 commit comments