advopt.txt 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. (can be combined with --track and --defusages)
  19. Runtime checks (see -x):
  20. --objChecks:on|off turn obj conversion checks on|off
  21. --fieldChecks:on|off turn case variant field checks on|off
  22. --rangeChecks:on|off turn range checks on|off
  23. --boundChecks:on|off turn bound checks on|off
  24. --overflowChecks:on|off turn int over-/underflow checks on|off
  25. --floatChecks:on|off turn all floating point (NaN/Inf) checks on|off
  26. --nanChecks:on|off turn NaN checks on|off
  27. --infChecks:on|off turn Inf checks on|off
  28. Advanced options:
  29. --track:FILE,LINE,COL set the tracking position for (--defusages)
  30. --defusages find the definition and all usages of a symbol
  31. -o:FILE, --out:FILE set the output filename
  32. --outdir:DIR set the path where the output file will be written
  33. --usenimcache will use `outdir=$$nimcache`, whichever it resolves
  34. to after all options have been processed
  35. --stdout:on|off output to stdout
  36. --colors:on|off turn compiler messages coloring on|off
  37. --listFullPaths:on|off list full paths in messages
  38. --declaredLocs:on|off show declaration locations in messages
  39. --spellSuggest|:num show at most `num >= 0` spelling suggestions on typos.
  40. if `num` is not specified (or `auto`), return
  41. an implementation defined set of suggestions.
  42. -w:on|off|list, --warnings:on|off|list
  43. turn all warnings on|off or list all available
  44. --warning[X]:on|off turn specific warning X on|off
  45. --hints:on|off|list turn all hints on|off or list all available
  46. --hint[X]:on|off turn specific hint X on|off
  47. --warningAsError[X]:on|off
  48. turn specific warning X into an error on|off
  49. --hintAsError[X]:on|off turn specific hint X into an error on|off
  50. --styleCheck:off|hint|error
  51. produce hints or errors for Nim identifiers that
  52. do not adhere to Nim's official style guide
  53. https://nim-lang.org/docs/nep1.html
  54. --showAllMismatches:on|off
  55. show all mismatching candidates in overloading
  56. resolution
  57. --lib:PATH set the system library path
  58. --import:PATH add an automatically imported module
  59. see also `patchFile` in nimscript which offers more flexibility.
  60. --include:PATH add an automatically included module
  61. --nimcache:PATH set the path used for generated files
  62. see also https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory
  63. -c, --compileOnly:on|off compile Nim files only; do not assemble or link
  64. --noLinking:on|off compile Nim and generated files but do not link
  65. --noMain:on|off do not generate a main procedure
  66. --genScript:on|off generate a compile script (in the 'nimcache'
  67. subdirectory named 'compile_$$project$$scriptext'),
  68. and a '.deps' file containing the dependencies;
  69. implies --compileOnly
  70. --os:SYMBOL set the target operating system (cross-compilation)
  71. --cpu:SYMBOL set the target processor (cross-compilation)
  72. --debuginfo:on|off enables debug information
  73. -t, --passC:OPTION pass an option to the C compiler
  74. -l, --passL:OPTION pass an option to the linker
  75. --cc:SYMBOL specify the C compiler
  76. --cincludes:DIR modify the C compiler header search path
  77. --clibdir:DIR modify the linker library search path
  78. --clib:LIBNAME link an additional C library
  79. (you should omit platform-specific extensions)
  80. --project document the whole project (doc)
  81. --docRoot:path `nim doc --docRoot:/foo --project --outdir:docs /foo/sub/main.nim`
  82. generates: docs/sub/main.html
  83. if path == @pkg, will use nimble file enclosing dir
  84. if path == @path, will use first matching dir in `--path`
  85. if path == @default (the default and most useful), will use
  86. best match among @pkg,@path.
  87. if these are nonexistent, will use project path
  88. -b, --backend:c|cpp|js|objc
  89. sets backend to use with commands like `nim doc` or `nim r`
  90. --docCmd:cmd if `cmd == skip`, skips runnableExamples
  91. else, runs runnableExamples with given options, e.g.:
  92. `--docCmd:"-d:foo --threads:on"`
  93. --docSeeSrcUrl:url activate 'see source' for doc command
  94. (see doc.item.seesrc in config/nimdoc.cfg)
  95. --docInternal also generate documentation for non-exported symbols
  96. --lineDir:on|off generation of #line directive on|off
  97. --embedsrc:on|off embeds the original source code as comments
  98. in the generated output
  99. --tlsEmulation:on|off turn thread local storage emulation on|off
  100. --implicitStatic:on|off turn implicit compile time evaluation on|off
  101. --trmacros:on|off turn term rewriting macros on|off
  102. --multimethods:on|off turn multi-methods on|off
  103. --hotCodeReloading:on|off
  104. turn support for hot code reloading on|off
  105. --excessiveStackTrace:on|off
  106. stack traces use full file paths
  107. --stackTraceMsgs:on|off enable user defined stack frame msgs via `setFrameMsg`
  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|quirky
  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|1.2 emulate Nim version X of the Nim compiler, for testing
  149. --benchmarkVM:on|off turn benchmarking of VM code with cpuTime() on|off
  150. --profileVM:on|off turn compile time VM profiler on|off
  151. --sinkInference:on|off turn sink parameter inference on|off (default: on)
  152. --panics:on|off turn panics into process terminations (default: off)
  153. --deepcopy:on|off enable 'system.deepCopy' for ``--gc:arc|orc``