[Issue 13517] Only touch .di generated file if changed
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Sep 22 14:25:52 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13517
--- Comment #17 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Ketmar Dark from comment #16)
> ahem. just tried `dmd -c z00.d`. no .di file was built. what kind of "side
> effect" are you talking here? ah, and another try: `dmd -c -o- -H z00.d`.
> this time i got .di file, but no .o file. i'm confused.
-c builds .o
-o- suppresses .o file.
-H builds.di file.
So:
Stevens-MacBook-Pro-2:testd steves$ ls testdi.*
testdi.d
Stevens-MacBook-Pro-2:testd steves$ cat testdi.d
void foo() {}
Stevens-MacBook-Pro-2:testd steves$ dmd -c -H testdi.d
Stevens-MacBook-Pro-2:testd steves$ ls testdi.*
testdi.d testdi.di testdi.o
>
> and why build tool doesn't know about '.di'? any sane build tool allows
> adding dependencies. and no build tools except DUB and my own knows about D
> out-of-the-box anyway.
I mean, the build tool knows it only as a dependency, not as a target. It has
no idea how to build the .di file. The .di file is built as a side effect of
building the .o file.
But as I said, you would need to ensure the project that builds the .di file
cannot depend on the .di file, because it doesn't know how to build them, it
just does so as a side effect.
--
More information about the Digitalmars-d-bugs
mailing list