diff options
author | Araq <rumpf_a@web.de> | 2013-04-13 21:55:02 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-04-13 21:55:02 +0200 |
commit | 75b508032b9da285f30d4ec7f2af4c63075b8611 (patch) | |
tree | 79476c0e8b7c70ee373bde21a2ea0a62d84520f8 /compiler | |
parent | 4f09794be9fb9b96728078712f01e990e0021929 (diff) | |
download | Nim-75b508032b9da285f30d4ec7f2af4c63075b8611.tar.gz |
added manyloc test suite; --path now relative to project dir if not absolute
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/commands.nim | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim index 8f8afe206..8b03dfec4 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -196,8 +196,10 @@ proc testCompileOption*(switch: string, info: TLineInfo): bool = of "patterns": result = contains(gOptions, optPatterns) else: InvalidCmdLineOption(passCmd1, switch, info) -proc processPath(path: string): string = - result = UnixToNativePath(path % ["nimrod", getPrefixDir(), "lib", libpath, +proc processPath(path: string, notRelativeToProj = false): string = + let p = if notRelativeToProj or os.isAbsolute(path) or '$' in path: path + else: options.gProjectPath / path + result = UnixToNativePath(p % ["nimrod", getPrefixDir(), "lib", libpath, "home", removeTrailingDirSep(os.getHomeDir()), "projectname", options.gProjectName, "projectpath", options.gProjectPath]) @@ -229,7 +231,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "babelpath": if pass in {passCmd2, passPP}: expectArg(switch, arg, pass, info) - let path = processPath(arg) + let path = processPath(arg, notRelativeToProj=true) babelpath(path, info) of "excludepath": expectArg(switch, arg, pass, info) @@ -451,9 +453,9 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "genscript": expectNoArg(switch, arg, pass, info) incl(gGlobalOptions, optGenScript) - of "lib": + of "lib": expectArg(switch, arg, pass, info) - libpath = processPath(arg) + libpath = processPath(arg, notRelativeToProj=true) of "putenv": expectArg(switch, arg, pass, info) splitSwitch(arg, key, val, pass, info) |