| 1 | package FFI::Build::PluginData; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use parent qw( Exporter ); | ||
| 6 | |||
| 7 | our @EXPORT_OK = qw( plugin_data ); | ||
| 8 | |||
| 9 | # ABSTRACT: Platform and local customizations of FFI::Build | ||
| 10 | our $VERSION = '2.11'; # VERSION | ||
| 11 | |||
| 12 | |||
| 13 | sub plugin_data | ||
| 14 | { | ||
| 15 | my($self) = @_; | ||
| 16 | my $caller = caller; | ||
| 17 | if($caller =~ /^FFI::Build::Plugin::(.*)$/) | ||
| 18 | { | ||
| 19 | return $self->{plugin_data}->{$1} ||= {}; | ||
| 20 | } | ||
| 21 | else | ||
| 22 | { | ||
| 23 | require Carp; | ||
| 24 | Carp::croak("plugin_data must be called by a plugin"); | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | 1; | ||
| 29 | |||
| 30 | __END__ |