digitalmars.D.learn - dynamic linker flags with dub
- KytoDragon (8/8) Apr 29 I want to use dll-style hot-reloading for a windows application
- Richard (Rikki) Andrew Cattermole (6/15) Apr 29 Your best bet probably is to use dub as a library, and change your
- KytoDragon (8/8) Jun 15 For anyone looking for a solution, i created a batch-file called
I want to use dll-style hot-reloading for a windows application which requires a different name for the PDB file for each compilation. (windows locks the pdb file when loading the dll and the compiler can't create a new pdb with the same name). How can I achieve this with dub? Is there a way to inject variables into the linker flags? E.g. something like this in the dub.json: "lflags-windows-ldc": ["/PDB:foo_%random%.pdb"]
Apr 29
On 30/04/2024 10:20 AM, KytoDragon wrote:I want to use dll-style hot-reloading for a windows application which requires a different name for the PDB file for each compilation. (windows locks the pdb file when loading the dll and the compiler can't create a new pdb with the same name). How can I achieve this with dub? Is there a way to inject variables into the linker flags? E.g. something like this in the dub.json: "lflags-windows-ldc": ["/PDB:foo_%random%.pdb"]Your best bet probably is to use dub as a library, and change your ``targetName`` or ``targetPath`` on each compilation. Alternatively you could generate your dub file with the change in it each time that depends upon the actual library (which would be a ``sourceLibrary``).
Apr 29
For anyone looking for a solution, i created a batch-file called "ldc2_random.bat" with this content: ``` echo off del myapp_*.pdb > NUL 2> NUL ldc2 %* -L/PDB:myapp_%random%.pdb ``` and then set my compiler to "--compiler=ldc2_random.bat"
Jun 15