NimScript: --define works as expected

This commit is contained in:
Araq 2015-09-30 11:02:23 +02:00
commit d80f163384
3 changed files with 8 additions and 1 deletions

View file

@ -140,4 +140,7 @@ proc runNimScript*(scriptName: string) =
# ensure we load 'system.nim' again for the real non-config stuff! # ensure we load 'system.nim' again for the real non-config stuff!
resetAllModulesHard() resetAllModulesHard()
vm.globalCtx = nil vm.globalCtx = nil
initDefines() # do not remove the defined symbols
#initDefines()
undefSymbol("nimscript")
undefSymbol("nimconfig")

View file

@ -4,4 +4,7 @@ discard """
msg: '''[NimScript] exec: gcc -v''' msg: '''[NimScript] exec: gcc -v'''
""" """
when not defined(definedefine):
{.fatal: "wrong nim script configuration".}
echo "hello world!" echo "hello world!"

View file

@ -10,5 +10,6 @@ task listDirs, "lists every subdirectory":
echo "DIR ", x echo "DIR ", x
task default, "default target": task default, "default target":
--define: definedefine
setCommand "c" setCommand "c"