Closed slomp closed 5 years ago
That's way harder than it looks. ;-) We need to know about these switches when compiling system.nim
, for example. Why not put a NimScript config file next to your project file instead. That works with today's Nim.
Ah, indeed, I did not think about system.nim
...
Cool, I did not know I could just add --noMain
to nim.cfg
!
Looks like most nim compiler flags can be specified in the nim.cfg
file.
Things compileToC
et al. can't; is there any piece of documentation stating which compiler toggles can and cannot be specified in a nim.cfg
file?
@Araq Should I close this issue, or is this something worth keeping around for future discussion?
Well switches with --
can, the others are "commands" (c/cc/js/doc) and can't.
Should I close this issue, or is this something worth keeping around for future discussion?
We need to focus. Sorry.
Since nim uses an unified build strategy (through imports and such), a feature that could be very handy to make the main source module more self-contained would be the ability to specify nim compiler flags directly in code, through some sort of pragma, e.g.:
It would be very handy to also be able to introspect these compiler flags in code, as compiler consts accessible by
when
directives.