Boost logo

Boost-Build :

From: Dave Rahardja (drahardja_at_[hidden])
Date: 2007-04-06 00:51:51


How exactly can I use "actions together" to batch compile files?

I have made a very simple tool definition to try out this feature:

-------
import feature ;

feature.extend toolset : mytool ;

rule init ( version ? : command * : options * )
{
}

generators.register-c-compiler mytool.compile.c++ : CPP : OBJ :
    <toolset>mytool ;
generators.register-linker mytool.link : OBJ : EXE : <toolset>mytool ;

rule compile.c++ ( targets + : sources * : properties * )
{
}

rule link ( targets + : sources * : properties * )
{
}

actions together compile.c++
{
    copy $(>) $(<)
}

actions link
{
    copy $(>[1]) $(<)
}
-------

If I invoked bjam on a Jamroot with the content:

exe foo : foo1.cpp foo2.cpp foo3.cpp ;

I would expect "actions compile.c++" to be invoked with $(>) = foo1.cpp
foo2.cpp foo3.cpp. But it isn't! Instead, the action is invoked three times,
once for each input file.

Is this broken? Or am I doing it wrong?

This feature is becoming more important to my project, as the compiler I'm
using must check out a license each time it's invoked, and the license check
takes forever over the network. I wanted to batch-build the files so that I
can check the license out _once_ and compile all the files together (at
least all the files with the same flags).

-dr


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk