| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package SPVM::Builder::Config::Exe; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
71602
|
use strict; |
|
|
2
|
|
|
|
|
10
|
|
|
|
2
|
|
|
|
|
62
|
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
56
|
|
|
5
|
2
|
|
|
2
|
|
10
|
use Carp 'confess'; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
226
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
572
|
use SPVM::Builder::Util; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
56
|
|
|
8
|
2
|
|
|
2
|
|
414
|
use SPVM::Builder::Util::API; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
65
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Inheritance |
|
11
|
2
|
|
|
2
|
|
12
|
use base 'SPVM::Builder::Config'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
1014
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Fields |
|
14
|
|
|
|
|
|
|
sub before_each_compile_cbs { |
|
15
|
117
|
|
|
117
|
0
|
314
|
my $self = shift; |
|
16
|
117
|
100
|
|
|
|
365
|
if (@_) { |
|
17
|
3
|
|
|
|
|
19
|
$self->{before_each_compile_cbs} = $_[0]; |
|
18
|
3
|
|
|
|
|
9
|
return $self; |
|
19
|
|
|
|
|
|
|
} |
|
20
|
|
|
|
|
|
|
else { |
|
21
|
114
|
|
|
|
|
392
|
return $self->{before_each_compile_cbs}; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub config_spvm_core { |
|
26
|
8
|
|
|
8
|
1
|
19
|
my $self = shift; |
|
27
|
8
|
100
|
|
|
|
24
|
if (@_) { |
|
28
|
3
|
|
|
|
|
11
|
$self->{config_spvm_core} = $_[0]; |
|
29
|
3
|
|
|
|
|
7
|
return $self; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
else { |
|
32
|
5
|
|
|
|
|
21
|
return $self->{config_spvm_core}; |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub config_bootstrap { |
|
37
|
8
|
|
|
8
|
1
|
23
|
my $self = shift; |
|
38
|
8
|
100
|
|
|
|
28
|
if (@_) { |
|
39
|
3
|
|
|
|
|
16
|
$self->{config_bootstrap} = $_[0]; |
|
40
|
3
|
|
|
|
|
11
|
return $self; |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
else { |
|
43
|
5
|
|
|
|
|
31
|
return $self->{config_bootstrap}; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# Class Methods |
|
48
|
|
|
|
|
|
|
sub new { |
|
49
|
3
|
|
|
3
|
1
|
109
|
my ($self, %fields) = @_; |
|
50
|
|
|
|
|
|
|
|
|
51
|
3
|
50
|
|
|
|
16
|
unless (defined $fields{output_type}) { |
|
52
|
3
|
|
|
|
|
10
|
$fields{output_type} = 'exe'; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
3
|
|
|
|
|
27
|
$self = $self->SUPER::new(%fields); |
|
56
|
|
|
|
|
|
|
|
|
57
|
3
|
50
|
|
|
|
14
|
unless (defined $self->before_each_compile_cbs) { |
|
58
|
3
|
|
|
|
|
11
|
$self->before_each_compile_cbs([]); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
3
|
50
|
|
|
|
12
|
unless (defined $self->config_spvm_core) { |
|
62
|
3
|
|
|
|
|
21
|
$self->config_spvm_core(SPVM::Builder::Util::API::create_default_config()); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
3
|
50
|
|
|
|
17
|
unless (defined $self->config_bootstrap) { |
|
66
|
3
|
|
|
|
|
15
|
$self->config_bootstrap(SPVM::Builder::Util::API::create_default_config()); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
3
|
|
|
|
|
12
|
return $self; |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# Instance Methods |
|
73
|
|
|
|
|
|
|
sub add_before_each_compile_cb { |
|
74
|
1
|
|
|
1
|
1
|
21
|
my ($self, @before_each_compile_cbs) = @_; |
|
75
|
|
|
|
|
|
|
|
|
76
|
1
|
|
|
|
|
4
|
push @{$self->{before_each_compile_cbs}}, @before_each_compile_cbs; |
|
|
1
|
|
|
|
|
5
|
|
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 Name |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
SPVM::Builder::Config::Exe - Configurations of creating excutable files. |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 Description |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
The SPVM::Builder::Config::Exe class has methods to manipulate a config to generate an excutable file using L. |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 Usage |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
use SPVM::Builder::Config::Exe; |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
my $config_exe = SPVM::Builder::Config::Exe->new_gnu99; |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 Inheritance |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=over 2 |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item * L |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=back |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 Fields |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 config_spvm_core |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
my $config_exe_spvm_core = $config_exe->config_spvm_core; |
|
108
|
|
|
|
|
|
|
$config_exe->config_spvm_core($config_exe_spvm_core); |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Gets and sets the C field. |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
This field is a L object for SPVM core source files. |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 config_bootstrap |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
my $config_exe_bootstrap = $config_exe->config_bootstrap; |
|
117
|
|
|
|
|
|
|
$config_exe->config_bootstrap($config_exe_bootstrap); |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Gets and sets the C field. |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
This field is a L object for the bootstrap source file that contains C function in the C language for the executable file. |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 Methods |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head2 new |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
my $config_exe = SPVM::Builder::Config::Exe->new(%fields); |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Create a new C object with L"Fields">. |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
This method calls the C method of the L before the own operations of this method. |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Default Field Values: |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
If a field is not defined, the field is set to the following default value. |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=over 2 |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item * L"output_type"> |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
"exe" |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item * L"before_each_compile_cbs"> |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
[] |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item * L"config_spvm_core"> |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
The return value of the L function of the L class. |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * L"config_bootstrap"> |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
The return value of the L function of the L class. |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=back |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head2 add_before_each_compile_cb |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
$config_exe->add_before_compile_cb(@before_each_compile_cbs); |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Adds elements after the last element of the L"before_each_compile_cbs"> field. |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head1 Copyright & License |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Copyright (c) 2023 Yuki Kimoto |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
MIT License |