cValidAssemblers -> const set

Added assembler validity check
This commit is contained in:
rku
2015-08-10 12:02:49 +03:00
parent 43bfda057b
commit 6a7a44bbf2
2 changed files with 7 additions and 1 deletions

View File

@@ -368,7 +368,9 @@ var
cIncludes*: seq[string] = @[] # directories to search for included files
cLibs*: seq[string] = @[] # directories to search for lib files
cLinkedLibs*: seq[string] = @[] # libraries to link
cValidAssemblers* = @[asmFasm]
const
cValidAssemblers* = {asmFasm}
# implementation
@@ -567,6 +569,8 @@ proc getCompileCFileCmd*(cfilename: string, isExternal = false): string =
if c == ccNone:
rawMessage(errExternalAssemblerNotFound, "")
elif c notin cValidAssemblers:
rawMessage(errExternalAssemblerNotValid, customAssembler)
var options = cFileSpecificOptions(cfilename)
var exe = getConfigVar(c, ".exe")

View File

@@ -109,6 +109,7 @@ type
errGenericLambdaNotAllowed,
errCompilerDoesntSupportTarget,
errExternalAssemblerNotFound,
errExternalAssemblerNotValid,
errUser,
warnCannotOpenFile,
warnOctalEscape, warnXIsNeverRead, warnXmightNotBeenInit,
@@ -372,6 +373,7 @@ const
"of the generic paramers can be inferred from the expected signature.",
errCompilerDoesntSupportTarget: "The current compiler \'$1\' doesn't support the requested compilation target",
errExternalAssemblerNotFound: "External assembler not found",
errExternalAssemblerNotValid: "External assembler '$1' is not a valid assembler",
errUser: "$1",
warnCannotOpenFile: "cannot open \'$1\'",
warnOctalEscape: "octal escape sequences do not exist; leading zero is ignored",