SPVM::Builder::LibInfo − Library Information for A Linker
The SPVM::Builder::LibInfo class has methods to manipulate library information for a linker.
my $lib_info =
SPVM::Builder::LibInfo−>new(%fields);
my $lib_ldflags = $lib_info−>create_ldflags;
my $config =
$lib_info−>config;
$lib_info−>config($config);
Gets and sets the "config" field, an SPVM::Builder::Config object.
my $name =
$lib_info−>name;
$lib_info−>name($name);
Gets and sets the "name" field, a library name.
Examples:
$lib_info−>name('z');
$lib_info−>name('png');
my $file =
$lib_info−>file;
$lib_info−>file($file);
Gets and sets the "file" field, the absolute path of the library file such as "/path/libz.so", "/path/libpng.a".
my $is_static =
$lib_info−>is_static;
$lib_info−>is_static($is_static);
Gets and sets the "is_static" field. If this field is a true value, this library is linked statically. Otherwise, is linked dynamically.
my $is_abs =
$lib_info−>is_abs;
$lib_info−>is_abs($is_abs);
Gets and sets the "is_abs" field. If this field is a true value, the library is linked by the absolute path "file". Otherwise, is linked by the relative path from library search path.
my $lib_info = SPVM::Builder::LibInfo−>new(%fields);
Creates a new SPVM::Builder::LibInfo object given fields.
The "config" field must be defined.
Field Default Values:
|
• |
All Fields |
undef
Exceptions:
The "config" field must be defined.
my $lib_ldflags = $lib_info−>create_ldflags;
Creates an array reference of the library part of the linker flags given to the linker ld, and returns it.
Return Value Examples:
["−lfoo", "−Wl,−Bstatic −lfoo −Wl,−Bdynamic", "/path/foo.so", "/path/foo.a"]
my $lib_name = $lib_info−>to_string;
Returns "name" field.
Overloads the following operators.
my $bool = !!$lib_info;
Always true.
my $lib_name = "$lib_info";
Alias for "to_string" method.
Copyright (c) 2023 Yuki Kimoto
MIT License