diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-08-06 23:38:29 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-08-08 09:35:38 +0200 |
commit | ef9dd464668d08520bdcd549836b4a7551e3b601 (patch) | |
tree | b6ba4af47ae2ca12d49814050dcf6174300a711b /doc/nimc.rst | |
parent | 5b6b73f2a2b0087a800842e790e83b37be938b74 (diff) | |
download | Nim-ef9dd464668d08520bdcd549836b4a7551e3b601.tar.gz |
'nimcache' defaults to ~/.cache on Posix; cleaned up documentation
Diffstat (limited to 'doc/nimc.rst')
-rw-r--r-- | doc/nimc.rst | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/doc/nimc.rst b/doc/nimc.rst index 0939f67e8..277c88ec1 100644 --- a/doc/nimc.rst +++ b/doc/nimc.rst @@ -157,38 +157,27 @@ the first matching file is used. Generated C code directory -------------------------- The generated files that Nim produces all go into a subdirectory called -``nimcache`` in your project directory. This makes it easy to delete all +``nimcache``. Its full path is + +- ``~/.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. + +This makes it easy to delete all generated files. Files generated in this directory follow a naming logic which you can read about in the `Nim Backend Integration document <backends.html#nimcache-naming-logic>`_. +The ``--nimcache`` +`compiler switch <nimc.html#command-line-switches>`_ can be used to +to change the ``nimcache`` directory. + However, the generated C code is not platform independent. C code generated for Linux does not compile on Windows, for instance. The comment on top of the C file lists the OS, CPU and CC the file has been compiled for. -Compilation cache -================= - -**Warning**: The compilation cache is still highly experimental! - -The ``nimcache`` directory may also contain so called `rod`:idx: -or `symbol files`:idx:. These files are pre-compiled modules that are used by -the compiler to perform `incremental compilation`:idx:. This means that only -modules that have changed since the last compilation (or the modules depending -on them etc.) are re-compiled. However, per default no symbol files are -generated; use the ``--symbolFiles:on`` command line switch to activate them. - -Unfortunately due to technical reasons the ``--symbolFiles:on`` needs -to *aggregate* some generated C code. This means that the resulting executable -might contain some cruft even with dead code elimination. So -the final release build should be done with ``--symbolFiles:off``. - -Due to the aggregation of C code it is also recommended that each project -resides in its own directory so that the generated ``nimcache`` directory -is not shared between different projects. - - Compiler Selection ================== |