diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/lookups.nim | 2 | ||||
-rw-r--r-- | compiler/options.nim | 15 | ||||
-rw-r--r-- | compiler/sem.nim | 4 |
3 files changed, 16 insertions, 5 deletions
diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 87694988a..bab631e6f 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -11,7 +11,7 @@ import intsets, ast, astalgo, idents, semdata, types, msgs, options, - renderer, wordrecg, idgen, nimfix.prettybase, lineinfos, strutils + renderer, wordrecg, idgen, nimfix/prettybase, lineinfos, strutils proc ensureNoMissingOrUnusedSymbols(c: PContext; scope: PScope) diff --git a/compiler/options.nim b/compiler/options.nim index 598adf27d..4931b4330 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -354,6 +354,7 @@ proc isDefined*(conf: ConfigRef; symbol: string): bool = of "msdos": result = conf.target.targetOS == osDos of "mswindows", "win32": result = conf.target.targetOS == osWindows of "macintosh": result = conf.target.targetOS in {osMacos, osMacosx} + of "osx": result = conf.target.targetOS == osMacosx of "sunos": result = conf.target.targetOS == osSolaris of "nintendoswitch": result = conf.target.targetOS == osNintendoSwitch @@ -479,9 +480,19 @@ proc disableNimblePath*(conf: ConfigRef) = include packagehandling +proc getOsCacheDir(): string = + when defined(posix): + result = getHomeDir() / ".cache" + else: + result = getHomeDir() / genSubDir + proc getNimcacheDir*(conf: ConfigRef): string = - result = if conf.nimcacheDir.len > 0: conf.nimcacheDir - else: shortenDir(conf, conf.projectPath) / genSubDir + result = if conf.nimcacheDir.len > 0: + conf.nimcacheDir + elif conf.cmd == cmdCompileToJS: + shortenDir(conf, conf.projectPath) / genSubDir + else: getOsCacheDir() / conf.projectName & + (if isDefined(conf, "release"): "_r" else: "_d") proc pathSubs*(conf: ConfigRef; p, config: string): string = let home = removeTrailingDirSep(os.getHomeDir()) diff --git a/compiler/sem.nim b/compiler/sem.nim index 5d6e54604..427b44e04 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -16,12 +16,12 @@ import procfind, lookups, pragmas, passes, semdata, semtypinst, sigmatch, intsets, transf, vmdef, vm, idgen, aliases, cgmeth, lambdalifting, evaltempl, patterns, parampatterns, sempass2, linter, semmacrosanity, - semparallel, lowerings, pluginsupport, plugins.active, rod, lineinfos + semparallel, lowerings, pluginsupport, plugins/active, rod, lineinfos from modulegraphs import ModuleGraph when defined(nimfix): - import nimfix.prettybase + import nimfix/prettybase # implementation |