Alien-ROOT
view release on metacpan or search on metacpan
inc/inc_Module-Build/Module/Build/WithXSpp.pm view on Meta::CPAN
);
$build->create_build_script;
If you need to link against some library C<libfoo>, add this to
the options:
extra_linker_flags => [qw(-lfoo)],
There is C<extra_compiler_flags>, too, if you need it.
=item *
You create two folders in the main distribution folder:
F<src> and F<xsp>.
=item *
You put any C++ code that you want to build and include
in the module into F<src/>. All the typical C(++) file
extensions are recognized and will be compiled to object files
and linked into the module. And headers in that folder will
be accessible for C<#include E<lt>myheader.hE<gt>>.
For good measure, move a copy of F<ppport.h> to that directory.
See L<Devel::PPPort>.
=item *
You do not write normal XS files. Instead, you write XS++ and
put it into the F<xsp/> folder in files with the C<.xsp>
extension. Do not worry, you can include verbatim XS blocks
in XS++. For details on XS++, see L<ExtUtils::XSpp>.
=item *
If you need to do any XS type mapping, put your typemaps
into a F<.map> file in the C<xsp> directory. Alternatively,
search CPAN for an appropriate typemap module (cf.
L<ExtUtils::Typemaps::Default> for an explanation).
XS++ typemaps belong into F<.xspt> files in the same directory.
=item *
In this scheme, F<lib/> only contains Perl module files (and POD).
If you started from a pure-Perl distribution, don't forget to add
these magic two lines to your main module:
require XSLoader;
XSLoader::load('My::Module', $VERSION);
=back
=head1 SEE ALSO
L<Module::Build> upon which this module is based.
L<ExtUtils::XSpp> implements XS++. The C<ExtUtils::XSpp> distribution
contains an F<examples> directory with a usage example of this module.
L<ExtUtils::Typemaps> implements progammatic modification (merging)
of C/XS typemaps. C<ExtUtils::Typemaps> was renamed from C<ExtUtils::Typemap>
since the original name conflicted with the core F<typemap> file on
case-insensitive file systems.
L<ExtUtils::Typemaps::Default> explains the concept of having typemaps
shipped as modules.
L<ExtUtils::Typemaps::ObjectMap> is such a typemap module and
probably very useful for any XS++ module.
L<ExtUtils::Typemaps::STL::String> implements simple typemapping for
STL C<std::string>s.
=head1 AUTHOR
Steffen Mueller <smueller@cpan.org>
With input and bug fixes from:
Mattia Barbon
Shmuel Fomberg
Florian Schlichting
=head1 COPYRIGHT AND LICENSE
Copyright 2010, 2011, 2012 Steffen Mueller.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=cut
( run in 0.448 second using v1.01-cache-2.11-cpan-39bf76dae61 )