Alien-Lua
view release on metacpan or search on metacpan
lib/Alien/Lua.pm view on Meta::CPAN
my $self = $class->SUPER::new(%opt);
bless($self, __PACKAGE__);
if ($luajit && $CanUseLuaJIT) {
$self->{alien_luajit} = Alien::LuaJIT->new(%opt);
}
return $self;
}
sub luajit { return $_[0]->{alien_luajit} }
sub cflags {
my $self = shift;
if (not ref($self) or not $self->luajit) {
return $self->SUPER::cflags(@_);
}
return $self->luajit->cflags(@_);
}
sub libs {
my $self = shift;
if (not ref($self) or not $self->luajit) {
return $self->SUPER::libs(@_);
}
return $self->luajit->libs(@_);
}
lib/Alien/Lua.pm view on Meta::CPAN
=head1 NAME
Alien::Lua - Alien module for asserting a liblua is available
=head1 SYNOPSIS
use Alien::Lua;
my $alien = Alien::Lua->new;
my $libs = $alien->libs;
my $cflags = $alien->cflags;
=head1 DESCRIPTION
See the documentation of L<Alien::Base> for details on the API of this module.
This module builds a copy of Lua that it ships or picks up a liblua from the
system. It exposes the location of the installed headers and shared objects
via a simple API to use by downstream depenent modules.
=head2 Using LuaJIT
If you have L<Alien::LuaJIT> installed, you can pass the
C<luajit> option to the constructor to make C<Alien::Lua>
act as a shim for C<Alien::LuaJIT>:
use Alien::Lua;
my $alien = Alien::Lua->new(luajit => 1);
my $libs = $alien->libs; # refers to luajit
my $cflags = $alien->cflags; # refers to luajit
Note that if C<Alien::LuaJIT> is not available, the
C<luajit> option becomes a silent no-op.
After passing the C<luajit> option to the constructor,
you can check whether LuaJIT will be used with the C<luajit>
method of C<Alien::Lua>.
=head1 ADDITIONAL METHODS
( run in 0.250 second using v1.01-cache-2.11-cpan-94b05bcf43c )