The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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

global_after_create_compile_info_cbs

  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 called just after creating a compilation information.

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).

global_before_compile_cbs

  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 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_global_after_create_compile_info_cb

  $config_exe->add_global_after_create_compile_info_cb(@global_after_create_compile_info_cbs);

Adds callbacks called just after creating a compilation information at 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
  });

add_global_before_compile_cb

  $config_exe->add_global_before_compile_cb(@global_before_compile_cbs);

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

Examples:

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

set_global_optimize

  $config_exe->set_global_optimize("-O0 -g");

Set global optimize.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License