SPVM::Builder::LinkInfo − Linker Information
The SPVM::Builder::LinkInfo class has methods to manipulate linker information.
my $link_info =
SPVM::Builder::LinkInfo−>new(%fields);
my $link_command = $link_info−>to_command;
my $config =
$link_info−>config;
$link_info−>config($config);
Gets and sets the "config" field, an SPVM::Builder::Config object.
my $output_file
= $link_info−>output_file;
$link_info−>output_file($output_file);
Gets and sets the "output_file" field, an output file.
my $object_files
= $link_info−>object_files;
$link_info−>object_files($object_files);
Gets and sets the "object_files" field, an array reference of SPVM::Builder::ObjectFileInfo objects.
my $no_generate
= $link_info−>no_generate;
$link_info−>no_generate($no_generate);
Gets and sets the "no_generate" field. If this field is a true value, the output file is not generated.
my $link_info = SPVM::Builder::LinkInfo−>new(%fields);
Creates a new "SPVM::Builder::LinkInfo" object given "Fields".
Field Default Values:
|
• |
"output_file" |
undef
|
• |
"object_files" |
[]
|
• |
"no_generate" |
undef
Exceptions:
The "config" field must be defined.
my $link_command = $link_info−>create_command;
Creates an array reference of the link command, and returns it.
Return Value Examples:
[qw(cc −o dylib.so foo.o bar.o −shared −O2 −Llibdir −lz)]
my $ldflags = $link_info−>create_ldflags;
Creates an array reference of the linker options, and returns it.
The output file "output_file" and the object files "object_files" are not contained.
Return Value Examples:
[qw(−shared −O2 −Llibdir −lz)]
my $link_command_string = $link_info−>to_command;
Joins all elements of the return value of "create_command" method with a space, and returns it.
Return Value Examples:
"cc −o dylib.so foo.o bar.o −shared −O2 −Llibdir −lz"
Copyright (c) 2023 Yuki Kimoto
MIT License