"Jacob Carlborg" <[email protected]> wrote in message
news:[email protected]...
>
[...snip...]
> In D, with this syntax:
>
> target("foo.d", {
> buildflags ~= "-L-ldwt";
> });
>
> target("main.d" {
> buildflags ~= "-release"
> });
>
> "buildflags" would probably be a global function or an instance method. If
> this should work "buildflags" needs to keep some data structure with
> buildflags for each target. This seems quite complicated, making sure the
> correct build flags are used with the correct target.
That's an interestng idea. I think it could be done fairly easily by having
Drake invoke the delegates indirectly like this:
Target t; // global
void invokeBuildStep(Target currTarget, {type} dg)
{
t = currTarget;
dg();
t = null;
}
Only thing though, is if there's any special members added to the Target
subclass being used, the user would have to cast 't' to access them. Then
again, that's an issue in the current design, too. I'll have to think about
this...