SPVM::D...esource(3)
πΈ Name πΈ
okay so bestie, welcome to SPVM::Document::Resource β literally just Resource π. This page comes from the User Contributed Perl Documentation, and the manual name/tag is SPVM::D...esource(3). Periodt.
β¨ Resource β¨
A resource in SPVM is a native class that contains header files and source files written by native languages such as the C language or C++. It must have its config file. It does not need to have a native class file. No cap.
π Resource Class π
Here's a whole example of a resource, bestie. The config file is SPVM/Resource/MyResource.config:
my $config = SPVM::Builder::Config->new_gnu99;
$config->is_resource(1);
my @source_files = ("myresource.c");
$config->add_source_file(@source_files);
$config;
Native header files:
SPVM/Resource/MyResource.native/include/myresource.h
Native source files:
SPVM/Resource/MyResource.native/src/myresource.c
π¦ Resource User Class π¦
A native class can include native header files of a resource and add the object files generated by native source files of a resource to the object files for the linker using SPVM::Builder::Config#use_resource. It's giving build magic β¨.
The config file is SPVM/MyClass.config:
my $config = SPVM::Builder::Config->new_gnu99;
$config->use_resource("Resource::MyResource");
$config;
And SPVM/MyClass.c looks like this:
#include "myresource.h"
π Examples π
Peep Resource::Zlib at https://github.com/yuki-kimoto/SPVM-Resource-Zlib β it's a real example of resources. Obsessed π
.
π Distribution π
A distribution for a resource can be generated by the spvmdist command with the --resource option. Here's the vibe:
# C
spvmdist --resource Resource::Foo
# C++
spvmdist --resource --native c++ Resource::Foo
π See Also π
- Resource Modules β
https://github.com/yuki-kimoto/SPVM/wiki/CPAN-Modules#resource-modules SPVM::Document
π Copyright & License π
Copyright (c) 2023 Yuki Kimoto
MIT License
okay that's the whole page, bestie! π
This one's from perl v5.42.2, dated 2026-02-03, and the manual tag is SPVM::D...esource(3) β slay π«Ά.
π¦ where this page comes from
- alpine 3.24: spvm-doc 0.990125-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms