Is it true that dub compiles everything in the source dir whether it's imported or not?

Gary Willoughby dev at nomad.so
Sat Jan 11 06:53:43 PST 2014


On Saturday, 11 January 2014 at 14:10:20 UTC, Casper Færgemand 
wrote:
> On Saturday, 11 January 2014 at 13:46:51 UTC, Gary Willoughby 
> wrote:
>> I've seen this but the problem is not with my project but a 
>> dependency. I only include two files from the dependency but 
>> when my project is compiled the entire source of the 
>> dependency is compiled and produces the error.
>
> Is that by any chance also why compiling with Dub is slower 
> than just with Dmd? If so, it would be nice to not do for 
> non-release builds.

Yes probably because with DMD you only specify what you need 
compiling and RDMD actually parses the imports so it only 
compiles what is needed. As evidence suggests Dub compiles 
everything, which is slower and results in larger executables.


More information about the Digitalmars-d-learn mailing list