On Sat, 09 May 2015 21:31:20 -0400, Ali Çehreli <[email protected]> wrote:
On 05/09/2015 06:18 PM, bitwise wrote: > I'm not sure I understand what you mean, but my point is, that as is, > this feature of DMD is broken. Arguably broken but compared to other tools it behaves in the same way.
dmd is the reference compiler, so the other compilers _should_ behave the same way. I suppose this could be considered arguable, because there may exist a build system(I don't know of any) that will plan for this defect and generate the headers one by one while building out the directories on it's own. So my options are to be burdened by some build tool I don't need just for this one feature, or waste my time writing custom build scripts when this is something that can trivially be implemented in the compiler.
In the interest of not breaking existing build systems, an additional flag could be added to dmd. Something like -Hp for "preserve paths when outputting headers".
The way I see it, the right solution is to provide correct paths to dmd for each file.
Given a build command like the one below, I don't understand how you would achieve this without building the files one by one.
./main.d ./pack/foo.d ./pack/sub/bar.d dmd main.d pack/foo.d pack/sub/bar.d -ofTest -H
The output is: ./main.di ./foo.di ./bar.di And it should be(or could be, if -Hp was passed) ./main.di ./pack/foo.di ./pack/sub/bar.di Bit
