Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #51 from plicease/isolate
Browse files Browse the repository at this point in the history
add property alien_isolate_dynamic
  • Loading branch information
plicease committed Sep 4, 2014
2 parents bda2c49 + 7d0ba8b commit 4c5f803
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Alien/Base.pm
Expand Up @@ -12,6 +12,7 @@ use Carp;
use DynaLoader ();

use File::ShareDir ();
use File::Spec;
use Scalar::Util qw/blessed/;
use Capture::Tiny 0.17 qw/capture_merged/;
use Text::ParseWords qw/shellwords/;
Expand Down Expand Up @@ -194,6 +195,16 @@ sub split_flags_windows {
shellwords($line);
}

sub dynamic_lib {
my ($class) = @_;
my $dir = File::Spec->catfile($class->dist_dir, 'dynamic');
return unless -d $dir;
opendir(my $dh, $dir);
my @dlls = grep { /\.so/ || /\.(dylib|dll)$/ } grep !/^\./, readdir $dh;
closedir $dh;
grep { ! -l $_ } map { File::Spec->catfile($dir, $_) } @dlls;
}

1;

__END__
Expand Down
6 changes: 6 additions & 0 deletions lib/Alien/Base/ModuleBuild/API.pod
Expand Up @@ -71,6 +71,12 @@ These parameters, if specified, augment the information found by F<pkg-config>.

A hashref or arrayref of hashrefs defining the repositories used to find and fetch library tarballs (or zipballs etc.). These attributes are used to create C<Alien::Base::ModuleBuild::Repository> objects (or more likely, subclasses thereof). Which class is created is governed by the C<protocol> attribute and the C<alien_repository_class> property below. Available attributes are:

=item alien_isolate_dynamic

[version 0.005]

If set to true, then dynamic libraries will be moved from the C<lib> directory to a separate C<dynamic> directory. This makes them available for FFI modules (see L<FFI::Raw>), while preferring static libraries when creating XS extensions.

=over

=item protocol
Expand Down

0 comments on commit 4c5f803

Please sign in to comment.