On Sun, 30 Mar 2014 16:11:24 GMT, w0rp wrote:

I'm working on some Qt bindings in D, and because I'm going about the business of doing weird things to bind to C++, I'm starting to do strange things with DUB.

The first strange thing is generating D source files and building those. There is an issue blocking this, which has been discussed here before.

I think there was some logical issue making that work, but I'm not sure now. I'll take another look and mark it for the next release (if it turns out to be possible).

The second strange thing I'm trying to do is to build .cpp source files into object code, and then link that into my library. This is because I have found there are some things I simply cannot do in D. The big one is writing a function for allowing for some dynamic_cast behaviour. I have found ways to avoid generating .cpp files in the past, but this one doesn't seem possible otherwise.

How would I go about building a library with DUB which has C++ code linked into it? Should I do something like run an external script which in turn invokes gcc or something?

Yes, using a pre-build command should work for this. Having first class support for C/C++ would be nice, but is currently a very low priority due to all the D related things that still need to be done.