Name
SPVM::Builder::Config::Exe - Excutable File Config
Description
The SPVM::Builder::Config::Exe class has methods to manipulate the config for the excutable file generated by spvmcc command.
Usage
use SPVM::Builder::Config::Exe;
my $config_exe = SPVM::Builder::Config::Exe->new_gnu99;
Details
Warning: Should Not Change Compiler Flags
The fields for compiler flags in SPVM::Builder::Config such as "cc" in SPVM::Builder::Config, "std" in SPVM::Builder::Config should not be changed.
This is because the compiler flags are used to compile SPVM core source files and a bootstrap source file generagted by spvmcc
command.
Super Class
Fields
before_compile_cbs_global
my $before_compile_cbs_global = $config_exe->before_compile_cbs_global;
$config_exe->before_compile_cbs_global($before_compile_cbs_global);
Gets and sets the before_compile_cbs_global
field, an array reference of callbacks that work globally called just before the compile command "cc" is executed.
This affects all compilations.
ccflags_global
my $ccflags_global = $config->ccflags_global;
$config->ccflags_global($ccflags_global);
Gets and sets ccflags
field, an array reference containing arugments of the compiler "cc" in all compilation.
ccflags_spvm
my $ccflags_spvm = $config->ccflags_spvm;
$config->ccflags_spvm($ccflags_spvm);
Gets and sets ccflags_spvm
field, an array reference containing arugments of the compiler "cc" in compilations of SPVM source code and a bootstrap source file.
ccflags_native
my $ccflags_native = $config->ccflags_native;
$config->ccflags_native($ccflags_native);
Gets and sets ccflags_native
field, an array reference containing arugments of the compiler "cc" in compilation of all native class source file(such as MyClass.c) and all native source files(such as MyClass.native/src/mysource.c>.
ccflags_native_class
my $ccflags_native_class = $config->ccflags_native_class($class_name);
$config->ccflags_native_class($class_name, $ccflags_native);
Gets and sets the value of ccflags_native_class
field's class name key $class_name, an array reference containing arugments of the compiler "cc" in compilation of native class source file(such as MyClass.c) and all native source files(such as MyClass.native/src/mysource.c> in $class_name.
ccflags_precompile
my $ccflags_precompile = $config->ccflags_precompile;
$config->ccflags_precompile($ccflags_precompile);
Gets and sets ccflags_precompile
field, an array reference containing arugments of the compiler "cc" in compilation for precompilation.
defines_global
my $defines_global = $config->defines_global;
$config->defines_global($defines_global);
Gets and sets defines
field, an array reference containing the value of -D
arugments of the compiler "cc" in all compilation.
defines_spvm
my $defines_spvm = $config->defines_spvm;
$config->defines_spvm($defines_spvm);
Gets and sets defines_spvm
field, an array reference containing the value of -D
arugments of the compiler "cc" in compilations of SPVM source code and a bootstrap source file.
defines_native
my $defines_native = $config->defines_native;
$config->defines_native($defines_native);
Gets and sets defines_native
field, an array reference containing the value of -D
arugments of the compiler "cc" in compilation of all native class source file(such as MyClass.c) and all native source files(such as MyClass.native/src/mysource.c>.
defines_native_class
my $defines_native_class = $config->defines_native_class($class_name);
$config->defines_native_class($class_name, $defines_native);
Gets and sets the value of defines_native_class
field's class name key $class_name, an array reference containing the value of -D
arugments of the compiler "cc" in compilation of native class source file(such as MyClass.c) and all native source files(such as MyClass.native/src/mysource.c> in $class_name.
defines_precompile
my $defines_precompile = $config->defines_precompile;
$config->defines_precompile($defines_precompile);
Gets and sets defines_precompile
field, an array reference containing the value of -D
arugments of the compiler "cc" in compilation for precompilation.
optimize_global
my $optimize_global = $config->optimize_global;
$config->optimize_global($optimize_global);
Gets and sets optimize
field, an arugment of the compiler "cc" for optimization in all compilation.
optimize_spvm
my $optimize_spvm = $config->optimize_spvm;
$config->optimize_spvm($optimize_spvm);
Gets and sets optimize_spvm
field, an arugment of the compiler "cc" for optimization in compilations of SPVM source code and a bootstrap source file.
optimize_native
my $optimize_native = $config->optimize_native;
$config->optimize_native($optimize_native);
Gets and sets optimize_native
field, an arugment of of the compiler "cc" for optimization in compilation of all native class source file(such as MyClass.c) and all native source files(such as MyClass.native/src/mysource.c>.
optimize_native_class
my $optimize_native_class = $config->optimize_native_class($class_name);
$config->optimize_native_class($class_name, $optimize_native);
Gets and sets the value of optimize_native_class
field's class name key $class_name, an arugments of the compiler "cc" for optimization in compilation of native class source file(such as MyClass.c) and all native source files(such as MyClass.native/src/mysource.c> in $class_name.
optimize_precompile
my $optimize_precompile = $config->optimize_precompile;
$config->optimize_precompile($optimize_precompile);
Gets and sets optimize_precompile
field, an arugment of of the compiler "cc" for optimization in compilation for precompilation.
include_dirs_global
my $include_dirs_global = $config->include_dirs_global;
$config->include_dirs_global($include_dirs_global);
Gets and sets include_dirs
field, an array reference containing -I
arugments of the compiler "cc" in all compilation.
include_dirs_spvm
my $include_dirs_spvm = $config->include_dirs_spvm;
$config->include_dirs_spvm($include_dirs_spvm);
Gets and sets include_dirs_spvm
field, an array reference containing -I
arugments of the compiler "cc" in compilations of SPVM source code and a bootstrap source file.
include_dirs_native
my $include_dirs_native = $config->include_dirs_native;
$config->include_dirs_native($include_dirs_native);
Gets and sets include_dirs_native
field, an array reference containing -I
arugments of the compiler "cc" in compilation of all native class source file(such as MyClass.c) and all native source files(such as MyClass.native/src/mysource.c>.
include_dirs_native_class
my $include_dirs_native_class = $config->include_dirs_native_class($class_name);
$config->include_dirs_native_class($class_name, $include_dirs_native);
Gets and sets the value of include_dirs_native_class
field's class name key $class_name, an array reference containing -I
arugments of the compiler "cc" in compilation of native class source file(such as MyClass.c) and all native source files(such as MyClass.native/src/mysource.c> in $class_name.
include_dirs_precompile
my $include_dirs_precompile = $config->include_dirs_precompile;
$config->include_dirs_precompile($include_dirs_precompile);
Gets and sets include_dirs_precompile
field, an array reference containing -I
arugments of the compiler "cc" in compilation for precompilation.
Methods
new
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.
Field Default Values:
-
"exe"
-
[]
Other Fields
undef
add_before_compile_cb_global
$config_exe->add_before_compile_cb_global(@before_compile_cbs_global);
Adds @before_compile_cbs_global to the end of "before_compile_cbs_global" field.
Examples:
$config_exe->add_before_compile_cb_global(sub {
my ($config, $compile_info) = @_;
my $cc_command = $compile_info->to_command;
# Do something
});
add_ccflag_global
$config->add_ccflag_global(@ccflags_global);
Adds @ccflags_global to the end of "ccflags_global" field.
add_ccflag_spvm
$config->add_ccflag_spvm(@ccflags_spvm);
Adds @ccflags_spvm to the end of "ccflags_spvm" field.
add_ccflag_native
$config->add_ccflag_native(@ccflags_native);
Adds @ccflags_native to the end of "ccflags_native" field.
add_ccflag_native_class
$config->add_ccflag_native_class($class_name, @ccflags_native_class);
Adds @ccflags_native_class to the end of "ccflags_native_class" field's key $class_name.
add_ccflag_precompile
$config->add_ccflag_precompile(@ccflags_precompile);
Adds @ccflags_precompile to the end of "ccflags_precompile" field.
add_define_global
$config->add_define_global(@defines_global);
Adds @defines_global to the end of "defines_global" field.
add_define_spvm
$config->add_define_spvm(@defines_spvm);
Adds @defines_spvm to the end of "defines_spvm" field.
add_define_native
$config->add_define_native(@defines_native);
Adds @defines_native to the end of "defines_native" field.
add_define_native_class
$config->add_define_native_class($class_name, @defines_native_class);
Adds @defines_native_class to the end of "defines_native_class" field's key $class_name.
add_define_precompile
$config->add_define_precompile(@defines_precompile);
Adds @defines_precompile to the end of "defines_precompile" field.
add_include_dir_global
$config->add_include_dir_global(@include_dirs_global);
Adds @include_dirs_global to the end of "include_dirs_global" field.
add_include_dir_spvm
$config->add_include_dir_spvm(@include_dirs_spvm);
Adds @include_dirs_spvm to the end of "include_dirs_spvm" field.
add_include_dir_native
$config->add_include_dir_native(@include_dirs_native);
Adds @include_dirs_native to the end of "include_dirs_native" field.
add_include_dir_native_class
$config->add_include_dir_native_class($class_name, @include_dirs_native_class);
Adds @include_dirs_native_class to the end of "include_dirs_native_class" field's key $class_name.
add_include_dir_precompile
$config->add_include_dir_precompile(@include_dirs_precompile);
Adds @include_dirs_precompile to the end of "include_dirs_precompile" field.
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License