Fix for issue #782. Analyze the output of pkg-config --libs <lib> and massage them if they appear to already be ready for direct use with the compiler.
This change allows using pkg-config within dub with .pc files that were written for use with the compiler directly, which can prove troublesome in some cases (for instance, when using the GtkD debian packages as mentioned in issue #7 82). Basically, we analyze the output of pkg-config and fix up arguments so that they are suitable for the D compiler invokations through dub. Arguments handled include: - double "-L" flags (from gtkd3.pc for example) -> passed as single "-L" flags - "-defaultlib" flags (from phobos2.pc for example) -> passed as-is (previous dub code used to pass them as "-Ldefaultlib") - "-pthread" flags (from libavcode.pc for example) -> passed as "-L-l-pthread" (previous dub code used to pass them as-is) The test case tests for these arguments explicitly, is currently only applicable to DMD frontend versions >= 2.068 as other frontends/versions seems to have some issues with shared libraries. |
---|
|
source/dub/compilers/compiler.d |
---|