Switch warningAsError only works for Nim >= 1.4.0

This commit is contained in:
Mark Spanbroek 2021-12-04 17:55:13 +01:00
parent cfe4c6fc95
commit 92641b552d
2 changed files with 5 additions and 3 deletions

View File

@ -1,2 +0,0 @@
--warningAsError[UnsafeDefault]:"on"
--warningAsError[ProveInit]:"on"

View File

@ -4,4 +4,8 @@ description = "Questionable tests for std/option"
license = "MIT"
task test, "Runs the test suite":
exec "nim c -f -r test.nim"
var options = "-f -r"
when (NimMajor, NimMinor) >= (1, 4):
options &= " --warningAsError[UnsafeDefault]:on"
options &= " --warningAsError[ProveInit]:on"
exec "nim c " & options & " test.nim"