Skip to content

Commit 0c53283

Browse files
vovkasmmohawk2
authored andcommitted
Add MakeMaker::Test::Utils::have_cplusplus
1 parent cda0edd commit 0c53283

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

t/lib/MakeMaker/Test/Utils.pm

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ our $Is_FreeBSD = $^O eq 'freebsd';
1717

1818
our @EXPORT = qw(which_perl perl_lib makefile_name makefile_backup
1919
make make_run run make_macro calibrate_mtime
20-
have_compiler slurp
20+
have_compiler have_cplusplus slurp
2121
$Is_VMS $Is_MacOS
2222
run_ok
2323
hash2files
@@ -361,6 +361,24 @@ sub have_compiler {
361361
return $have_compiler;
362362
}
363363

364+
=item have_cplusplus
365+
366+
$have_compiler = have_cplusplus;
367+
368+
Returns true if there is a C++ compiler available for XS builds.
369+
370+
=cut
371+
372+
sub have_cplusplus {
373+
my $have_cplusplus = 0;
374+
eval {
375+
require ExtUtils::CBuilder;
376+
my $cb = ExtUtils::CBuilder->new(quiet=>1);
377+
$have_cplusplus = $cb->have_cplusplus;
378+
};
379+
return $have_cplusplus;
380+
}
381+
364382
=item slurp
365383
366384
$contents = slurp($filename);

0 commit comments

Comments
 (0)