or no_cc();
}
+my %prereqs = (
+ 'Scalar::Util' => '1.18',
+ 'Sub::Name' => '0.02',
+ 'Sub::Identify' => '0.03',
+ 'MRO::Compat' => '0.05',
+ 'Carp' => 0,
+);
+
+delete $prereqs{'Sub::Name'}
+ unless $has_compiler;
+
write_makefile();
sub write_makefile {
my $ccflags = -d '.svn' || $ENV{MAINTAINER_MODE} ? '-Wall' : '';
WriteMakefile(
- VERSION_FROM => 'lib/Class/MOP.pm',
- NAME => 'Class::MOP',
- PREREQ_PM => {
- 'Scalar::Util' => '1.18',
- 'Sub::Name' => '0.02',
- 'Sub::Identify' => '0.03',
- 'MRO::Compat' => '0.05',
- 'Carp' => 0,
- },
+ VERSION_FROM => 'lib/Class/MOP.pm',
+ NAME => 'Class::MOP',
+ PREREQ_PM => \%prereqs,
CONFIGURE => \&init,
CCFLAGS => $ccflags,
clean => { FILES => 'test.c test.o' },
use strict;
use warnings;
-use Test::More tests => 65;
+use Test::More;
use Test::Exception;
use Scalar::Util qw/reftype/;
-use Sub::Name ();
+
+BEGIN {
+ if ( eval 'use Sub::Name ();' ) {
+ plan tests => 65;
+ }
+ else {
+ plan skip_all => 'These tests require Sub::Name';
+ }
+}
BEGIN {
use_ok('Class::MOP');
use strict;
use warnings;
-use Test::More 'no_plan';
+use Test::More;
+
+BEGIN {
+ if ( eval 'use Sub::Name qw(subname);' ) {
+ plan tests => 5;
+ }
+ else {
+ plan skip_all => 'These tests require Sub::Name';
+ }
+}
BEGIN { use_ok("Class::MOP") }
-use Sub::Name qw(subname);
sub code_name_is ($$$;$) {
my ( $code, $stash, $name, $desc ) = @_;