Permalink
Browse files

[Build.PL]: Strip .c files from `include_dirs` since some compilers e…

…rror on `-Ieat.c`
  • Loading branch information...
caldwell committed Mar 3, 2015
1 parent acfa4a9 commit f163e030836be89a6d8f8afaefef10de92614a29
Showing with 13 additions and 1 deletion.
  1. +13 −1 Build.PL
View
@@ -14,7 +14,19 @@ if (-d ".git") { # Are we in our development tree? If so, create MANIFEST.
while (<$dir>) { print $manifest "monotonic_clock/$_" unless /^\./ }
}
my $builder = Module::Build->new(
# This hacks around the fact that we are using c_source to store files, when Module::Build expects directories.
my $custom = Module::Build->subclass(
class => 'My::Builder',
code => <<'CUSTOM_CODE');
sub compile_c {
my ($self, $file, %args) = @_;
# Adding to c_source adds to include_dirs, too. Since we're adding files, remove them.
@{$self->include_dirs} = grep { !/\.c$/ } @{$self->include_dirs};
$self->SUPER::compile_c($file, %args);
}
CUSTOM_CODE
my $builder = $custom->new(
module_name => 'Time::Monotonic',
license => 'perl',
dist_author => 'David Caldwell <david@porkrind.org>',

0 comments on commit f163e03

Please sign in to comment.