Dub generates a library file that is larger in size than the one built on command line.

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sun Dec 17 02:29:11 UTC 2017


On Sunday, December 17, 2017 02:08:00 Venkat via Digitalmars-d-learn wrote:
> The following is the command output by dub with --vverbose
> switch. It generates a file which is 6094400 bytes in size
>
> dmd -lib
> -of.dub/build/library-debug-linux.posix-x86_64-dmd_2077-7BB682AB55F152616E
> 128DD715E887DF/libdjni.a -debug -g -w -version=Have_djni -Isource/
> source/app.d source/jni/JavaArray.d source/jni/JavaClass.d
> source/jni/JavaEnv.d source/jni/JavaField.d source/jni/JavaMethod.d
> source/jni/JavaObject.d source/jni/JavaString.d source/jni/JavaVM.d
> source/jni/JniHelper.d source/jni/JniProxy.d source/jni/jni.d
> source/jni/package.d -vcolumns
>
>
> The below command generates a library file of size 3586152 bytes.
>
> dmd -oflibDJni.a -lib -H -Hdimport/jni source/jni/*.d
>
> so the file generated by dub is almost twice in size. Why such a
> difference ? What does dub include in the generated file ?

The most likely culprit would be -g, which adds symbolic debug info.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list