Last active
December 20, 2015 17:58
-
-
Save ysasaki/6172482 to your computer and use it in GitHub Desktop.
Minillaでsrc/hello.cをscript/helloにcompileしてinstallする感じのMyBuilder.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package builder::MyBuilder; | |
use strict; | |
use warnings; | |
use base qw(Module::Build); | |
use File::Spec; | |
sub new { | |
my ( $self, %args ) = @_; | |
$self->SUPER::new( %args, c_source => ['src'], ); | |
} | |
sub process_support_files { | |
my $self = shift; | |
# set objects in $self->{properties}->{objects} | |
$self->SUPER::process_support_files(); | |
# compile an executable file | |
my $script_dir = 'script'; | |
mkdir $script_dir; # TODO | |
my $b = $self->cbuilder; | |
my $exe = $b->link_executable( | |
objects => $self->{properties}->{objects}, | |
exe_file => File::Spec->catfile($script_dir, 'hello'), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment