Skip to content
Browse files

Support anonymous array of directories for c_source

git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@13863 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information...
1 parent 8734b47 commit 5515582c0d171e2293f1022370ba9f098aa2989c @xdg xdg committed
Showing with 18 additions and 3 deletions.
  1. +2 −0 Changes
  2. +5 −0 lib/Module/Build/API.pod
  3. +11 −3 lib/Module/Build/Base.pm
View
2 Changes
@@ -13,6 +13,8 @@ Revision history for Perl extension Module::Build.
- For VMS: fixed prefix handling plus other test fixes [Craig Berry]
+ - Support anonymous array of directories for c_source [Alberto Simões]
+
0.3603 - Mon Jan 18 22:28:59 EST 2010
(Oops, I released the last one before I realized this should have been
View
5 lib/Module/Build/API.pod
@@ -181,6 +181,11 @@ files in the directory will be compiled to object files. The
directory will be added to the search path during the compilation and
linking phases of any C or XS files.
+[version 0.3604]
+
+A list of directories can be supplied using an anonymous array
+reference of strings.
+
=item conflicts
[version 0.07]
View
14 lib/Module/Build/Base.pm
@@ -2728,11 +2728,19 @@ sub process_support_files {
my $p = $self->{properties};
return unless $p->{c_source};
- push @{$p->{include_dirs}}, $p->{c_source};
+ my $files;
+ if (ref($p->{c_source}) eq "ARRAY") {
+ push @{$p->{include_dirs}}, @{$p->{c_source}};
+ for my $path (@{$p->{c_source}}) {
+ push @$files, @{ $self->rscan_dir($path, file_qr('\.c(c|p|pp|xx|\+\+)?$')) };
+ }
+ } else {
+ push @{$p->{include_dirs}}, $p->{c_source};
+ $files = $self->rscan_dir($p->{c_source}, file_qr('\.c(c|p|pp|xx|\+\+)?$'));
+ }
- my $files = $self->rscan_dir($p->{c_source}, file_qr('\.c(c|p|pp|xx|\+\+)?$'));
foreach my $file (@$files) {
- push @{$p->{objects}}, $self->compile_c($file);
+ push @{$p->{objects}}, $self->compile_c($file);
}
}

0 comments on commit 5515582

Please sign in to comment.
Something went wrong with that request. Please try again.