Skip to content

Commit a5f9375

Browse files
committed
Test, doc, implement XS C++
1 parent 16b8ec4 commit a5f9375

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
@@ -11,6 +11,7 @@ use File::Basename qw(basename dirname);
1111
our %Config_Override;
1212
our %XS_ext2src = qw(
1313
xs c
14+
xscc cpp
1415
);
1516
my $xspat = join '|', keys %XS_ext2src;
1617
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
@@ -544,7 +544,13 @@ This tip has been brought to you by Nick Ing-Simmons and Stas Bekman.
544544
An alternative way to achieve this can be seen in L<Gtk2::CodeGen>
545545
and L<Glib::CodeGen>.
546546

547-
=back
547+
=head3 How can I build my XS files as C++
548+
549+
If you want to write XSUBs in C++, put them in a file called (for class
550+
Foo::Bar) F<lib/Foo/Bar.xscc>, next to F<lib/Foo/Bar.pm>. In your
551+
F<Makefile.PL>, give C<XSMULTI> as 1. You will make your distribution
552+
much more portable, with much less effort for yourself, if you use
553+
L<ExtUtils::CppGuess> for C++ compiler configuration information.
548554

549555
=head1 DESIGN
550556

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
@@ -414,6 +414,7 @@ sub list_dynamic {
414414

415415
sub list_cpp {
416416
(
417+
[ 'cppbasic', '', '' ],
417418
);
418419
}
419420

0 commit comments

Comments
 (0)