On Wed, 11 Dec 2013 08:36:29 GMT, Sönke Ludwig wrote:

Sounds like the compiler should be smarter here. Wasn't there some issue that DMD always emits all symbols in Posix systems, which is supposed to be fixed by a proper "export" definition?

I don't think so. I'm pretty sure it's only for shared libraries.

It's planned to make that the default behavior and the first step was already taken in 0.9.20 (caching the build result of each package). It will be the next addition to the build system, but I don't know when exactly I can get around to do it. See also https://github.com/rejectedsoftware/dub/wiki/Separate-compilation-and-caching-of-dependencies.

Ok, I see.

A workaround is to define two configurations in each dependency, the first "library" one just outputs a "library" target as normal, and a second "import" configuration defines the necessary flags for importing that library (consisting of only import folders + the library import flags).

Then each dependency needs to be built once using "dub build (dependency)" and the main project should put a "subConfigurations": {"(dependency)": "import"} entry for each such dependency to use the pre-compiled version.

Well, hopefully this workaround won't be necessary for long.

I'm not sure I understand how this workaround i supposed to work.