| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package ExtUtils::Builder::BuildTools::Base; |
|
2
|
|
|
|
|
|
|
$ExtUtils::Builder::BuildTools::Base::VERSION = '0.035'; |
|
3
|
2
|
|
|
2
|
|
795
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
51
|
|
|
4
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
|
2
|
|
|
|
|
11
|
|
|
|
2
|
|
|
|
|
87
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
7
|
use parent 'ExtUtils::Builder::Planner::Extension'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1335
|
use Carp 'croak'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
113
|
|
|
9
|
2
|
|
|
2
|
|
9
|
use File::Spec::Functions 'catfile'; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
1034
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub add_methods { |
|
12
|
2
|
|
|
2
|
0
|
196
|
my ($class, $planner, %opts) = @_; |
|
13
|
|
|
|
|
|
|
|
|
14
|
2
|
|
50
|
|
|
8
|
$opts{type} //= 'executable'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
2
|
|
50
|
|
|
8
|
my $compiler_as = delete $opts{compiler_as} // 'compile'; |
|
17
|
|
|
|
|
|
|
$planner->add_delegate($compiler_as, sub { |
|
18
|
2
|
|
|
2
|
|
8
|
my ($planner, $from, $to, %extra) = @_; |
|
|
|
|
|
2
|
|
|
|
|
19
|
2
|
|
|
|
|
11
|
my %args = (%opts, %extra); |
|
20
|
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
14
|
my $compiler = $class->make_compiler(\%args); |
|
22
|
|
|
|
|
|
|
|
|
23
|
2
|
100
|
66
|
|
|
13
|
$args{profiles} = [ delete $args{profile} ] if $args{profile} and not $args{profiles}; |
|
24
|
2
|
|
100
|
|
|
4
|
for my $profile (@{ $args{profiles} // [] }) { |
|
|
2
|
|
|
|
|
6
|
|
|
25
|
1
|
|
|
|
|
7
|
$compiler->add_profile($profile, %args); |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
2
|
50
|
|
|
|
5
|
if (my $include_dirs = $args{include_dirs}) { |
|
29
|
0
|
|
|
|
|
0
|
$compiler->add_include_dirs($include_dirs); |
|
30
|
|
|
|
|
|
|
} |
|
31
|
2
|
50
|
|
|
|
6
|
if (my $defines = $args{defines}) { |
|
32
|
0
|
|
|
|
|
0
|
$compiler->add_defines($defines); |
|
33
|
|
|
|
|
|
|
} |
|
34
|
2
|
50
|
|
|
|
4
|
if (my $extra = $args{extra_args}) { |
|
35
|
0
|
|
|
|
|
0
|
$compiler->add_argument(value => $extra); |
|
36
|
|
|
|
|
|
|
} |
|
37
|
2
|
50
|
|
|
|
5
|
if (my $standard = $args{standard}) { |
|
38
|
0
|
|
|
|
|
0
|
$compiler->set_standard($standard); |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
2
|
|
|
|
|
8
|
my $node = $compiler->compile($from, $to, %args); |
|
42
|
2
|
|
|
|
|
87
|
return $planner->add_node($node); |
|
43
|
2
|
|
|
|
|
23
|
}); |
|
44
|
|
|
|
|
|
|
|
|
45
|
2
|
|
50
|
|
|
36
|
my $linker_as = delete $opts{linker_as} // 'link'; |
|
46
|
|
|
|
|
|
|
$planner->add_delegate($linker_as, sub { |
|
47
|
2
|
|
|
2
|
|
12
|
my ($planner, $from, $to, %extra) = @_; |
|
|
|
|
|
2
|
|
|
|
|
48
|
2
|
|
|
|
|
10
|
my %args = (%opts, %extra); |
|
49
|
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
12
|
my $linker = $class->make_linker(\%args); |
|
51
|
|
|
|
|
|
|
|
|
52
|
2
|
100
|
66
|
|
|
14
|
$args{profiles} = [ delete $args{profile} ] if $args{profile} and not $args{profiles}; |
|
53
|
2
|
|
100
|
|
|
4
|
for my $profile (@{ $args{profiles} // [] }) { |
|
|
2
|
|
|
|
|
10
|
|
|
54
|
1
|
|
|
|
|
8
|
$linker->add_profile($profile, %args); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
2
|
50
|
|
|
|
9
|
if (my $library_dirs = $args{library_dirs}) { |
|
58
|
0
|
|
|
|
|
0
|
$linker->add_library_dirs($library_dirs); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
2
|
50
|
|
|
|
7
|
if (my $libraries = $args{libraries}) { |
|
61
|
0
|
|
|
|
|
0
|
$linker->add_libraries($libraries); |
|
62
|
|
|
|
|
|
|
} |
|
63
|
2
|
50
|
|
|
|
5
|
if (my $extra_args = $args{extra_args}) { |
|
64
|
0
|
|
|
|
|
0
|
$linker->add_argument(ranking => 85, value => [ @{$extra_args} ]); |
|
|
0
|
|
|
|
|
0
|
|
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
2
|
|
|
|
|
17
|
my $node = $linker->link($from, $to, %args); |
|
68
|
2
|
|
|
|
|
98
|
return $planner->add_node($node); |
|
69
|
2
|
|
|
|
|
20
|
}); |
|
70
|
|
|
|
|
|
|
|
|
71
|
2
|
|
|
|
|
21
|
for my $name (qw/object_file library_file static_library_file loadable_file executable_file/) { |
|
72
|
10
|
|
33
|
|
|
91
|
my $format = $opts{$name} // croak "No known extension for $name"; |
|
73
|
|
|
|
|
|
|
$planner->add_delegate($name, sub { |
|
74
|
4
|
|
|
4
|
|
925
|
my ($planner, $file, $dir) = @_; |
|
|
|
|
|
4
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
75
|
4
|
|
|
|
|
18
|
my $filename = sprintf $format, $file; |
|
76
|
4
|
50
|
|
|
|
16
|
return defined $dir ? catfile($dir, $filename) : $filename; |
|
77
|
10
|
|
|
|
|
39
|
}); |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# ABSTRACT: A base class for BuildTools implementations. |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |