Open russel opened 6 years ago
Both, actually, although GtkD is probably a bit more correct. Since D has no ABI stability and you can't use any library compiled with one D compiler with code compiled with another D compiler, the libraries and therefore the .pc files are generally tied to the respective compiler and compiler version that the code was originally compiled with.
In pkg-config files, we generally expect GCC/Clang compatible compiler flags, which makes the dyaml case correct. At the same time though, ldc and dmd are not fully compatible to GCC/Clang's arguments, therefore GtkD could be correct.
What actually happens though is that at least when using Meson, Meson will transparently convert the flags to whatever the currently used D compiler is comfortable with, and AFAIK dub will do the same.
OK. I am stuck with Dub and SCons for build since Meson cannot build Unit-Threaded stuff because there is no unitary build. (I just do a small hack for the SCons build which is irritating but I can cope.)
Meson supports unity builds, but the D support likely doesn't. Implementing this should be easy though.
DMD and LDC not following GCC/Clang flags is an incredible nuisance, so much so that we actually ship a script in Debian as part of the dlang debhelper support to work around this issue. Dub should actually already deal with pkg-config flags correctly, if not this should be fixed. For SCons, you might find the code we ship in Debian as part of our packaging helpers useful: https://salsa.debian.org/d-team/dh-dlang/blob/master/gcc-to-ldc-flags.py (it's a hack, but the best we got at time to work around the compiler flag differences).
The libgtkd-3-dev package on Debian Sid installs /usr/lib/x86_64-linux-gnu/pkgconfig/gtkd-3.pc:
which works for dmd and ldc2, I suspect perhaps not for gdc. D-YAML creates:
Which doesn't work fordmd or ldc2 without adding a -L in front of the Libs options. So who has it right GtkD or D-YAML?