Boost logo

Boost-Build :

From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-06-25 13:39:30

Phillip Seaver wrote:

> I've got a program, bin2c.c, for embedding files in executables by
> creating a C file containing the input file as a byte array. I'm trying
> to create a module that will have a rule that runs bin2c to generate the
> C file. I also want the module to compile the executable to be used.
> So, I created bin2c.jam and put it (along with bin2c.c) in
> boost-build/contrib. When I try to use it with "bin2c profiles : [ glob
> *.icc ] ;", I get errors:
>> src/misc/boost-build/build\generators.jam:841: in try-one-generator-really
>> *** argument error
>> * rule object(linking-generator) ( project name ? :
>> property-set : sources + )

This means that you're trying to produce an EXE target from no sources. I'm not
sure which EXE target is been built. Can you post a minimal example reproducing this?

> rule init ( )
> {
> if ! $(.initialized) {
> .initialized = true ;
> exe bin2c_exe : [ GLOB bin2c.c ] : <variant>release
> <threading>single ;

Are you sure this GLOB expands to anything? Can you add

        ECHO "XXX" [ GLOB bin2c.c ] ;

right before this 'exe' declaration. Does your module declares itself as
a project? Err, in fact, even if a module declare itself as a project, it
typically does not have a source location, so this will find no sources.
Where you want this bin2c.c to be located?

> }
> IMPORT $(__name__) : bin2c : : bin2c ;
> }
> rule bin2c ( target : source + )
> {
> return [ make $(target) : bin2c_exe $(source) : bin2c_run ] ;
> }

BTW, this is not 100% right either -- nothing here tells that you produce
C files, so you won't be able to use the results to build exe, or lib.
The 'customization' example shows to do this using a generator. That example
users a Python script for transformation, so it has to be adjusted, but
first we need to figure where you want the C file to be located, and where
the binary should be built to.

- Volodya

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at