summary refs log tree commit diff stats
path: root/compiler/commands.nim
diff options
context:
space:
mode:
authorGiovanni <sinkingsugar@gmail.com>2018-09-15 20:06:26 +0900
committerGiovanni <sinkingsugar@gmail.com>2018-09-15 20:10:54 +0900
commitf1b64e4b96bc943d194e2e107b59b1c74cde911e (patch)
tree444a5b56bd479138bebe27098a5d05a199d188bc /compiler/commands.nim
parent4342b79a3c05fcfb1e6fc97152daa0075b0b9603 (diff)
downloadNim-f1b64e4b96bc943d194e2e107b59b1c74cde911e.tar.gz
improve the compiler option "cppCompileToNamespace", a custom namespace can now be set
Diffstat (limited to 'compiler/commands.nim')
-rw-r--r--compiler/commands.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index fe820a589..0b3bc1b2d 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -735,7 +735,11 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
   of "nep1":
     processOnOffSwitchG(conf, {optCheckNep1}, arg, pass, info)
   of "cppcompiletonamespace":
-    expectNoArg(conf, switch, arg, pass, info)
+    if conf != nil:
+      if arg != "":
+        conf.cppCustomNamespace = arg
+      else:
+        conf.cppCustomNamespace = "Nim"
     incl conf.globalOptions, optUseNimNamespace
     defineSymbol(conf.symbols, "cppCompileToNamespace")
   else: