| 1 |
use v5; |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
|
| 5 |
use lib 'inc'; |
| 6 |
use Module::Build::with::XSTests; |
| 7 |
|
| 8 |
my @extra_compiler_flags = qw( -Ishare/include -Iinclude -Ihax ); |
| 9 |
|
| 10 |
# Perl 5.36 made -std=c99 standard; before then we'll have to request it specially |
| 11 |
push @extra_compiler_flags, qw( -std=c99 ) if $^V lt v5.36.0; |
| 12 |
|
| 13 |
push @extra_compiler_flags, qw( -DDEBUGGING=-g ) if $^X =~ m|/debugperl|; |
| 14 |
|
| 15 |
use Config; |
| 16 |
if( $Config{ccname} eq "gcc" ) { |
| 17 |
# Enable some extra gcc warnings, largely just for author interest |
| 18 |
push @extra_compiler_flags, qw( -Wall -Wno-unused-function -Wno-unused-value ); |
| 19 |
} |
| 20 |
|
| 21 |
my $build = Module::Build::with::XSTests->new( |
| 22 |
module_name => 'XS::Parse::Sublike', |
| 23 |
requires => { |
| 24 |
'perl' => '5.016', # pad_add_name_pvn |
| 25 |
# Not actually needed but used by hax/lexer-additions.c.inc |
| 26 |
}, |
| 27 |
test_requires => { |
| 28 |
'Sub::Util' => 0, |
| 29 |
'Test2::V0' => '0.000147', |
| 30 |
}, |
| 31 |
configure_requires => { |
| 32 |
'Module::Build' => '0.4004', # test_requires |
| 33 |
}, |
| 34 |
share_dir => { |
| 35 |
module => { 'XS::Parse::Sublike' => [ 'share' ] }, |
| 36 |
}, |
| 37 |
license => 'perl', |
| 38 |
create_license => 1, |
| 39 |
create_readme => 1, |
| 40 |
|
| 41 |
extra_compiler_flags => \@extra_compiler_flags, |
| 42 |
c_source => [ "src/" ], |
| 43 |
); |
| 44 |
|
| 45 |
$build->create_build_script; |