summary refs log tree commit diff stats
path: root/compiler/commands.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/commands.nim')
-rw-r--r--compiler/commands.nim12
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 0b3bc1b2d..39967c4bc 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -735,13 +735,11 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
   of "nep1":
     processOnOffSwitchG(conf, {optCheckNep1}, arg, pass, info)
   of "cppcompiletonamespace":
-    if conf != nil:
-      if arg != "":
-        conf.cppCustomNamespace = arg
-      else:
-        conf.cppCustomNamespace = "Nim"
-    incl conf.globalOptions, optUseNimNamespace
-    defineSymbol(conf.symbols, "cppCompileToNamespace")
+    if arg.len > 0:
+      conf.cppCustomNamespace = arg
+    else:
+      conf.cppCustomNamespace = "Nim"
+    defineSymbol(conf.symbols, "cppCompileToNamespace", conf.cppCustomNamespace)
   else:
     if strutils.find(switch, '.') >= 0: options.setConfigVar(conf, switch, arg)
     else: invalidCmdLineOption(conf, pass, switch, info)