nimble
nimble copied to clipboard
[Feature] Allow Dynamic Library Target
Proposal
To be able to specify in the .nimble
file to make a dll instead of exe for certain targets.
example
We have the following nimble script
author = "Anonymous"
version = "1.0.0"
description = ""
license = "MIT"
srcDir = "src"
bin = @["BinaryExecutable"]
dynlib = @["MyDynamicLib"] # Here
dynlibOptions = "--passL:-static --threads:on" # Command Line Options while building a library.
requires "nim >= 1.6.0"
Now, when we do a nimble build
, it would create binary targets as well as dynamic library targets.
Current Status of dynamic library
Currently dynamic libraries are built manually by nim command as follows:
nim c --app:lib --out:MyModule.dll --threads:on --passL:-static src/MyModule.nim
Other proposed features linked to this (but not part of this yet)
- After this, we can also think about adding support for linking binary executables with dll.
Full Disclosure
I have just started learning nim a day ago and I am not expert enough in nim
or c
at all.
Status: I am currently trying to implement it and so far, I have managed to create the proposed parameters available and are now parsed by the parser. Currently I am stuck on the implementation inside buildFromDir
procedure. All the code will be committed to https://github.com/xcodz-dot/nimble as I go.
So, I wasn't able to do it and thus will wait for someone skilled to do this later.