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