Name

SPVM::Builder::Config::Exe - Excutable File Config Generated by The spvmcc Command.

Description

The SPVM::Builder::Config::Exe class has methods to manipulate the excutable file config generated by the spvmcc command.

Usage

use SPVM::Builder::Config::Exe;

my $config_exe = SPVM::Builder::Config::Exe->new_gnu99;

Inheritance

Fields

before_each_compile_cbs

my $before_each_compile_cbs = $config_exe->before_each_compile_cbs;
$config_exe->before_each_compile_cbs($before_each_compile_cbs);

Gets and sets the before_each_compile_cbs field, an array reference of callbacks called just before the compile command "cc" is executed.

This affects all compilations except for SPVM core source files(This is configured by the "config_spvm_core" field) and the source file for the executable file(This is configured by the "config_bootstrap" field).

config_spvm_core

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_bootstrap

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.

Methods

new

my $config_exe = SPVM::Builder::Config::Exe->new(%fields);

Create a new SPVM::Builder::Config::Exe object with "Fields".

This method calls the new method of the super class after default value settings.

If a field is not defined, the field is set to the following default value.

add_before_each_compile_cb

$config_exe->add_before_each_compile_cb(@before_each_compile_cbs);

Adds callbacks called just before the compile command "cc" is executed at the end of the "before_each_compile_cbs" field.

Examples:

$config_exe->add_before_each_compile_cb(sub {
  my ($config, $compile_info) = @_;
  
  my $cc = $compile_info->cc;
  
  # Do something
});

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License