Re: Forcing an order for build_elements

Marvin Humphrey <[email protected]> Sat, 13 Feb 2010 13:12:34 -0800
Newsgroups gmane.comp.lang.perl.modules.module-build
Message-ID <[email protected]>
On Sat, Feb 13, 2010 at 08:26:36PM +0000, Alberto Simões wrote:

> But if I want to use c_source or xs_files and the build for these
> elements depend on a build element, how can I force the order?

Use Module::build's actions.  

    sub ACTION_code {
        my $self = shift;
        $self->dispatch("configure");
        $self->SUPER::ACTION_code;
    }

For what it's worth, KinoSearch has an involved multi-stage build process, and
we avoid c_source altogether, preferring to create our own CBuilder objects
directly.  You might find it useful to take a look at our dev branch M::B
subclass to see how we've handled things.

    http://cpansearch.perl.org/src/CREAMYG/KinoSearch-0.30_082/buildlib/KinoSearch/Build.pm

Marvin Humphrey