Am 18.03.2013 19:47, schrieb Nick Sabalausky:

DUB has a "--build=release|unittest|profile|etc", but is there
currently any way to configure them? If not, there should be.

For example, on my projects, I typically wrap my unittest blocks in a
project-specific version identifier like version(MyProj_Unittest). Or
on other projects, there can be bugs that prevent them from working
right with certain flags like -inline. Or a project's docs may be
specifically designed/intended to be built a certain way or with a
certain particular other tool. So there needs to be a way to add/remove
options from those builds if there isn't already a way.

What you can do is to set the DFLAGS variable to set completely custom
flags. I've thought about customizing the build types, but the problem
is that customization may be desirable per package or globally and that
it may cause problems if different customizations contradict (e.g. those
of two packages in the same dependency tree). That's why I couldn't
really decide yet if and how to to that. But maybe it makes sense to
allow to specify DMD flags directly on the dub command line.

But for this specific problem - what about a standard version identifier
similar to the "Havexyz" identifiers that are already present, aybe
xyz", "Projectxyz" or something? And then wrap the code in
xyz) version(unittest) {}"?