advopt.txt 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. Advanced commands:
  2. //compileToC, cc compile project with C code generator
  3. //compileToCpp, cpp compile project to C++ code
  4. //compileToOC, objc compile project to Objective C code
  5. //js compile project to Javascript
  6. //e run a Nimscript file
  7. //rst2html convert a reStructuredText file to HTML
  8. use `--docCmd:skip` to skip compiling snippets
  9. //rst2tex convert a reStructuredText file to TeX
  10. //jsondoc extract the documentation to a json file
  11. //ctags create a tags file
  12. //buildIndex build an index for the whole documentation
  13. //genDepend generate a DOT file containing the
  14. module dependency graph
  15. //dump dump all defined conditionals and search paths
  16. see also: --dump.format:json (useful with: `| jq`)
  17. //check checks the project for syntax and semantic
  18. Runtime checks (see -x):
  19. --objChecks:on|off turn obj conversion checks on|off
  20. --fieldChecks:on|off turn case variant field checks on|off
  21. --rangeChecks:on|off turn range checks on|off
  22. --boundChecks:on|off turn bound checks on|off
  23. --overflowChecks:on|off turn int over-/underflow checks on|off
  24. --floatChecks:on|off turn all floating point (NaN/Inf) checks on|off
  25. --nanChecks:on|off turn NaN checks on|off
  26. --infChecks:on|off turn Inf checks on|off
  27. --refChecks:on|off turn ref checks on|off (only for --newruntime)
  28. Advanced options:
  29. -o:FILE, --out:FILE set the output filename
  30. --outdir:DIR set the path where the output file will be written
  31. --usenimcache will use `outdir=$$nimcache`, whichever it resolves
  32. to after all options have been processed
  33. --stdout:on|off output to stdout
  34. --colors:on|off turn compiler messages coloring on|off
  35. --listFullPaths:on|off list full paths in messages
  36. --declaredLocs:on|off show declaration locations in messages
  37. -w:on|off|list, --warnings:on|off|list
  38. turn all warnings on|off or list all available
  39. --warning[X]:on|off turn specific warning X on|off
  40. --hints:on|off|list turn all hints on|off or list all available
  41. --hint[X]:on|off turn specific hint X on|off
  42. --warningAsError[X]:on|off
  43. turn specific warning X into an error on|off
  44. --styleCheck:off|hint|error
  45. produce hints or errors for Nim identifiers that
  46. do not adhere to Nim's official style guide
  47. https://nim-lang.org/docs/nep1.html
  48. --showAllMismatches:on|off
  49. show all mismatching candidates in overloading
  50. resolution
  51. --lib:PATH set the system library path
  52. --import:PATH add an automatically imported module
  53. see also `patchFile` in nimscript which offers more flexibility.
  54. --include:PATH add an automatically included module
  55. --nimcache:PATH set the path used for generated files
  56. see also https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory
  57. -c, --compileOnly:on|off compile Nim files only; do not assemble or link
  58. --noLinking:on|off compile Nim and generated files but do not link
  59. --noMain:on|off do not generate a main procedure
  60. --genScript:on|off generate a compile script (in the 'nimcache'
  61. subdirectory named 'compile_$$project$$scriptext'),
  62. implies --compileOnly
  63. --genDeps:on|off generate a '.deps' file containing the dependencies
  64. --os:SYMBOL set the target operating system (cross-compilation)
  65. --cpu:SYMBOL set the target processor (cross-compilation)
  66. --debuginfo:on|off enables debug information
  67. -t, --passC:OPTION pass an option to the C compiler
  68. -l, --passL:OPTION pass an option to the linker
  69. --cc:SYMBOL specify the C compiler
  70. --cincludes:DIR modify the C compiler header search path
  71. --clibdir:DIR modify the linker library search path
  72. --clib:LIBNAME link an additional C library
  73. (you should omit platform-specific extensions)
  74. --project document the whole project (doc2)
  75. --docRoot:path `nim doc --docRoot:/foo --project --outdir:docs /foo/sub/main.nim`
  76. generates: docs/sub/main.html
  77. if path == @pkg, will use nimble file enclosing dir
  78. if path == @path, will use first matching dir in `--path`
  79. if path == @default (the default and most useful), will use
  80. best match among @pkg,@path.
  81. if these are nonexistent, will use project path
  82. -b, --backend:c|cpp|js|objc sets backend to use with commands like `nim doc` or `nim r`
  83. --docCmd:cmd if `cmd == skip`, skips runnableExamples
  84. else, runs runnableExamples with given options, e.g.:
  85. `--docCmd:"-d:foo --threads:on"`
  86. --docSeeSrcUrl:url activate 'see source' for doc and doc2 commands
  87. (see doc.item.seesrc in config/nimdoc.cfg)
  88. --docInternal also generate documentation for non-exported symbols
  89. --lineDir:on|off generation of #line directive on|off
  90. --embedsrc:on|off embeds the original source code as comments
  91. in the generated output
  92. --threadanalysis:on|off turn thread analysis on|off
  93. --tlsEmulation:on|off turn thread local storage emulation on|off
  94. --taintMode:on|off turn taint mode on|off
  95. --implicitStatic:on|off turn implicit compile time evaluation on|off
  96. --trmacros:on|off turn term rewriting macros on|off
  97. --multimethods:on|off turn multi-methods on|off
  98. --memTracker:on|off turn memory tracker on|off
  99. --hotCodeReloading:on|off
  100. turn support for hot code reloading on|off
  101. --excessiveStackTrace:on|off
  102. stack traces use full file paths
  103. --stackTraceMsgs:on|off enable user defined stack frame msgs via `setFrameMsg`
  104. --nilseqs:on|off allow 'nil' for strings/seqs for
  105. backwards compatibility
  106. --seqsv2:on|off use the new string/seq implementation based on
  107. destructors
  108. --skipCfg:on|off do not read the nim installation's configuration file
  109. --skipUserCfg:on|off do not read the user's configuration file
  110. --skipParentCfg:on|off do not read the parent dirs' configuration files
  111. --skipProjCfg:on|off do not read the project's configuration file
  112. --gc:refc|arc|orc|markAndSweep|boehm|go|none|regions
  113. select the GC to use; default is 'refc'
  114. --exceptions:setjmp|cpp|goto
  115. select the exception handling implementation
  116. --index:on|off turn index file generation on|off
  117. --putenv:key=value set an environment variable
  118. --NimblePath:PATH add a path for Nimble support
  119. --noNimblePath deactivate the Nimble path
  120. --clearNimblePath empty the list of Nimble package search paths
  121. --cppCompileToNamespace:namespace
  122. use the provided namespace for the generated C++ code,
  123. if no namespace is provided "Nim" will be used
  124. --expandMacro:MACRO dump every generated AST from MACRO
  125. --expandArc:PROCNAME show how PROCNAME looks like after diverse optimizations
  126. before the final backend phase (mostly ARC/ORC specific)
  127. --excludePath:PATH exclude a path from the list of search paths
  128. --dynlibOverride:SYMBOL marks SYMBOL so that dynlib:SYMBOL
  129. has no effect and can be statically linked instead;
  130. symbol matching is fuzzy so
  131. that --dynlibOverride:lua matches
  132. dynlib: "liblua.so.3"
  133. --dynlibOverrideAll
  134. disables the effects of the dynlib pragma
  135. --listCmd list the compilation commands; can be combined with
  136. `--hint:exec:on` and `--hint:link:on`
  137. --asm produce assembler code
  138. --parallelBuild:0|1|... perform a parallel build
  139. value = number of processors (0 for auto-detect)
  140. --incremental:on|off only recompile the changed modules (experimental!)
  141. --verbosity:0|1|2|3 set Nim's verbosity level (1 is default)
  142. --errorMax:N stop compilation after N errors; 0 means unlimited
  143. --maxLoopIterationsVM:N set max iterations for all VM loops
  144. --experimental:$1
  145. enable experimental language feature
  146. --legacy:$2
  147. enable obsolete/legacy language feature
  148. --useVersion:1.0 emulate Nim version X of the Nim compiler
  149. --profiler:on|off enable profiling; requires `import nimprof`, and
  150. works better with `--stackTrace:on`
  151. see also https://nim-lang.github.io/Nim/estp.html
  152. --benchmarkVM:on|off enable benchmarking of VM code with cpuTime()
  153. --profileVM:on|off enable compile time VM profiler
  154. --sinkInference:on|off en-/disable sink parameter inference (default: on)
  155. --panics:on|off turn panics into process terminations (default: off)
  156. --deepcopy:on|off enable 'system.deepCopy' for ``--gc:arc|orc``