advopt.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. //rst2tex convert a reStructuredText file to TeX
  9. //jsondoc extract the documentation to a json file
  10. //ctags create a tags file
  11. //buildIndex build an index for the whole documentation
  12. //genDepend generate a DOT file containing the
  13. module dependency graph
  14. //dump dump all defined conditionals and search paths
  15. see also: --dump.format:json (useful with: ` | jq`)
  16. //check checks the project for syntax and semantic
  17. Runtime checks (see -x):
  18. --objChecks:on|off turn obj conversion checks on|off
  19. --fieldChecks:on|off turn case variant field checks on|off
  20. --rangeChecks:on|off turn range checks on|off
  21. --boundChecks:on|off turn bound checks on|off
  22. --overflowChecks:on|off turn int over-/underflow checks on|off
  23. --floatChecks:on|off turn all floating point (NaN/Inf) checks on|off
  24. --nanChecks:on|off turn NaN checks on|off
  25. --infChecks:on|off turn Inf checks on|off
  26. --nilChecks:on|off turn nil 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. --stdout:on|off output to stdout
  32. --colors:on|off turn compiler messages coloring on|off
  33. --listFullPaths:on|off list full paths in messages
  34. -w:on|off|list, --warnings:on|off|list
  35. turn all warnings on|off or list all available
  36. --warning[X]:on|off turn specific warning X on|off
  37. --hints:on|off|list turn all hints on|off or list all available
  38. --hint[X]:on|off turn specific hint X on|off
  39. --styleCheck:off|hint|error
  40. produce hints or errors for Nim identifiers that
  41. do not adhere to Nim's official style guide
  42. https://nim-lang.org/docs/nep1.html
  43. --showAllMismatches:on|off
  44. show all mismatching candidates in overloading
  45. resolution
  46. --lib:PATH set the system library path
  47. --import:PATH add an automatically imported module
  48. --include:PATH add an automatically included module
  49. --nimcache:PATH set the path used for generated files
  50. -c, --compileOnly:on|off compile Nim files only; do not assemble or link
  51. --noLinking:on|off compile Nim and generated files but do not link
  52. --noMain:on|off do not generate a main procedure
  53. --genScript:on|off generate a compile script (in the 'nimcache'
  54. subdirectory named 'compile_$$project$$scriptext'),
  55. implies --compileOnly
  56. --genDeps:on|off generate a '.deps' file containing the dependencies
  57. --os:SYMBOL set the target operating system (cross-compilation)
  58. --cpu:SYMBOL set the target processor (cross-compilation)
  59. --debuginfo:on|off enables debug information
  60. -t, --passC:OPTION pass an option to the C compiler
  61. -l, --passL:OPTION pass an option to the linker
  62. --cincludes:DIR modify the C compiler header search path
  63. --clibdir:DIR modify the linker library search path
  64. --clib:LIBNAME link an additional C library
  65. (you should omit platform-specific extensions)
  66. --project document the whole project (doc2)
  67. --docSeeSrcUrl:url activate 'see source' for doc and doc2 commands
  68. (see doc.item.seesrc in config/nimdoc.cfg)
  69. --docInternal also generate documentation for non-exported symbols
  70. --lineDir:on|off generation of #line directive on|off
  71. --embedsrc:on|off embeds the original source code as comments
  72. in the generated output
  73. --threadanalysis:on|off turn thread analysis on|off
  74. --tlsEmulation:on|off turn thread local storage emulation on|off
  75. --taintMode:on|off turn taint mode on|off
  76. --implicitStatic:on|off turn implicit compile time evaluation on|off
  77. --trmacros:on|off turn term rewriting macros on|off
  78. --multimethods:on|off turn multi-methods on|off
  79. --memTracker:on|off turn memory tracker on|off
  80. --hotCodeReloading:on|off
  81. turn support for hot code reloading on|off
  82. --excessiveStackTrace:on|off
  83. stack traces use full file paths
  84. --oldNewlines:on|off turn on|off the old behaviour of "\n"
  85. --laxStrings:on|off when turned on, accessing the zero terminator in
  86. strings is allowed; only for backwards compatibility
  87. --nilseqs:on|off allow 'nil' for strings/seqs for
  88. backwards compatibility
  89. --oldast:on|off use old AST for backwards compatibility
  90. --skipCfg:on|off do not read the nim installation's configuration file
  91. --skipUserCfg:on|off do not read the user's configuration file
  92. --skipParentCfg:on|off do not read the parent dirs' configuration files
  93. --skipProjCfg:on|off do not read the project's configuration file
  94. --gc:refc|markAndSweep|boehm|go|none|regions
  95. select the GC to use; default is 'refc'
  96. --index:on|off turn index file generation on|off
  97. --putenv:key=value set an environment variable
  98. --NimblePath:PATH add a path for Nimble support
  99. --noNimblePath deactivate the Nimble path
  100. --noCppExceptions use default exception handling with C++ backend
  101. --cppCompileToNamespace:namespace
  102. use the provided namespace for the generated C++ code,
  103. if no namespace is provided "Nim" will be used
  104. --expandMacro:MACRO dump every generated AST from MACRO
  105. --excludePath:PATH exclude a path from the list of search paths
  106. --dynlibOverride:SYMBOL marks SYMBOL so that dynlib:SYMBOL
  107. has no effect and can be statically linked instead;
  108. symbol matching is fuzzy so
  109. that --dynlibOverride:lua matches
  110. dynlib: "liblua.so.3"
  111. --dynlibOverrideAll
  112. disables the effects of the dynlib pragma
  113. --listCmd list the commands used to execute external programs
  114. --parallelBuild:0|1|... perform a parallel build
  115. value = number of processors (0 for auto-detect)
  116. --incremental:on|off only recompile the changed modules (experimental!)
  117. --verbosity:0|1|2|3 set Nim's verbosity level (1 is default)
  118. --errorMax:N stop compilation after N errors; 0 means unlimited
  119. --experimental:$1
  120. enable experimental language feature
  121. --legacy:$2
  122. enable obsolete/legacy language feature
  123. legacy code.
  124. --newruntime use an alternative runtime that uses destructors
  125. and that uses a shared heap via -d:useMalloc
  126. --profiler:on|off enable profiling; requires `import nimprof`, and
  127. works better with `--stackTrace:on`
  128. see also https://nim-lang.github.io/Nim/estp.html