compilesettings.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <!-- This file is generated by Nim. -->
  4. <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>std/compilesettings</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  14. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">std/compilesettings</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <ul class="simple simple-toc" id="toc-list">
  49. <li>
  50. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  51. </li>
  52. <li>
  53. <details open>
  54. <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
  55. <ul class="simple simple-toc-section">
  56. <li><a class="reference" href="#MultipleValueSetting" title="MultipleValueSetting {.pure.} = enum
  57. nimblePaths, ## the nimble path(s)
  58. searchPaths, ## the search path for modules
  59. lazyPaths, ## experimental: even more paths
  60. commandArgs, ## the arguments passed to the Nim compiler
  61. cincludes, ## the #include paths passed to the C/C++ compiler
  62. clibs ## libraries passed to the C/C++ compiler">MultipleValueSetting</a></li>
  63. <li><a class="reference" href="#SingleValueSetting" title="SingleValueSetting {.pure.} = enum
  64. arguments, ## experimental: the arguments passed after '-r'
  65. outFile, ## experimental: the output file
  66. outDir, ## the output directory
  67. nimcacheDir, ## the location of the 'nimcache' directory
  68. projectName, ## the project's name that is being compiled
  69. projectPath, ## experimental: some path to the project that is being compiled
  70. projectFull, ## the full path to the project that is being compiled
  71. command, ## experimental: the command (e.g. 'c', 'cpp', 'doc') passed to
  72. ## the Nim compiler
  73. commandLine, ## experimental: the command line passed to Nim
  74. linkOptions, ## additional options passed to the linker
  75. compileOptions, ## additional options passed to the C/C++ compiler
  76. ccompilerPath, ## the path to the C/C++ compiler
  77. backend, ## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js`
  78. ## and `nim js` would imply backend=js
  79. libPath, ## the absolute path to the stdlib library, i.e. nim's `--lib`, since 1.5.1
  80. gc {.deprecated.}, ## gc selected
  81. mm ## memory management selected">SingleValueSetting</a></li>
  82. </ul>
  83. </details>
  84. </li>
  85. <li>
  86. <details open>
  87. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  88. <ul class="simple simple-toc-section">
  89. <ul class="simple nested-toc-section">querySetting
  90. <li><a class="reference" href="#querySetting%2CSingleValueSetting" title="querySetting(setting: SingleValueSetting): string">querySetting(setting: SingleValueSetting): string</a></li>
  91. </ul>
  92. <ul class="simple nested-toc-section">querySettingSeq
  93. <li><a class="reference" href="#querySettingSeq%2CMultipleValueSetting" title="querySettingSeq(setting: MultipleValueSetting): seq[string]">querySettingSeq(setting: MultipleValueSetting): seq[string]</a></li>
  94. </ul>
  95. </ul>
  96. </details>
  97. </li>
  98. </ul>
  99. </div>
  100. <div class="nine columns" id="content">
  101. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/compilesettings.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  102. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/compilesettings.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  103. <div id="tocRoot"></div>
  104. <p class="module-desc">This module allows querying the compiler about diverse configuration settings. See also <tt class="docutils literal"><span class="pre"><span class="Identifier">compileOption</span></span></tt>.</p>
  105. <div class="section" id="6">
  106. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  107. <dl class="item">
  108. <a class="reference external" href="assertions.html">assertions</a>
  109. </dl>
  110. </div>
  111. <div class="section" id="7">
  112. <h1><a class="toc-backref" href="#7">Types</a></h1>
  113. <dl class="item">
  114. <div id="MultipleValueSetting">
  115. <dt><pre><a href="compilesettings.html#MultipleValueSetting"><span class="Identifier">MultipleValueSetting</span></a> {.<span class="Identifier">pure</span>.} <span class="Other">=</span> <span class="Keyword">enum</span>
  116. <span class="Identifier">nimblePaths</span><span class="Other">,</span> <span class="Comment">## the nimble path(s)</span>
  117. <span class="Identifier">searchPaths</span><span class="Other">,</span> <span class="Comment">## the search path for modules</span>
  118. <span class="Identifier">lazyPaths</span><span class="Other">,</span> <span class="Comment">## experimental: even more paths</span>
  119. <span class="Identifier">commandArgs</span><span class="Other">,</span> <span class="Comment">## the arguments passed to the Nim compiler</span>
  120. <span class="Identifier">cincludes</span><span class="Other">,</span> <span class="Comment">## the #include paths passed to the C/C++ compiler</span>
  121. <span class="Identifier">clibs</span> <span class="Comment">## libraries passed to the C/C++ compiler</span></pre></dt>
  122. <dd>
  123. settings resulting in a seq of string values
  124. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/compilesettings.nim#L41" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  125. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/compilesettings.nim#L41" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  126. </dd>
  127. </div>
  128. <div id="SingleValueSetting">
  129. <dt><pre><a href="compilesettings.html#SingleValueSetting"><span class="Identifier">SingleValueSetting</span></a> {.<span class="Identifier">pure</span>.} <span class="Other">=</span> <span class="Keyword">enum</span>
  130. <span class="Identifier">arguments</span><span class="Other">,</span> <span class="Comment">## experimental: the arguments passed after '-r'</span>
  131. <span class="Identifier">outFile</span><span class="Other">,</span> <span class="Comment">## experimental: the output file</span>
  132. <span class="Identifier">outDir</span><span class="Other">,</span> <span class="Comment">## the output directory</span>
  133. <span class="Identifier">nimcacheDir</span><span class="Other">,</span> <span class="Comment">## the location of the 'nimcache' directory</span>
  134. <span class="Identifier">projectName</span><span class="Other">,</span> <span class="Comment">## the project's name that is being compiled</span>
  135. <span class="Identifier">projectPath</span><span class="Other">,</span> <span class="Comment">## experimental: some path to the project that is being compiled</span>
  136. <span class="Identifier">projectFull</span><span class="Other">,</span> <span class="Comment">## the full path to the project that is being compiled</span>
  137. <span class="Identifier">command</span><span class="Other">,</span> <span class="Comment">## experimental: the command (e.g. 'c', 'cpp', 'doc') passed to</span>
  138. <span class="Comment">## the Nim compiler</span>
  139. <span class="Identifier">commandLine</span><span class="Other">,</span> <span class="Comment">## experimental: the command line passed to Nim</span>
  140. <span class="Identifier">linkOptions</span><span class="Other">,</span> <span class="Comment">## additional options passed to the linker</span>
  141. <span class="Identifier">compileOptions</span><span class="Other">,</span> <span class="Comment">## additional options passed to the C/C++ compiler</span>
  142. <span class="Identifier">ccompilerPath</span><span class="Other">,</span> <span class="Comment">## the path to the C/C++ compiler</span>
  143. <span class="Identifier">backend</span><span class="Other">,</span> <span class="Comment">## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js`</span>
  144. <span class="Comment">## and `nim js` would imply backend=js</span>
  145. <span class="Identifier">libPath</span><span class="Other">,</span> <span class="Comment">## the absolute path to the stdlib library, i.e. nim's `--lib`, since 1.5.1</span>
  146. <span class="Identifier">gc</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span></span>.}<span class="Other">,</span> <span class="Comment">## gc selected</span>
  147. <span class="Identifier">mm</span> <span class="Comment">## memory management selected</span></pre></dt>
  148. <dd>
  149. settings resulting in a single string value
  150. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/compilesettings.nim#L20" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  151. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/compilesettings.nim#L20" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  152. </dd>
  153. </div>
  154. </dl>
  155. </div>
  156. <div class="section" id="12">
  157. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  158. <dl class="item">
  159. <div id="querySetting-procs-all">
  160. <div id="querySetting,SingleValueSetting">
  161. <dt><pre><span class="Keyword">proc</span> <a href="#querySetting%2CSingleValueSetting"><span class="Identifier">querySetting</span></a><span class="Other">(</span><span class="Identifier">setting</span><span class="Other">:</span> <a href="compilesettings.html#SingleValueSetting"><span class="Identifier">SingleValueSetting</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span class="Identifier">compileTime</span><span class="Other">,</span>
  162. <span class="Identifier">noSideEffect</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  163. <dd>
  164. <p>Can be used to get a string compile-time option.</p>
  165. <p>See also:</p>
  166. <ul class="simple"><li><a class="reference external" href="system.html#compileOption,string">compileOption</a> for <tt class="docutils literal"><span class="pre"><span class="Identifier">on</span><span class="Operator">|</span><span class="Identifier">off</span></span></tt> options</li>
  167. <li><a class="reference external" href="system.html#compileOption,string,string">compileOption</a> for enum options</li>
  168. </ul>
  169. <p><strong class="examples_text">Example:</strong></p>
  170. <pre class="listing"><span class="Keyword">const</span> <span class="Identifier">nimcache</span> <span class="Operator">=</span> <span class="Identifier">querySetting</span><span class="Punctuation">(</span><span class="Identifier">SingleValueSetting</span><span class="Operator">.</span><span class="Identifier">nimcacheDir</span><span class="Punctuation">)</span></pre>
  171. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/compilesettings.nim#L50" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  172. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/compilesettings.nim#L50" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  173. </dd>
  174. </div>
  175. </div>
  176. <div id="querySettingSeq-procs-all">
  177. <div id="querySettingSeq,MultipleValueSetting">
  178. <dt><pre><span class="Keyword">proc</span> <a href="#querySettingSeq%2CMultipleValueSetting"><span class="Identifier">querySettingSeq</span></a><span class="Other">(</span><span class="Identifier">setting</span><span class="Other">:</span> <a href="compilesettings.html#MultipleValueSetting"><span class="Identifier">MultipleValueSetting</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> {.<span class="Identifier">compileTime</span><span class="Other">,</span>
  179. <span class="Identifier">noSideEffect</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  180. <dd>
  181. <p>Can be used to get a multi-string compile-time option.</p>
  182. <p>See also:</p>
  183. <ul class="simple"><li><a class="reference external" href="system.html#compileOption,string">compileOption</a> for <tt class="docutils literal"><span class="pre"><span class="Identifier">on</span><span class="Operator">|</span><span class="Identifier">off</span></span></tt> options</li>
  184. <li><a class="reference external" href="system.html#compileOption,string,string">compileOption</a> for enum options</li>
  185. </ul>
  186. <p><strong class="examples_text">Example:</strong></p>
  187. <pre class="listing"><span class="Keyword">const</span> <span class="Identifier">nimblePaths</span> <span class="Operator">=</span> <span class="Identifier">querySettingSeq</span><span class="Punctuation">(</span><span class="Identifier">MultipleValueSetting</span><span class="Operator">.</span><span class="Identifier">nimblePaths</span><span class="Punctuation">)</span></pre>
  188. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/compilesettings.nim#L62" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  189. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/compilesettings.nim#L62" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  190. </dd>
  191. </div>
  192. </div>
  193. </dl>
  194. </div>
  195. </div>
  196. </div>
  197. <div class="twelve-columns footer">
  198. <span class="nim-sprite"></span>
  199. <br>
  200. <small style="color: var(--hint);">Made with Nim. Generated: 2025-02-03 14:57:21 UTC</small>
  201. </div>
  202. </div>
  203. </div>
  204. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  205. </body>
  206. </html>