Skip to content

Commit 71d3679

Browse files
committed
Test, doc, implement XS C++
1 parent 04fd2b4 commit 71d3679

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

lib/ExtUtils/MM_Unix.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use DirHandle;
1212
our %Config_Override;
1313
our %XS_ext2src = qw(
1414
xs c
15+
xspp cpp
1516
);
1617
my $xspat = join '|', keys %XS_ext2src;
1718
our $XS_extRE = qr/\.($xspat)\z/;

lib/ExtUtils/MakeMaker/FAQ.pod

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,13 @@ This tip has been brought to you by Nick Ing-Simmons and Stas Bekman.
520520
An alternative way to achieve this can be seen in L<Gtk2::CodeGen>
521521
and L<Glib::CodeGen>.
522522

523-
=back
523+
=head3 How can I build my XS files as C++
524+
525+
If you want to write XSUBs in C++, put them in a file called (for class
526+
Foo::Bar) F<lib/Foo/Bar.xspp>, next to F<lib/Foo/Bar.pm>. In your
527+
F<Makefile.PL>, give C<XSMULTI> as 1. You will make your distribution
528+
much more portable, with much less effort for yourself, if you use
529+
L<ExtUtils::CppGuess> for C++ compiler configuration information.
524530

525531
=head1 DESIGN
526532

t/04-xscpp.t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ use Test::More;
1414
plan skip_all => "ExtUtils::CBuilder not installed or no C++ compiler"
1515
unless have_cplusplus();
1616
plan skip_all => 'Dynaloading not enabled' if $Config{usedl} ne 'define';
17+
plan skip_all => 'No ExtUtils::CppGuess'
18+
unless eval { require ExtUtils::CppGuess };
1719
my @tests = list_cpp();
1820
plan skip_all => "No tests" unless @tests;
1921
plan tests => 6 * @tests;

t/lib/MakeMaker/Test/Setup/XS.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ sub list_dynamic {
313313

314314
sub list_cpp {
315315
(
316+
[ 'cppbasic', '', '' ],
316317
);
317318
}
318319

0 commit comments

Comments
 (0)