digitalmars.D.learn - Dub generates a library file that is larger in size than the one built
- Venkat (8/8) Dec 16 2017 The following is the command output by dub with --vverbose
- Jonathan M Davis (3/17) Dec 16 2017 The most likely culprit would be -g, which adds symbolic debug info.
- Venkat (5/5) Dec 16 2017 dub build --vverbose
- Mike Parker (3/8) Dec 16 2017 It's because debug builds are the default. See:
- Venkat (2/2) Dec 16 2017 TY Mike, that explains it.
- Ivan Trombley (3/8) Dec 16 2017 You need to add "--build=release", otherwise dub will build debug
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-7BB682AB55F152616E128D 715E887DF/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 ?
Dec 16 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
Dec 16 2017
dub build --vverbose That is the command I used. Would it be right to assume that -g is being added because --vverbose ? The reason I ask is the file size is about the same when I run the below command. dub build
Dec 16 2017
On Sunday, 17 December 2017 at 02:42:44 UTC, Venkat wrote:dub build --vverbose That is the command I used. Would it be right to assume that -g is being added because --vverbose ? The reason I ask is the file size is about the same when I run the below command. dub buildIt's because debug builds are the default. See: https://code.dlang.org/docs/commandline#buildI
Dec 16 2017
On Sunday, 17 December 2017 at 02:42:44 UTC, Venkat wrote:dub build --vverbose That is the command I used. Would it be right to assume that -g is being added because --vverbose ? The reason I ask is the file size is about the same when I run the below command. dub buildYou need to add "--build=release", otherwise dub will build debug by default.
Dec 16 2017