mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 21:17:48 +00:00
Uses XDG_CACHE_HOME if available (#8585)
* compiler/options: use XDG_CACHE_HOME if set * doc/nimc: update documentation
This commit is contained in:
@@ -482,7 +482,7 @@ include packagehandling
|
||||
|
||||
proc getOsCacheDir(): string =
|
||||
when defined(posix):
|
||||
result = getHomeDir() / ".cache"
|
||||
result = string getEnv("XDG_CACHE_HOME", getHomeDir() / ".cache")
|
||||
else:
|
||||
result = getHomeDir() / genSubDir
|
||||
|
||||
|
||||
@@ -159,7 +159,8 @@ Generated C code directory
|
||||
The generated files that Nim produces all go into a subdirectory called
|
||||
``nimcache``. Its full path is
|
||||
|
||||
- ``~/.cache/$projectname(_r|_d)`` on Posix
|
||||
- ``$XDG_CACHE_HOME/$projectname(_r|_d)`` or ``~/.cache/$projectname(_r|_d)``
|
||||
on Posix
|
||||
- ``$HOME/nimcache/$projectname(_r|_d)`` on Windows.
|
||||
|
||||
The ``_r`` suffix is used for release builds, ``_d`` is for debug builds.
|
||||
|
||||
Reference in New Issue
Block a user