all_from 'lib/Class/MOP.pm';
license 'perl';
-my $ccflags = -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE} ? '-Wall' : '';
+my $ccflags = ' -I.';
+$ccflags .= ' -Wall' if -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE};
requires 'Carp';
requires 'Devel::GlobalDestruction';
makemaker_args( CCFLAGS => $ccflags );
+{
+ my (@clean, @OBJECT, %XS);
+
+ for my $xs (<xs/*.xs>) {
+ (my $c = $xs) =~ s/\.xs$/.c/i;
+ (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i;
+
+ $XS{$xs} = $c;
+ push @OBJECT, $o;
+ push @clean, $o;
+ }
+
+ for my $c (<*.c>) {
+ (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i;
+ push @OBJECT, $o;
+ push @clean, $o;
+ }
+
+ makemaker_args(
+ clean => { FILES => join(q{ }, @clean) },
+ OBJECT => join (q{ }, @OBJECT),
+ XS => \%XS,
+ );
+}
+
WriteAll();
# Use the cpan-smolder-stable script in the Moose svn root to figure
sleep 4;
}
+
+package MY;
+
+use Config;
+
+sub const_cccmd {
+ my $ret = shift->SUPER::const_cccmd(@_);
+ return q{} unless $ret;
+
+ if ($Config{cc} =~ /^cl\b/i) {
+ warn 'you are using MSVC... my condolences.';
+ $ret .= ' /Fo$@';
+ }
+ else {
+ $ret .= ' -o $@';
+ }
+
+ return $ret;
+}