summary refs log tree commit diff stats
path: root/compiler/commands.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-30 19:54:26 +0200
committerGitHub <noreply@github.com>2016-07-30 19:54:26 +0200
commit904e17b094b3638a8f12a62c1afe1a53cb8bd609 (patch)
treeba6b1dde2169d4d41ca752b099e7128570fba16d /compiler/commands.nim
parentdfee2bf66e80c950b7aa2be62dc0deab74aa56e7 (diff)
parent70ea30d492ce038ae36dcceffece09c0b074721c (diff)
downloadNim-904e17b094b3638a8f12a62c1afe1a53cb8bd609.tar.gz
Merge pull request #4544 from miere43/fix-4417-n
fix #4417 (new)
Diffstat (limited to 'compiler/commands.nim')
-rw-r--r--compiler/commands.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 48926f602..de1197292 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -217,6 +217,15 @@ proc testCompileOptionArg*(switch, arg: string, info: TLineInfo): bool =
     of "none": result = gOptions * {optOptimizeSpeed, optOptimizeSize} == {}
     else: localError(info, errNoneSpeedOrSizeExpectedButXFound, arg)
   of "verbosity": result = $gVerbosity == arg
+  of "app":
+    case arg.normalize
+    of "gui":       result = contains(gGlobalOptions, optGenGuiApp)
+    of "console":   result = not contains(gGlobalOptions, optGenGuiApp)
+    of "lib":       result = contains(gGlobalOptions, optGenDynLib) and
+                      not contains(gGlobalOptions, optGenGuiApp)
+    of "staticlib": result = contains(gGlobalOptions, optGenStaticLib) and
+                      not contains(gGlobalOptions, optGenGuiApp)
+    else: localError(info, errGuiConsoleOrLibExpectedButXFound, arg)
   else: invalidCmdLineOption(passCmd1, switch, info)
 
 proc testCompileOption*(switch: string, info: TLineInfo): bool =