SPVM::Builder::CompileInfo - Compilation Information
The SPVM::Builder::CompileInfo class has methods to manipulate compilation information.
my $config = $compile_info->config; $compile_info->config($config);
Gets and sets the config field.
config
This is a SPVM::Builder::Config object used to compile the source file.
my $source_file = $compile_info->source_file; $compile_info->source_file($source_file);
Gets and sets the source_file field.
source_file
This field is a source file.
my $output_file = $compile_info->output_file; $compile_info->output_file($output_file);
Gets and sets the output_file field.
output_file
This field is an output file.
my $compile_info = SPVM::Builder::CompileInfo->new(%fields);
Creates a new SPVM::Builder::CompileInfo object with "Fields".
Default Field Values:
If a field is not defined, the field is set to the following default value.
"source_file"
undef
"output_file"
"config"
my $compile_command = $compile_info->create_compile_command;
Creates the compilation command, and returns it.
The return value is an array reference.
The following one is an example of the return value.
[qw(cc -o foo.o -c -O2 -Ipath/include foo.c)]
my $config_args = $compile_info->create_compile_command_args;
Creates the parts of the arguments of the compilation command from the information of the "config" field, and returns it. The return value is an array reference.
The -c option, the -o option and the source file name are not contained.
-c
-o
[qw(-O2 -Ipath/include)]
my $compile_command_string = $compile_info->to_cmd;
Calls the create_compile_command method and joins all elements of the returned array reference with a space, and returns it.
"cc -c -o foo.o -O2 -Ipath/include foo.c"
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.