mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
NimScript: --define works as expected
This commit is contained in:
@@ -140,4 +140,7 @@ proc runNimScript*(scriptName: string) =
|
||||
# ensure we load 'system.nim' again for the real non-config stuff!
|
||||
resetAllModulesHard()
|
||||
vm.globalCtx = nil
|
||||
initDefines()
|
||||
# do not remove the defined symbols
|
||||
#initDefines()
|
||||
undefSymbol("nimscript")
|
||||
undefSymbol("nimconfig")
|
||||
|
||||
@@ -4,4 +4,7 @@ discard """
|
||||
msg: '''[NimScript] exec: gcc -v'''
|
||||
"""
|
||||
|
||||
when not defined(definedefine):
|
||||
{.fatal: "wrong nim script configuration".}
|
||||
|
||||
echo "hello world!"
|
||||
|
||||
@@ -10,5 +10,6 @@ task listDirs, "lists every subdirectory":
|
||||
echo "DIR ", x
|
||||
|
||||
task default, "default target":
|
||||
--define: definedefine
|
||||
setCommand "c"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user