Hi
I'm trying to understand how to build an application in nim.
so far, I've done the nimble init and have a folder structure.
I'd like to create three modules. a.nim b.nim c.nim and have a main.nim
how do I build this using nim's equivalent? I figured nimble would do it.
ideally I'd like to just type nimble build and the application is compiled and an exe pops out (or errors...)
I need the threads:on command line option arg. Is this something I can do with a nimble file? I used nimble init but I can't see where I'd add the option for threads. Or how to add files to it so that it knows my project.
found this: https://github.com/nim-lang/nimble#readme
But I can't figure out how to pass the threads:on option. I've seen that apparently I might be able to use nimble build --threads:on or similar. Surely I can put that option into the nimble file itself? Do I really have to add that to the actual command line I use?
thanks
If you look for the list of Nimble packages, you can look at GitHub source for some of them to see what other people do.
I typically do:
/foo.nimble
/nim.cfg
/src/foo.nim
/src/foopkg/a.nim
/src/foopkg/b.nim
/src/foopkg/c.nim
(I've renamed your main.nim to foo.nim so the executable will be called foo, there are ways to rename the executable before installing it.)
In foo.nimble:
srcDir = "src"
installDirs = @["foopkg"]
bin = @["foo"]
That way, others can depend on your "foopkg".