nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

nim.cfg syntax for --define:FOO:VAL undocumented or absent #12367

Closed disruptek closed 4 years ago

disruptek commented 5 years ago

I could not figure out how to add the following define syntax to my nim.cfg:

nim c -d:git2SetVer:0.28.3 some.nim

I tried many permutations with and without ", =, :. Maybe I missed the magic incantation? The solution was to use config.nims thusly:

switch("define", "git2SetVer:0.28.3")
# fwiw this seems to be parsed identically
#switch("define", "git2SetVer=0.28.3")

Thanks to @leorize and @shashlick.

Araq commented 5 years ago

True and also patchFile has no equivalent, NimScript is the future of Nim's configuration system and nim.cfg a legacy. Unfortunately I nowadays like the old .cfg better.... :-(

kaushalmodi commented 4 years ago

Unfortunately I nowadays like the old .cfg better.... :-(

Seems like I will the last standing user of config.nims ..