libxs-parse-sublike-perl/Build.PL

43 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-07-10 16:56:00 +08:00
use v5;
2022-09-30 15:36:19 +08:00
use strict;
use warnings;
use lib 'inc';
use Module::Build::with::XSTests;
2024-07-10 16:56:00 +08:00
my @extra_compiler_flags = qw( -I. -Iinclude -Ihax );
# Perl 5.36 made -std=c99 standard; before then we'll have to request it specially
push @extra_compiler_flags, qw( -std=c99 ) if $^V lt v5.36.0;
push @extra_compiler_flags, qw( -DDEBUGGING=-g ) if $^X =~ m|/debugperl|;
use Config;
if( $Config{ccname} eq "gcc" ) {
# Enable some extra gcc warnings, largely just for author interest
push @extra_compiler_flags, qw( -Wall -Wno-unused-function -Wno-unused-value );
}
2022-09-30 15:36:19 +08:00
my $build = Module::Build::with::XSTests->new(
module_name => 'XS::Parse::Sublike',
requires => {
'perl' => '5.016', # pad_add_name_pvn
# Not actually needed but used by hax/lexer-additions.c.inc
},
test_requires => {
'Sub::Util' => 0,
2024-07-10 16:56:00 +08:00
'Test2::V0' => 0,
2022-09-30 15:36:19 +08:00
},
configure_requires => {
'Module::Build' => '0.4004', # test_requires
},
license => 'perl',
create_license => 1,
create_readme => 1,
2024-07-10 16:56:00 +08:00
extra_compiler_flags => \@extra_compiler_flags,
c_source => [ "src/" ],
2022-09-30 15:36:19 +08:00
);
$build->create_build_script;