SPVM::Builder::Config::Exe - Excutable File Config
The SPVM::Builder::Config::Exe class has methods to manipulate the config for the excutable file generated by the spvmcc command.
use SPVM::Builder::Config::Exe; my $config_exe = SPVM::Builder::Config::Exe->new_gnu99;
SPVM::Builder::Config
my $global_after_create_compile_info_cbs = $config_exe->global_after_create_compile_info_cbs; $config_exe->global_after_create_compile_info_cbs($global_after_create_compile_info_cbs);
Gets and sets the global_after_create_compile_info_cbs field, an array reference of callbacks that work globally called just after creating a compilation information.
global_after_create_compile_info_cbs
This affects all compilations of native classes and precompilation classes.
my $global_before_compile_cbs = $config_exe->global_before_compile_cbs; $config_exe->global_before_compile_cbs($global_before_compile_cbs);
Gets and sets the global_before_compile_cbs field, an array reference of callbacks that work globally called just before the compile command "cc" is executed.
global_before_compile_cbs
my $config_exe_spvm_core = $config_exe->config_spvm_core; $config_exe->config_spvm_core($config_exe_spvm_core);
Gets and sets the config_spvm_core field, a SPVM::Builder::Config object for SPVM core source files.
config_spvm_core
This field is automatically set and users nomally do not change it.
my $config_exe_bootstrap = $config_exe->config_bootstrap; $config_exe->config_bootstrap($config_exe_bootstrap);
Gets and sets the config_bootstrap field, a SPVM::Builder::Config object for the bootstrap source file for the executable file.
config_bootstrap
my $config_exe = SPVM::Builder::Config::Exe->new(%fields);
Create a new SPVM::Builder::Config::Exe object with "Fields" and fields of its super classes.
This method calls the new method of its super class given %fields with field default values applied.
new
Field Default Values:
output_type
"exe"
"global_before_compile_cbs"
[]
"config_spvm_core"
The return value of the create_default_config function of the SPVM::Builder::Util::API class.
SPVM::Builder::Util::API
"config_bootstrap"
Other Fields
undef
$config_exe->add_global_after_create_compile_info_cb(@global_after_create_compile_info_cbs);
Adds @global_after_create_compile_info_cbs to the end of the "global_after_create_compile_info_cbs" field.
Examples:
$config_exe->add_global_after_create_compile_info_cb(sub { my ($config, $compile_info) = @_; my $cc = $config->cc; # Do something });
$config_exe->add_global_before_compile_cb(@global_before_compile_cbs);
Adds @global_before_compile_cbs to the end of the "global_before_compile_cbs" field.
$config_exe->add_global_before_compile_cb(sub { my ($config, $compile_info) = @_; my $cc_command = $compile_info->to_command; # Do something });
$config_exe->set_global_optimize("-O0 -g");
Sets optimize that works globally. This is the same as the following code.
optimize
$config_exe->add_global_after_create_compile_info_cb(sub { my ($config, $comile_info) = @_; $config->optimize($optimize); });
Copyright (c) 2023 Yuki Kimoto
MIT License
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.