Boost logo

Boost-Build :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-02-19 15:12:14


----- Original Message -----
From: "Achim Domma" <achim.domma_at_[hidden]>
To: <jamboost_at_[hidden]>
Sent: Monday, February 18, 2002 11:40 AM
Subject: RE: [jamboost] Building COM Objects with boost jam

> I have a source file called MyProj.idl which contains the COM interface
> definitions. This file has to be compiled by midl.exe like this:
>
> midl.exe /tlb ".\MyProj.tlb" /h "MyProj.h" /iid "MyProj_i.c" /Oicf
>
> This produces MyProj.tlb, MyProj.h and MyProj_i.c. The .h and .c file are
> included in another file(s) (so the .c file should be called .h, but this
> was made by a wizard). The .tlb is part of the resources which will be
> linked to the resulting dll.
>
> Achim

This is a bit nontrivial, but I'll try to improvise an answer:

gGENERATOR_FUNCTION(TLB) = idl-files ;
SUFTLB = .tlb .h _i.c ;
gLINKABLE_PRODUCT_INDEX(TLB) = 1 ;

rule idl-files ( tlb-file h-file c-file : idl-file )
{
MakeLocate $(tlb-file) : $(LOCATE_TARGET) ;
MakeLocate $(h-file) $(c-file) : $(LOCATE_SOURCE) ;
}

# assuming source file goes at the end of the command-line
actions idl-files
{
midl.exe /tlb "$(<[1])" /h "$(<[2])" /iid "$(<[3])" /Oicf "$(>)"
}

gTARGET_TYPE_ID(TLB) = TLB ;

# Declare an IDL file.
rule idl ( name : sources + : requirements * : default-BUILD * )
{
declare-local-target $(name) : $(sources) : $(requirements) :
$(default-BUILD) : TLB ;
}
Now you /should/ be able to write:

idl MyProj : MyProj.idl ;
dll whatever : source1.cpp source2.cpp <idl>MyProj ... ;

Of course, I just did this off the top of my head (no testing) but it's a
start.

 


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