Commit | Line | Data |
591a9381 |
1 | use strict; |
2 | use warnings; |
89dc39a9 |
3 | use inc::Module::Install; |
4 | use 5.008001; |
5 | |
6 | check_conflicts(); |
7 | |
8 | name 'Class-MOP'; |
9 | perl_version '5.008001'; |
10 | all_from 'lib/Class/MOP.pm'; |
11 | license 'perl'; |
591a9381 |
12 | |
3f3e009e |
13 | my %conflicts = ( |
14 | 'Moose' => '1.04', |
15 | ); |
16 | |
17 | check_conflicts(%conflicts); |
18 | |
72bc0a47 |
19 | require Config; |
20 | my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.'; |
06e9254b |
21 | |
22 | if ( -d '.git' || $ENV{MAINTAINER_MODE} ) { |
23 | $ccflags .= ' -Wall -Wdeclaration-after-statement'; |
24 | } |
f125b31e |
25 | |
89dc39a9 |
26 | requires 'Carp'; |
4154c4d0 |
27 | requires 'Data::OptList'; |
89dc39a9 |
28 | requires 'Devel::GlobalDestruction'; |
50de028e |
29 | requires 'List::MoreUtils' => '0.12'; |
d065fbe6 |
30 | requires 'MRO::Compat' => '0.05'; |
2ea94f58 |
31 | requires 'Package::DeprecationManager' => '0.04'; |
407a4276 |
32 | requires 'Package::Stash'; |
d065fbe6 |
33 | requires 'Scalar::Util' => '1.18'; |
34 | requires 'Sub::Name' => '0.04'; |
a8344505 |
35 | requires 'Try::Tiny' => '0.02'; |
89dc39a9 |
36 | requires 'Task::Weaken'; |
37 | |
38 | test_requires 'File::Spec'; |
7975280a |
39 | test_requires 'Test::More' => '0.88'; |
4cd537dd |
40 | test_requires 'Test::Exception' => '0.27'; |
89dc39a9 |
41 | |
8c463274 |
42 | repository 'git://git.moose.perl.org/Class-MOP.git'; |
6b951296 |
43 | add_metadata(x_authority => 'cpan:STEVAN'); |
8c463274 |
44 | |
3fd3a2ab |
45 | extra_tests(); |
46 | |
89dc39a9 |
47 | makemaker_args( CCFLAGS => $ccflags ); |
48 | |
d846ade3 |
49 | { |
50 | my (@clean, @OBJECT, %XS); |
51 | |
52 | for my $xs (<xs/*.xs>) { |
53 | (my $c = $xs) =~ s/\.xs$/.c/i; |
54 | (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i; |
55 | |
56 | $XS{$xs} = $c; |
57 | push @OBJECT, $o; |
58 | push @clean, $o; |
59 | } |
60 | |
61 | for my $c (<*.c>) { |
62 | (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i; |
63 | push @OBJECT, $o; |
64 | push @clean, $o; |
65 | } |
66 | |
67 | makemaker_args( |
68 | clean => { FILES => join(q{ }, @clean) }, |
69 | OBJECT => join (q{ }, @OBJECT), |
70 | XS => \%XS, |
71 | ); |
72 | } |
73 | |
8a9fe086 |
74 | postamble(<<'EOM'); |
75 | $(OBJECT) : mop.h |
76 | EOM |
77 | |
89dc39a9 |
78 | WriteAll(); |
79 | |
d846ade3 |
80 | package MY; |
81 | |
82 | use Config; |
83 | |
84 | sub const_cccmd { |
85 | my $ret = shift->SUPER::const_cccmd(@_); |
86 | return q{} unless $ret; |
87 | |
88 | if ($Config{cc} =~ /^cl\b/i) { |
89 | warn 'you are using MSVC... my condolences.'; |
90 | $ret .= ' /Fo$@'; |
91 | } |
92 | else { |
93 | $ret .= ' -o $@'; |
94 | } |
95 | |
96 | return $ret; |
97 | } |