line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Win32::Vcpkg::Package; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
517
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
48
|
|
5
|
2
|
|
|
2
|
|
40
|
use 5.008001; |
|
2
|
|
|
|
|
6
|
|
6
|
2
|
|
|
2
|
|
11
|
use Win32::Vcpkg; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
34
|
|
7
|
2
|
|
|
2
|
|
8
|
use Path::Tiny (); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
811
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Interface to Microsoft Vcpkg Packages |
10
|
|
|
|
|
|
|
our $VERSION = '0.03'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
14
|
|
|
|
|
|
|
{ |
15
|
6
|
|
|
6
|
1
|
15715
|
my($class, %args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
6
|
100
|
|
|
|
38
|
my $root = defined $args{root} ? Path::Tiny->new($args{root}) : Win32::Vcpkg->root; |
18
|
6
|
|
66
|
|
|
513
|
my $triplet = $args{triplet} || Win32::Vcpkg->perl_triplet; |
19
|
6
|
50
|
|
|
|
22
|
my @lib = @{ $args{lib} || [] }; |
|
6
|
|
|
|
|
19
|
|
20
|
6
|
100
|
|
|
|
17
|
my $debug = defined $args{debug} ? $args{debug} : $ENV{PERL_WIN32_VCPKG_DEBUG}; |
21
|
|
|
|
|
|
|
|
22
|
6
|
|
|
|
|
11
|
my $cflags = "-I@{[ $root->child('installed', $triplet, 'include') ]}"; |
|
6
|
|
|
|
|
18
|
|
23
|
|
|
|
|
|
|
|
24
|
6
|
|
|
|
|
238
|
my $libdir = $root->child('installed', $triplet, 'lib'); |
25
|
6
|
100
|
|
|
|
186
|
$libdir = $libdir->parent->child('debug','lib') if $debug; |
26
|
6
|
|
|
|
|
189
|
my $libs = "-LIBPATH:$libdir"; |
27
|
|
|
|
|
|
|
|
28
|
6
|
|
|
|
|
37
|
foreach my $lib (@lib) |
29
|
|
|
|
|
|
|
{ |
30
|
6
|
100
|
|
|
|
68
|
if(-f $libdir->child("$lib.lib")) |
31
|
|
|
|
|
|
|
{ |
32
|
5
|
|
|
|
|
288
|
$libs .= " $lib.lib"; # Question: should this be an absolute path? |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
else |
35
|
|
|
|
|
|
|
{ |
36
|
1
|
|
|
|
|
81
|
require Carp; |
37
|
1
|
|
|
|
|
228
|
Carp::croak("unable to find $lib"); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
bless { |
42
|
|
|
|
|
|
|
name => $args{_name}, |
43
|
|
|
|
|
|
|
version => $args{_version}, |
44
|
5
|
|
|
|
|
51
|
root => $root, |
45
|
|
|
|
|
|
|
triplet => $triplet, |
46
|
|
|
|
|
|
|
cflags => $cflags, |
47
|
|
|
|
|
|
|
libs => $libs, |
48
|
|
|
|
|
|
|
}, $class; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
3
|
|
|
3
|
1
|
1059
|
sub name { shift->{name} } |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
3
|
|
|
3
|
1
|
464
|
sub version { shift->{version} } |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
7
|
|
|
7
|
1
|
620
|
sub root { shift->{root} } |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
7
|
|
|
7
|
1
|
2069
|
sub triplet { shift->{triplet} } |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
9
|
|
|
9
|
1
|
1370
|
sub cflags { shift->{cflags} } |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
9
|
|
|
9
|
1
|
925
|
sub libs { shift->{libs} } |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |