NAME

SPVM::Builder::LibInfo - Library Information

DESCRIPTION

SPVM::Builder::LibInfo is a library file information.

Fields

name

my $name = $lib_info->name;
$lib_info->name($name);

Get and set the library name. z, png, etc.

file

my $file = $lib_info->file;
$lib_info->file($file);

Get and set the library file. /path/libz.so, /path/libpng.a, etc.

This field has the meaning when "file_flag" is set to a true value.

static

my $static = $lib_info->static;
$lib_info->static($static);

Get and set the flag if the library is linked statically such as libfoo.a.

The default is a false value.

file_flag

my $file_flag = $lib_info->file_flag;
$lib_info->file_flag($file_flag);

Get and set the flag if the library is linked by the file path such as path/libfoo.so, not the name such as -lfoo.

The default is a false value.

static_name_cb

my $static_name_cb = $lib_info->static_name_cb;
$lib_info->static_name_cb($static_name_cb);

Get and set the callback for a static link name.

Default:

sub {
  my ($self, $name) = @_;
  
  $name = "-Wl,-Bstatic -l$name -Wl,-Bdynamic";
  
  return $name;
};

config

my $config = $lib_info->config;
$lib_info->config($config);

Get and set the config that is used to link this library.

Class Methods

The list of class methods.

new

my $lib_info = SPVM::Builder::LibInfo->new;

Instance Methods

to_string

my $lib = $lib_info->to_string;

If "file_flag" is false value and "static" is false value, get the library flag such as -lfoo from "name"" in ".

If "file_flag" is false value and "static" is true value, get the library flag that "static_name_cb"" in " is performed to "name"" in " such as -Wl,-Bstatic -lfoo -Wl,-Bdynamic.

If "file_flag" is true value, get the library file path from "file"" in ".

Operators

SPVM::BlessedObject::String overloads the following operators.

bool

my $bool = !!$lib_info;

Always true.

stringify

my $lib_name = "$lib_info";

Alias for "to_string".