digitalmars.D.learn - compile x64 .dll and .so without dependencies
- novice2 (5/5) Mar 04 2023 It there any recipe to compile x64 .dll without dependencies?
- Guillaume Piolat (15/20) Mar 05 2023 What we do here in dub.json, for no deps on big 3 desktop OSes:
- novice2 (2/13) Mar 05 2023 Thank you!
It there any recipe to compile x64 .dll without dependencies? I mean it shoud be used without installing things like msvcr120.dll. Dependencies on system dll (advapi32.dll, kerner32.dll) is ok. I don't experiment on linux yet. But interest too.
Mar 04 2023
On Sunday, 5 March 2023 at 06:36:05 UTC, novice2 wrote:It there any recipe to compile x64 .dll without dependencies? I mean it shoud be used without installing things like msvcr120.dll. Dependencies on system dll (advapi32.dll, kerner32.dll) is ok. I don't experiment on linux yet. But interest too.What we do here in dub.json, for no deps on big 3 desktop OSes: "targetType": "dynamicLibrary", "dflags-linux-dmd": ["-defaultlib=libphobos2.a"], "dflags-osx-ldc": ["-static"], "dflags-linux-ldc": ["-link-defaultlib-shared=false"], "dflags-linux-x86_64-ldc": ["-fvisibility=hidden"], "dflags-windows-ldc": ["-mscrtlib=libcmt","-fvisibility=hidden", "-link-defaultlib-shared=false"], Additionally on (Windows + DUB + LDC), you will need to set an envvar: DFLAGS=-fvisibility=hidden -dllimport=none else you may still depend upon a dynamic phobos. It's unfortunate situation for such a common requirement...
Mar 05 2023
On Sunday, 5 March 2023 at 18:35:58 UTC, Guillaume Piolat wrote:"targetType": "dynamicLibrary", "dflags-linux-dmd": ["-defaultlib=libphobos2.a"], "dflags-osx-ldc": ["-static"], "dflags-linux-ldc": ["-link-defaultlib-shared=false"], "dflags-linux-x86_64-ldc": ["-fvisibility=hidden"], "dflags-windows-ldc": ["-mscrtlib=libcmt","-fvisibility=hidden", "-link-defaultlib-shared=false"], Additionally on (Windows + DUB + LDC), you will need to set an envvar: DFLAGS=-fvisibility=hidden -dllimport=noneThank you!
Mar 05 2023