1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
package builder::MyBuilder;
use strict;
use warnings;
use base 'Module::Build::XSUtil';
sub new {
my ($class, %args) = @_;
my $self = $class->SUPER::new(
%args,
c_source => ['xs-src'],
cc_warnings => 1,
generate_ppport_h => 'xs-src/ppport.h',
generate_xshelper_h => 'xs-src/xshelper.h',
needs_compiler_c99 => 1,
xs_files => { 'xs-src/MessagePack.xs' => 'lib/Data/MessagePack.xs' },
);
$self->c_source([]) if $self->pureperl_only; # for Module::Build 0.4224 or below
$self;
}
sub ACTION_test {
my $self = shift;
{
local $ENV{PERL_ONLY} = 1;
$self->log_info("pp tests\n");
$self->SUPER::ACTION_test(@_);
}
if (!$self->pureperl_only) {
local $ENV{PERL_DATA_MESSAGEPACK} = "xs";
$self->log_info("xs tests\n");
$self->SUPER::ACTION_test(@_);
}
}
1;
|