SPVM::Builder::Config::Exe - Configurations of creating excutable files.
use SPVM::Builder::Config::Exe; my $config = SPVM::Builder::Config::Exe->new_gnu99;
SPVM::Builder::Config::Exe is configuration of creating excutable files of spvmcc.
Fields of SPVM::Builder::Config::Exe.
Fields are inherited from SPVM::Builder::Config and you can use the following fields.
my $global_cc_each = $config->global_cc_each; $config->global_cc_each($global_cc_each);
Get and set a global callback that returns the compiler name for each source file. The call back receives SPVM::Bulder::Config object and optional arguments as a hash reference.
Optional Arguments:
source_file
Each source file.
class_name
The class name
cc
The compiler name that is the value after the process of the process of cc or cc_each of SPVM::Builder::Config.
Examples:
$config->global_cc_each(sub { my ($config, $args) = @_; # Source file my $source_file = $args->{source_file}; # Class name my $class_name = $args->{class_name} # The compiler name my $cc = $args->{cc}; my $global_cc; # C source file if ($source_file =~ /\.c$/) { $global_cc = 'clang'; } # C++ source file elsif ($source_file =~ /\.cpp$/) { $global_cc = 'clang++'; } return $global_cc; });
my $global_ccflags_each = $config->global_ccflags_each; $config->global_ccflags_each($global_ccflags_each);
Get and set a callback that returns the compiler flags for each source file. The call back receives SPVM::Bulder::Config object and optional arguments as a hash reference.
ccflags
The compiler flags that is the value after the process of the process of ccflags or ccflags_each of SPVM::Builder::Config.
$config->global_ccflags_each(sub { my ($config, $args) = @_; # Source file my $source_file = $args->{source_file}; # Class name my $class_name = $args->{class_name} # The compiler name my $cc = $args->{cc}; # The compiler name my $ccflags = $args->{ccflags}; my $global_ccflags = []; # C source file if ($source_file =~ /\.c$/) { $global_ccflags = ['-DFoo', @$ccflags]; } # C++ source file elsif ($source_file =~ /\.cpp$/) { $global_ccflags = ['-DBar', @$ccflags]; } return $global_ccflags; });
my $global_optimize_each = $config->global_optimize_each; $config->global_optimize_each($global_optimize_each);
optimize
The value of optimize that is the value after the process of the process of optimize or optimize_each of SPVM::Builder::Config.
$config->global_optimize_each(sub { my ($config, $args) = @_; # Source file my $source_file = $args->{source_file}; # Class name my $class_name = $args->{class_name} # The compiler name my $cc = $args->{cc}; # The compiler name my $optimize = $args->{optimize}; my $global_optimize; # C source file if ($source_file =~ /\.c$/) { $global_optimize = '-O3'; } # C++ source file elsif ($source_file =~ /\.cpp$/) { $global_optimize = '-O3'; } return $global_optimize; });
my $no_precompile = $config->no_precompile; $config->no_precompile($no_precompile);
If no_precompile is a true value, precompiling is not performed.
no_precompile
my $no_compiler_api = $config->no_compiler_api; $config->no_compiler_api($no_compiler_api);
If no_compiler_api is a true value, the source codes of the compiler native APIs and the precompile native APIs is not linked.
no_compiler_api
Methods of SPVM::Builder::Config::Exe.
Methods are inherited from SPVM::Builder::Config and you can use the following methods.
my $config = SPVM::Builder::Config::Exe->new;
Create a new SPVM::Builder::Config::Exe object.
SPVM::Builder::Config::Exe
This is same as "new" in SPVM::Builder::Config, but set output_type field to exe.
output_type
exe
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.