Report $Mouse::VERSION and the backend (Pure Perl or XS) in load.t
[gitmo/Mouse.git] / Makefile.PL
CommitLineData
08f7a8db 1use strict;
2use warnings;
c3398f5b 3use inc::Module::Install;
4
3f9d4c2b 5system($^X, 'author/generate-mouse-tiny.pl', 'lib/Mouse/Tiny.pm') == 0
6 or warn "Cannot generate Mouse::Tiny: $!";
7
c3398f5b 8name 'Mouse';
9all_from 'lib/Mouse.pm';
10
b9add211 11tests 't/*.t t/*/*.t';
12
ec53d678 13# Scalar::Util < 1.14 has a bug.
14# > Fixed looks_like_number(undef) to return false for perl >= 5.009002
15requires 'Scalar::Util' => 1.14;
272a1930 16
eb88905f 17test_requires 'Test::More' => 0.88;
18test_requires 'Test::Exception' => 0.27;
f1c70cbe 19# test_requires 'Test::Output' => 0.16; # too many dependencies!
20
21include 'Test::Exception'; # work around 0.27_0x (its use of diehook might be wrong)
c3398f5b 22
179ac6cc 23recommends 'MRO::Compat' if $] < 5.010;
24
df6dd016 25my $use_xs;
26
27for (@ARGV) {
28 /^--pp$/ and $use_xs = 0;
29 /^--xs$/ and $use_xs = 1;
30}
0e81c55d 31
32if(!defined $use_xs){
33 configure_requires 'ExtUtils::CBuilder';
34 require ExtUtils::CBuilder;
35 $use_xs = ExtUtils::CBuilder->new(quiet => 1)->have_compiler();
36}
37
38if($use_xs){
39 require Module::Install::XSUtil;
40 use_ppport(3.19);
41 cc_warnings();
42 cc_src_paths('xs-src');
43
44 print "Mouse configured in XS (--xs)\n";
45}
46else{
47 print "Mouse configured in Pure Perl (--pp)\n";
48}
49
314fe304 50if ($Module::Install::AUTHOR) {
bf9f3f91 51 local @INC = ('lib', @INC);
121acb8a 52 require 'lib/Mouse/Spec.pm';
53 my $require_version = Mouse::Spec->MooseVersion;
bf9f3f91 54
55 if (eval{ require Moose; Moose->VERSION($require_version) }) {
314fe304 56 if (eval 'use Module::Install::AuthorTests; 1') {
32cf1353 57 do 'author/create-moose-compatibility-tests.pl';
314fe304 58 recursive_author_tests('xt');
59 } else {
60 print "you don't have a M::I::AuthorTests.\n";
61 }
62 } else {
bf9f3f91 63 print "you don't have Moose $require_version. skipping moose compatibility test\n";
314fe304 64 }
65}
66
02cf53bb 67clean_files 'lib/Mouse/Tiny.pm';
68
eb88905f 69WriteAll check_nmake => 0;
314fe304 70