diff options
author | Araq <rumpf_a@web.de> | 2015-09-03 14:11:33 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-09-03 14:30:11 +0200 |
commit | a373bdd0c973fd1db2ab988aea8bcfc3d8dd4245 (patch) | |
tree | 3572b008f7fe36a6dfd40f0156de3f74f8a40e86 /compiler/options.nim | |
parent | e90c15526082d0b5f644c3d92b0f34353eb884b7 (diff) | |
download | Nim-a373bdd0c973fd1db2ab988aea8bcfc3d8dd4245.tar.gz |
improvements for NimScript support
Diffstat (limited to 'compiler/options.nim')
-rw-r--r-- | compiler/options.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/options.nim b/compiler/options.nim index 1f167e2a6..adb340fea 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -191,6 +191,17 @@ proc getPrefixDir*(): string = else: result = splitPath(getAppDir()).head +proc setDefaultLibpath*() = + # set default value (can be overwritten): + if libpath == "": + # choose default libpath: + var prefix = getPrefixDir() + when defined(posix): + if prefix == "/usr": libpath = "/usr/lib/nim" + elif prefix == "/usr/local": libpath = "/usr/local/lib/nim" + else: libpath = joinPath(prefix, "lib") + else: libpath = joinPath(prefix, "lib") + proc canonicalizePath*(path: string): string = when not FileSystemCaseSensitive: result = path.expandFilename.toLower else: result = path.expandFilename |