NAME

SPVM::Build::Config - build config

DESCRIPTION

SPVM::Build::Config is configuration of c/c++ compile and link.

Methods

new

my $build_config = SPVM::Build::Config->new;

Create SPVM::Build::Config object.

replace_all_config

my $config = {cc => 'g++', ld => 'g++'};
$build_config->replace_all_config($config);

Replace all config.

All of old configs is removed and added new config.

to_hash

my $config = $build_config->to_hash;

Convert configs to hash reference.

get_config

my $cc = $build_config->get_config('cc');

Get a config value.

set_config

$build_config->set_config(cc => $cc);

Set a config value.

set_ccflags

$build_config->set_ccflags($ccflags);

Set ccflags.

get_ccflags

my $ccflags = $build_config->get_ccflags;

Get ccflags.

add_ccflags

$build_config->add_ccflags($ccflags);

Add ccflags after current ccflags.

set_std

$build_config->set_std('c99');

Set std.

Internally, remove -std=old and add -std=new after ccflags.

set_cc

$build_config->set_cc($cc);

Set cc.

get_cc

my $cc = $build_config->get_cc;

Get cc.

set_optimize

$build_config->set_optimize($optimize);

Set optimize.

get_optimize

my $optimize = $build_config->get_optimize;

Get optimize.

set_ld

$build_config->set_ld($ld);

Set ld.

get_ld

my $ld = $build_config->get_ld;

Get ld.

set_ldflags

$build_config->set_ldflags($ldflags);

Set ldflags.

get_ldflags

my $ldflags = $build_config->get_ldflags;

Get ldflags.

add_ldflags

$build_config->add_ldflags($ldflags);

Add ldflags after current ldflags.