line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SPVM::Builder::Config::Exe; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
70696
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
63
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
5
|
2
|
|
|
2
|
|
9
|
use Carp 'confess'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
231
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
512
|
use SPVM::Builder::Util; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
64
|
|
8
|
2
|
|
|
2
|
|
460
|
use SPVM::Builder::Util::API; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Inheritance |
11
|
2
|
|
|
2
|
|
11
|
use base 'SPVM::Builder::Config'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1022
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Fields |
14
|
|
|
|
|
|
|
sub before_each_compile_cbs { |
15
|
117
|
|
|
117
|
0
|
302
|
my $self = shift; |
16
|
117
|
100
|
|
|
|
420
|
if (@_) { |
17
|
3
|
|
|
|
|
12
|
$self->{before_each_compile_cbs} = $_[0]; |
18
|
3
|
|
|
|
|
8
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
else { |
21
|
114
|
|
|
|
|
404
|
return $self->{before_each_compile_cbs}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub config_spvm_core { |
26
|
8
|
|
|
8
|
1
|
30
|
my $self = shift; |
27
|
8
|
100
|
|
|
|
24
|
if (@_) { |
28
|
3
|
|
|
|
|
6
|
$self->{config_spvm_core} = $_[0]; |
29
|
3
|
|
|
|
|
9
|
return $self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
else { |
32
|
5
|
|
|
|
|
18
|
return $self->{config_spvm_core}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub config_bootstrap { |
37
|
8
|
|
|
8
|
1
|
22
|
my $self = shift; |
38
|
8
|
100
|
|
|
|
27
|
if (@_) { |
39
|
3
|
|
|
|
|
17
|
$self->{config_bootstrap} = $_[0]; |
40
|
3
|
|
|
|
|
9
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
else { |
43
|
5
|
|
|
|
|
32
|
return $self->{config_bootstrap}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# Class Methods |
48
|
|
|
|
|
|
|
sub new { |
49
|
3
|
|
|
3
|
1
|
99
|
my ($self, %fields) = @_; |
50
|
|
|
|
|
|
|
|
51
|
3
|
50
|
|
|
|
18
|
unless (defined $fields{output_type}) { |
52
|
3
|
|
|
|
|
10
|
$fields{output_type} = 'exe'; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
3
|
|
|
|
|
26
|
$self = $self->SUPER::new(%fields); |
56
|
|
|
|
|
|
|
|
57
|
3
|
50
|
|
|
|
18
|
unless (defined $self->before_each_compile_cbs) { |
58
|
3
|
|
|
|
|
12
|
$self->before_each_compile_cbs([]); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
3
|
50
|
|
|
|
14
|
unless (defined $self->config_spvm_core) { |
62
|
3
|
|
|
|
|
27
|
$self->config_spvm_core(SPVM::Builder::Util::API::create_default_config()); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
3
|
50
|
|
|
|
11
|
unless (defined $self->config_bootstrap) { |
66
|
3
|
|
|
|
|
14
|
$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
|
8
|
my ($self, @before_each_compile_cbs) = @_; |
75
|
|
|
|
|
|
|
|
76
|
1
|
|
|
|
|
2
|
push @{$self->{before_each_compile_cbs}}, @before_each_compile_cbs; |
|
1
|
|
|
|
|
4
|
|
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 |