| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Win32::Vcpkg; |
|
2
|
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
587590
|
use strict; |
|
|
3
|
|
|
|
|
20
|
|
|
|
3
|
|
|
|
|
71
|
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
|
3
|
|
|
|
|
4
|
|
|
|
3
|
|
|
|
|
57
|
|
|
5
|
3
|
|
|
3
|
|
67
|
use 5.008001; |
|
|
3
|
|
|
|
|
9
|
|
|
6
|
3
|
|
|
3
|
|
2063
|
use Path::Tiny (); |
|
|
3
|
|
|
|
|
28900
|
|
|
|
3
|
|
|
|
|
68
|
|
|
7
|
3
|
|
|
3
|
|
25
|
use Config; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
1096
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Interface to Microsoft Vcpkg |
|
10
|
|
|
|
|
|
|
our $VERSION = '0.04'; # VERSION |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub root |
|
14
|
|
|
|
|
|
|
{ |
|
15
|
1
|
50
|
|
1
|
1
|
81
|
if(defined $ENV{PERL_WIN32_VCPKG_ROOT}) |
|
16
|
|
|
|
|
|
|
{ |
|
17
|
0
|
|
|
|
|
0
|
my $root = Path::Tiny->new($ENV{PERL_WIN32_VCPKG_ROOT}); |
|
18
|
0
|
0
|
0
|
|
|
0
|
if(-d $root && -f $root->child('.vcpkg-root')) |
|
19
|
|
|
|
|
|
|
{ |
|
20
|
0
|
|
|
|
|
0
|
return $root; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
|
25
|
1
|
50
|
|
|
|
2
|
my $vcpkg_path_txt = Path::Tiny->new( |
|
|
1
|
|
|
|
|
10
|
|
|
26
|
|
|
|
|
|
|
$^O eq 'MSWin32' |
|
27
|
|
|
|
|
|
|
? "~/AppData/Local/vcpkg/vcpkg.path.txt" |
|
28
|
|
|
|
|
|
|
: "~/.vcpkg/vcpkg.path.txt", |
|
29
|
|
|
|
|
|
|
); |
|
30
|
1
|
50
|
|
|
|
119
|
if(-r $vcpkg_path_txt) |
|
31
|
|
|
|
|
|
|
{ |
|
32
|
0
|
|
|
|
|
0
|
my $path = $vcpkg_path_txt->slurp; # FIXME: what is the encoding of this file? |
|
33
|
0
|
|
|
|
|
0
|
chomp $path; |
|
34
|
0
|
|
|
|
|
0
|
my $root = Path::Tiny->new($path); |
|
35
|
0
|
0
|
0
|
|
|
0
|
if(-d $root && -f $root->child('.vcpkg-root')) |
|
36
|
|
|
|
|
|
|
{ |
|
37
|
0
|
|
|
|
|
0
|
return $root; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
46
|
return (); |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $perl_triplet; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub perl_triplet |
|
49
|
|
|
|
|
|
|
{ |
|
50
|
1
|
50
|
|
1
|
1
|
7
|
return $perl_triplet if $perl_triplet; |
|
51
|
|
|
|
|
|
|
|
|
52
|
1
|
50
|
|
|
|
4
|
return $perl_triplet = $ENV{VCPKG_DEFAULT_TRIPLET} if defined $ENV{VCPKG_DEFAULT_TRIPLET}; |
|
53
|
|
|
|
|
|
|
|
|
54
|
1
|
50
|
0
|
|
|
17
|
if($Config{archname} =~ /^x86_64-linux/) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
{ |
|
56
|
1
|
|
|
|
|
4
|
return $perl_triplet = 'x64-linux'; |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
elsif($^O eq 'darwin' && $Config{ptrsize} == 8) |
|
59
|
|
|
|
|
|
|
{ |
|
60
|
0
|
|
|
|
|
0
|
return $perl_triplet = 'x64-osx'; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
elsif($^O eq 'MSWin32') |
|
63
|
|
|
|
|
|
|
{ |
|
64
|
0
|
0
|
|
|
|
0
|
if($Config{ptrsize} == 4) |
|
|
|
0
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
{ |
|
66
|
0
|
|
|
|
|
0
|
return $perl_triplet = 'x86-windows'; |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
elsif($Config{ptrsize} == 8) |
|
69
|
|
|
|
|
|
|
{ |
|
70
|
0
|
|
|
|
|
0
|
return $perl_triplet = 'x64-windows' |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
} |
|
73
|
0
|
|
|
|
|
0
|
die "no triplet for this build of Perl"; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
my %default_triplet = ( |
|
78
|
|
|
|
|
|
|
'MSWin32' => 'x86-windows', |
|
79
|
|
|
|
|
|
|
'linux' => 'x64-linux', |
|
80
|
|
|
|
|
|
|
'darwin' => 'x64-osx', |
|
81
|
|
|
|
|
|
|
); |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub default_triplet |
|
84
|
|
|
|
|
|
|
{ |
|
85
|
1
|
50
|
33
|
1
|
1
|
11
|
$ENV{VCPKG_DEFAULT_TRIPLET} || $default_triplet{$^O} || die "no default triplet for $^O"; |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |