the mainmodule option has effect only when no explicit module is given

This commit is contained in:
Zahary Karadjov
2013-01-28 00:26:49 +02:00
parent 81a3585872
commit 19e795e017
5 changed files with 11 additions and 12 deletions

View File

@@ -231,8 +231,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) =
options.outFile = arg
of "mainmodule", "m":
expectArg(switch, arg, pass, info)
gProjectName = arg
gProjectFull = gProjectPath / gProjectName
optMainModule = arg
of "define", "d":
expectArg(switch, arg, pass, info)
DefineSymbol(arg)

View File

@@ -382,15 +382,14 @@ proc CommandSuggest =
proc wantMainModule =
if gProjectFull.len == 0:
Fatal(gCmdLineInfo, errCommandExpectsFilename)
if optMainModule.len == 0:
Fatal(gCmdLineInfo, errCommandExpectsFilename)
else:
gProjectName = optMainModule
gProjectFull = gProjectPath / gProjectName
gProjectMainIdx = addFileExt(gProjectFull, nimExt).fileInfoIdx
var oss: PGenericSeq
proc dbgseqimp(x: PGenericSeq) {.cdecl.} =
oss = x
seqdbg = dbgseqimp
proc resetMemory =
resetCompilationLists()
ccgutils.resetCaches()

View File

@@ -99,7 +99,7 @@ var
gVerbosity*: int # how verbose the compiler is
gNumberOfProcessors*: int # number of processors
gWholeProject*: bool # for 'doc2': output any dependency
gEvalExpr*: string # expression for idetools --eval
gEvalExpr* = "" # expression for idetools --eval
gLastCmdTime*: float # when caas is enabled, we measure each command
gListFullPaths*: bool
@@ -124,6 +124,7 @@ var
gProjectPath* = "" # holds a path like /home/alice/projects/nimrod/compiler/
gProjectFull* = "" # projectPath/projectName
gProjectMainIdx*: int32 # the canonical path id of the main module
optMainModule* = "" # the main module that should be used for idetools commands
nimcacheDir* = ""
command* = "" # the main command (e.g. cc, check, scan, etc)
commandArgs*: seq[string] = @[] # any arguments after the main command

View File

@@ -81,7 +81,7 @@ const
# examined in the decref loop in collectCycles.
# XXX: not implemented yet as tests didn't show any improvement from this
MarkingSkipsAcyclicObjects = false
MarkingSkipsAcyclicObjects = true
# Acyclic objects can be safely ignored in the mark and scan phases,
# because they cannot contribute to the internal count.
# XXX: if we generate specialized `markCyclic` and `markAcyclic`

View File

@@ -1,6 +1,6 @@
discard """
file: "system.nim"
line: 669
line: 670
errormsg: "type mismatch"
"""