advopt.txt 9.6 KB

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