Skip to content

Commit a45a0c9

Browse files
committed
Test, doc, implement XS C++
1 parent 7414f6b commit a45a0c9

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
@@ -521,7 +521,13 @@ This tip has been brought to you by Nick Ing-Simmons and Stas Bekman.
521521
An alternative way to achieve this can be seen in L<Gtk2::CodeGen>
522522
and L<Glib::CodeGen>.
523523

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

526532
=head1 DESIGN
527533

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)