Boost logo

Boost-Build :

Subject: [Boost-build] Generator woes
From: Nogradi, Chris (Chris.Nogradi_at_[hidden])
Date: 2013-07-29 14:57:14


Hello I am having a difficult time making my 1st custom generator and was hoping someone more experienced would be able to guide me. I am currently using a standard generator to produce a C and an H file from a PREPROCESSED_C file:

    type.register MOCK_C : : C ;
    type.register MOCK_H : : H ;

    generators.register-standard mock.generate : PREPROCESSED_C : MOCK_C(mock_%) MOCK_H(mock_%) ;

This generator is often invoked like this:

    mock-c mock : file1.c ;
    exe test : mock ;

which correctly compiles and links the C file and ignores the H file. The H file is used elsewhere using <implicit-dependency>mock.

Now I want to also add support for producing this set of C and H files from a set of H files. The chain needs to look something like this: h files -> c file -> preprocessed c file -> mock_c and mock_h. If I do this:

    generators.register-standard mock.generate_c : H : C ;

Then rather than ignoring the produced MOCK_H file, in the exe target above, it tries to make a C file from it and then link it in also. This is not desired.

So I am trying to do something like this:

    type.register HLIST_C ;
    generators.register-standard mock.generate_hlist : H : HLIST_C ;

and then the chain looks like this: h files -> HLIST_C file -> preprocessed c file -> mock_c and mock_h but I cannot figure out how to coerce the HLIST_C file to be passed as input to the preprocessed_c generator without inheriting the C base file type. I tried creating a custom generator that would go from a set of H files to a PREPROCESSED_C file but still could not figure out how to convert an HLIST_C target to be a C target that could be consumed by a PREPROCESSED_C generator. I tried clone-with-different-type() but this caused duplicate targets.

Any help with this is much appreciated.

Thanks,

Chris

________________________________

CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of the intended recipient(s) and contain information that may be confidential and/or legally privileged. If you have received this email in error, please notify the sender by reply email and delete the message. Any disclosure, copying, distribution or use of this communication (including attachments) by someone other than the intended recipient is prohibited. Thank you.



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