Browse Source

fix mirror tags

ruki 5 years ago
parent
commit
a4190aa08a
68 changed files with 5766 additions and 5762 deletions
  1. 4 0
      build.lua
  2. 2 2
      mirror/about/awesome.html
  3. 20 20
      mirror/about/changelog.html
  4. 6 6
      mirror/about/sponsor.html
  5. 52 52
      mirror/getting_started.html
  6. 53 53
      mirror/guide/configuration.html
  7. 9 9
      mirror/guide/installation.html
  8. 86 86
      mirror/guide/other_features.html
  9. 186 186
      mirror/guide/project_examples.html
  10. 10 10
      mirror/guide/quickstart.html
  11. 135 135
      mirror/guide/syntax_description.html
  12. 268 268
      mirror/index.html
  13. 171 171
      mirror/manual/builtin_modules.html
  14. 29 29
      mirror/manual/builtin_variables.html
  15. 62 62
      mirror/manual/conditions.html
  16. 137 137
      mirror/manual/configuration_option.html
  17. 216 216
      mirror/manual/custom_rule.html
  18. 97 97
      mirror/manual/custom_toolchain.html
  19. 179 179
      mirror/manual/extension_modules.html
  20. 113 113
      mirror/manual/global_interfaces.html
  21. 18 18
      mirror/manual/package_dependencies.html
  22. 46 46
      mirror/manual/plugin_task.html
  23. 214 214
      mirror/manual/project_target.html
  24. 3 3
      mirror/manual/specification.html
  25. 297 297
      mirror/old/manual.html
  26. 70 70
      mirror/old/plugins.html
  27. 295 295
      mirror/old/zh/manual.html
  28. 72 72
      mirror/old/zh/plugins.html
  29. 3 3
      mirror/package/local_package.html
  30. 226 226
      mirror/package/remote_package.html
  31. 15 15
      mirror/package/system_package.html
  32. 78 78
      mirror/plugin/builtin_plugins.html
  33. 29 29
      mirror/plugin/more_plugins.html
  34. 9 9
      mirror/plugin/plugin_development.html
  35. 4 4
      mirror/theme/builtin_themes.html
  36. 1 1
      mirror/theme/switch_theme.html
  37. 0 0
      mirror/zh-cn/about/awesome.html
  38. 24 24
      mirror/zh-cn/about/changelog.html
  39. 6 6
      mirror/zh-cn/about/sponsor.html
  40. 52 52
      mirror/zh-cn/getting_started.html
  41. 53 53
      mirror/zh-cn/guide/configuration.html
  42. 11 11
      mirror/zh-cn/guide/installation.html
  43. 86 86
      mirror/zh-cn/guide/other_features.html
  44. 186 186
      mirror/zh-cn/guide/project_examples.html
  45. 10 10
      mirror/zh-cn/guide/quickstart.html
  46. 135 135
      mirror/zh-cn/guide/syntax_description.html
  47. 270 270
      mirror/zh-cn/index.html
  48. 173 173
      mirror/zh-cn/manual/builtin_modules.html
  49. 29 29
      mirror/zh-cn/manual/builtin_variables.html
  50. 63 63
      mirror/zh-cn/manual/conditions.html
  51. 127 127
      mirror/zh-cn/manual/configuration_option.html
  52. 217 217
      mirror/zh-cn/manual/custom_rule.html
  53. 97 97
      mirror/zh-cn/manual/custom_toolchain.html
  54. 179 179
      mirror/zh-cn/manual/extension_modules.html
  55. 112 112
      mirror/zh-cn/manual/global_interfaces.html
  56. 18 18
      mirror/zh-cn/manual/package_dependencies.html
  57. 46 46
      mirror/zh-cn/manual/plugin_task.html
  58. 212 212
      mirror/zh-cn/manual/project_target.html
  59. 3 3
      mirror/zh-cn/manual/specification.html
  60. 3 3
      mirror/zh-cn/package/local_package.html
  61. 229 229
      mirror/zh-cn/package/remote_package.html
  62. 15 15
      mirror/zh-cn/package/system_package.html
  63. 80 80
      mirror/zh-cn/plugin/builtin_plugins.html
  64. 29 29
      mirror/zh-cn/plugin/more_plugins.html
  65. 9 9
      mirror/zh-cn/plugin/plugin_development.html
  66. 4 4
      mirror/zh-cn/theme/builtin_themes.html
  67. 1 1
      mirror/zh-cn/theme/switch_theme.html
  68. 72 72
      sitemap.xml

+ 4 - 0
build.lua

@@ -161,6 +161,10 @@ function main()
             if f then
                 f:write(header(rawurl))
                 f:write(ads())
+                htmldata = htmldata:gsub("&%a-;", function (w) 
+                    local maps = {["&lt;"] = "<", ["&gt;"] = ">", ["&quot;"] = "\""}
+                    return maps[w]
+                end)
                 f:write(htmldata)
                 f:write(tailer())
                 f:close()

+ 2 - 2
mirror/about/awesome.html

@@ -90,10 +90,10 @@
   line-height: 1;
 }
 </style>
-    <p>&lt;div align=&quot;center&quot;&gt;<br>  &lt;a href=&quot;https://xmake.io&quot;&gt;<br>    &lt;img width=&quot;200&quot; heigth=&quot;200&quot; src=&quot;/assets/img/logo.svg&quot;&gt;<br>  &lt;/a&gt;<br><br>  &lt;h1&gt;awesome-xmake&lt;/h1&gt;<br><br>  &lt;div&gt;<br>    &lt;a href=&quot;https://github.com/xmake-io/xmake/releases&quot;&gt;<br>      &lt;img src=&quot;https://img.shields.io/github/release/tboox/xmake.svg?style=flat-square&quot; alt=&quot;Github All Releases&quot; /&gt;<br>    &lt;/a&gt;<br>    &lt;a href=&quot;https://github.com/xmake-io/xmake/blob/master/LICENSE.md&quot;&gt;<br>      &lt;img src=&quot;https://img.shields.io/github/license/tboox/xmake.svg?colorB=f48041&amp;style=flat-square&quot; alt=&quot;license&quot; /&gt;<br>    &lt;/a&gt;<br>    &lt;a href=&quot;https://www.reddit.com/r/tboox/&quot;&gt;<br>      &lt;img src=&quot;https://img.shields.io/badge/chat-on%20reddit-ff3f34.svg?style=flat-square&quot; alt=&quot;Reddit&quot; /&gt;<br>    &lt;/a&gt;<br>    &lt;a href=&quot;https://gitter.im/tboox/tboox?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge&quot;&gt;<br>      &lt;img src=&quot;https://img.shields.io/gitter/room/tboox/tboox.svg?style=flat-square&amp;colorB=96c312&quot; alt=&quot;Gitter&quot; /&gt;<br>    &lt;/a&gt;<br>    &lt;a href=&quot;https://t.me/tbooxorg&quot;&gt;<br>      &lt;img src=&quot;https://img.shields.io/badge/chat-on%20telegram-blue.svg?style=flat-square&quot; alt=&quot;Telegram&quot; /&gt;<br>    &lt;/a&gt;<br>    &lt;a href=&quot;https://jq.qq.com/?_wv=1027&amp;k=5hpwWFv&quot;&gt;<br>      &lt;img src=&quot;https://img.shields.io/badge/chat-on%20QQ-ff69b4.svg?style=flat-square&quot; alt=&quot;QQ&quot; /&gt;<br>    &lt;/a&gt;<br>    &lt;a href=&quot;http://xmake.io/pages/donation.html#donate&quot;&gt;<br>      &lt;img src=&quot;https://img.shields.io/badge/donate-us-orange.svg?style=flat-square&quot; alt=&quot;Donate&quot; /&gt;<br>    &lt;/a&gt;<br>  &lt;/div&gt;
+    <p><div align="center"><br>  <a href="https://xmake.io"><br>    <img width="200" heigth="200" src="/assets/img/logo.svg"><br>  </a><br><br>  <h1>awesome-xmake</h1><br><br>  <div><br>    <a href="https://github.com/xmake-io/xmake/releases"><br>      <img src="https://img.shields.io/github/release/tboox/xmake.svg?style=flat-square" alt="Github All Releases" /><br>    </a><br>    <a href="https://github.com/xmake-io/xmake/blob/master/LICENSE.md"><br>      <img src="https://img.shields.io/github/license/tboox/xmake.svg?colorB=f48041&amp;style=flat-square" alt="license" /><br>    </a><br>    <a href="https://www.reddit.com/r/tboox/"><br>      <img src="https://img.shields.io/badge/chat-on%20reddit-ff3f34.svg?style=flat-square" alt="Reddit" /><br>    </a><br>    <a href="https://gitter.im/tboox/tboox?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge"><br>      <img src="https://img.shields.io/gitter/room/tboox/tboox.svg?style=flat-square&amp;colorB=96c312" alt="Gitter" /><br>    </a><br>    <a href="https://t.me/tbooxorg"><br>      <img src="https://img.shields.io/badge/chat-on%20telegram-blue.svg?style=flat-square" alt="Telegram" /><br>    </a><br>    <a href="https://jq.qq.com/?_wv=1027&amp;k=5hpwWFv"><br>      <img src="https://img.shields.io/badge/chat-on%20QQ-ff69b4.svg?style=flat-square" alt="QQ" /><br>    </a><br>    <a href="http://xmake.io/pages/donation.html#donate"><br>      <img src="https://img.shields.io/badge/donate-us-orange.svg?style=flat-square" alt="Donate" /><br>    </a><br>  </div>
 
 </p>
-<p>  &lt;p&gt;A curated list of awesome XMake projects, plugins, examples and others&lt;/p&gt;<br>&lt;/div&gt;</p>
+<p>  <p>A curated list of awesome XMake projects, plugins, examples and others</p><br></div></p>
 <h2 id="examples">Examples</h2>
 <ul>
 <li><a href="https://xmake.io/#/home?id=executable-program">Executable Program</a></li>

+ 20 - 20
mirror/about/changelog.html

@@ -102,7 +102,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/828">#828</a>: Support to import sub-directory files for protobuf rules</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/835">#835</a>: Improve mode.minsizerel to add /GL flags for msvc</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/828">#828</a>: Support multi-level directories for protobuf/import</li>
-<li><a href="https://github.com/xmake-io/xmake/issues/838#issuecomment-643570920">#838</a>: Support to override builtin-rules for <code>add_files(&quot;src/*.c&quot;, {rules = {&quot;xx&quot;, override = true}})</code></li>
+<li><a href="https://github.com/xmake-io/xmake/issues/838#issuecomment-643570920">#838</a>: Support to override builtin-rules for <code>add_files("src/*.c", {rules = {"xx", override = true}})</code></li>
 <li><a href="https://github.com/xmake-io/xmake/issues/847">#847</a>: Support to parse include deps for rc file</li>
 <li>Improve msvc tool chain, remove the dependence of global environment variables</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/857">#857</a>: Improved <code>set_toolchains()</code> when cross-compilation is supported, specific target can be switched to host toolchain and compiled at the same time</li>
@@ -178,7 +178,7 @@
 <h2 id="v2-3-1">v2.3.1</h2>
 <h3 id="new-features">New features</h3>
 <ul>
-<li><a href="https://github.com/xmake-io/xmake/issues/675">#675</a>: Support to compile <code>*.c</code> as c++, <code>add_files(&quot;*.c&quot;, {sourcekind = &quot;cxx&quot;})</code>.</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/675">#675</a>: Support to compile <code>*.c</code> as c++, <code>add_files("*.c", {sourcekind = "cxx"})</code>.</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/681">#681</a>: Support compile xmake on msys/cygwin and add msys/cygwin platform</li>
 <li>Add socket/pipe io modules and support to schedule socket/process/pipe in coroutine</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/192">#192</a>: Try building project with the third-party buildsystem</li>
@@ -257,7 +257,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/440">#440</a>: Add <code>set_rundir()</code> and <code>add_runenvs()</code> api for target/run</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/443">#443</a>: Add tab completion support</li>
 <li>Add <code>on_link</code>, <code>before_link</code> and <code>after_link</code> for rule and target</li>
-<li><a href="https://github.com/xmake-io/xmake/issues/190">#190</a>: Add <code>add_rules(&quot;lex&quot;, &quot;yacc&quot;)</code> rules to support lex/yacc projects</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/190">#190</a>: Add <code>add_rules("lex", "yacc")</code> rules to support lex/yacc projects</li>
 </ul>
 <h3 id="changes">Changes</h3>
 <ul>
@@ -300,7 +300,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/318">#318</a>: Add <code>add_installfiles</code> api to target</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/339">#339</a>: Improve <code>add_requires</code> and <code>find_package</code> to integrate the 3rd package manager</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/327">#327</a>: Integrate with Conan package manager </li>
-<li>Add the builtin api <code>find_packages(&quot;pcre2&quot;, &quot;zlib&quot;)</code> to find multiple packages</li>
+<li>Add the builtin api <code>find_packages("pcre2", "zlib")</code> to find multiple packages</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/320">#320</a>: Add template configuration files and replace all variables before building</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/179">#179</a>: Generate CMakelist.txt file for <code>xmake project</code> plugin</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/361">#361</a>: Support vs2019 preview</li>
@@ -318,8 +318,8 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/322">#322</a>: Add <code>option.add_features</code>, <code>option.add_cxxsnippets</code> and <code>option.add_csnippets</code></li>
 <li>Remove some deprecated interfaces of xmake 1.x, e.g. <code>add_option_xxx</code></li>
 <li><a href="https://github.com/xmake-io/xmake/issues/327">#327</a>: Support conan package manager for <code>lib.detect.find_package</code> </li>
-<li>Improve <code>lib.detect.find_package</code> and add builtin <code>find_packages(&quot;zlib 1.x&quot;, &quot;openssl&quot;, {xxx = ...})</code> api</li>
-<li>Mark <code>set_modes()</code> as deprecated, we use <code>add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)</code> instead of it</li>
+<li>Improve <code>lib.detect.find_package</code> and add builtin <code>find_packages("zlib 1.x", "openssl", {xxx = ...})</code> api</li>
+<li>Mark <code>set_modes()</code> as deprecated, we use <code>add_rules("mode.debug", "mode.release")</code> instead of it</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/353">#353</a>: Improve <code>target:set</code>, <code>target:add</code> and add <code>target:del</code> to modify target configuration</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/356">#356</a>: Add <code>qt_add_static_plugins()</code> api to support static Qt sdk</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/351">#351</a>: Support yasm for generating vs201x project</li>
@@ -327,7 +327,7 @@
 </ul>
 <h3 id="bugs-fixed">Bugs fixed</h3>
 <ul>
-<li>Fix cannot call <code>set_optimize()</code> to set optimization flags when exists <code>add_rules(&quot;mode.release&quot;)</code></li>
+<li>Fix cannot call <code>set_optimize()</code> to set optimization flags when exists <code>add_rules("mode.release")</code></li>
 <li><a href="https://github.com/xmake-io/xmake/issues/289">#289</a>: Fix unarchive gzip file failed on windows</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/296">#296</a>: Fix <code>option.add_includedirs</code> for cuda</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/321">#321</a>: Fix find program bug with $PATH envirnoment</li>
@@ -355,7 +355,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/269">#269</a>: Clean up the temporary files at last 30 days</li>
 <li>Improve remote package manager</li>
 <li>Support to add packages with only header file</li>
-<li>Support to modify builtin package links, e.g. <code>add_packages(&quot;xxx&quot;, {links = {}})</code></li>
+<li>Support to modify builtin package links, e.g. <code>add_packages("xxx", {links = {}})</code></li>
 </ul>
 <h3 id="bugs-fixed">Bugs fixed</h3>
 <ul>
@@ -369,7 +369,7 @@
 <li>Add <code>set_config</code> to set the default configuration</li>
 <li>Add <code>$xmake --try</code> to try building project using third-party buildsystem</li>
 <li>Add <code>set_enabled(false)</code> to disable target </li>
-<li><a href="https://github.com/xmake-io/xmake/issues/69">#69</a>: Add remote package management, <code>add_requires(&quot;tbox ~1.6.1&quot;)</code></li>
+<li><a href="https://github.com/xmake-io/xmake/issues/69">#69</a>: Add remote package management, <code>add_requires("tbox ~1.6.1")</code></li>
 <li><a href="https://github.com/xmake-io/xmake/pull/216">#216</a>: Add windows mfc rules</li>
 </ul>
 <h3 id="changes">Changes</h3>
@@ -407,7 +407,7 @@
 <h3 id="changes">Changes</h3>
 <ul>
 <li>Add FAQ to the auto-generated xmake.lua</li>
-<li>Support android NDK &gt;= r14</li>
+<li>Support android NDK >= r14</li>
 <li>Improve warning flags for swiftc</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/167">#167</a>: Improve custom rules</li>
 <li>Improve <code>os.files</code> and <code>os.dirs</code> api</li>
@@ -425,7 +425,7 @@
 <h3 id="new-features">New features</h3>
 <ul>
 <li>Add <code>del_files()</code> api to delete files in the files list</li>
-<li>Add <code>rule()</code>, <code>add_rules()</code> api to implement the custom build rule and improve <code>add_files(&quot;src/*.md&quot;, {rule = &quot;markdown&quot;})</code></li>
+<li>Add <code>rule()</code>, <code>add_rules()</code> api to implement the custom build rule and improve <code>add_files("src/*.md", {rule = "markdown"})</code></li>
 <li>Add <code>os.filesize()</code> api</li>
 <li>Add <code>core.ui.xxx</code> cui components</li>
 <li>Add <code>xmake f --menu</code> to configure project with a menu configuration interface</li>
@@ -439,8 +439,8 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/151">#151</a>: Improve to build the share library for the mingw platform</li>
 <li>Improve to generate makefile plugin</li>
 <li>Improve the checking errors tips</li>
-<li>Improve <code>add_cxflags</code> .., force to set flags without auto checking: <code>add_cxflags(&quot;-DTEST&quot;, {force = true})</code></li>
-<li>Improve <code>add_files</code>, add force block to force to set flags without auto checking: <code>add_files(&quot;src/*.c&quot;, {force = {cxflags = &quot;-DTEST&quot;}})</code></li>
+<li>Improve <code>add_cxflags</code> .., force to set flags without auto checking: <code>add_cxflags("-DTEST", {force = true})</code></li>
+<li>Improve <code>add_files</code>, add force block to force to set flags without auto checking: <code>add_files("src/*.c", {force = {cxflags = "-DTEST"}})</code></li>
 <li>Improve to search the root project directory</li>
 <li>Improve to detect vs environment</li>
 <li>Upgrade luajit to 2.1.0-beta3</li>
@@ -467,7 +467,7 @@
 <li>Add <code>.gitignore</code> file when creating new projects</li>
 <li>Improve to create template project</li>
 <li>Improve to detect toolchains on macosx without xcode</li>
-<li>Improve <code>set_config_header</code> to support <code>set_config_header(&quot;config&quot;, {version = &quot;2.1.8&quot;, build = &quot;%Y%m%d%H%M&quot;})</code></li>
+<li>Improve <code>set_config_header</code> to support <code>set_config_header("config", {version = "2.1.8", build = "%Y%m%d%H%M"})</code></li>
 </ul>
 <h3 id="bugs-fixed">Bugs fixed</h3>
 <ul>
@@ -486,7 +486,7 @@
 <ul>
 <li>Support 24bits truecolors for <code>cprint()</code></li>
 <li>Support <code>@loader_path</code> and <code>$ORIGIN</code> for <code>add_rpathdirs()</code></li>
-<li>Improve <code>set_version(&quot;x.x.x&quot;, {build = &quot;%Y%m%d%H%M&quot;})</code> and add build version</li>
+<li>Improve <code>set_version("x.x.x", {build = "%Y%m%d%H%M"})</code> and add build version</li>
 <li>Move docs directory to xmake-docs repo</li>
 <li>Improve install and uninstall actions and support DESTDIR and PREFIX envirnoment variables</li>
 <li>Optimize to detect flags</li>
@@ -511,7 +511,7 @@
 <ul>
 <li>Improve <code>add_files</code> to configure the compile option of the given files</li>
 <li>Inherit links and linkdirs from the dependent targets and options</li>
-<li>Improve <code>target.add_deps</code> and add inherit config, .e.g <code>add_deps(&quot;test&quot;, {inherit = false})</code></li>
+<li>Improve <code>target.add_deps</code> and add inherit config, .e.g <code>add_deps("test", {inherit = false})</code></li>
 <li>Remove the binary files of <code>tbox.pkg</code></li>
 <li>Use <code>/Zi</code> instead of <code>/ZI</code> for msvc</li>
 </ul>
@@ -528,7 +528,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/83">#83</a>: Add user extension modules to detect program, libraries and files.</li>
 <li>Add <code>find_program</code>, <code>find_file</code>, <code>find_library</code>, <code>find_tool</code> and <code>find_package</code> module interfaces.</li>
 <li>Add <code>net.*</code> and <code>devel.*</code> extension modules</li>
-<li>Add <code>val()</code> api to get the value of builtin-variable, .e.g <code>val(&quot;host&quot;)</code>, <code>val(&quot;env PATH&quot;)</code>, <code>val(&quot;shell echo hello&quot;)</code> and <code>val(&quot;reg HKEY_LOCAL_MACHINE\\XX;Value&quot;)</code></li>
+<li>Add <code>val()</code> api to get the value of builtin-variable, .e.g <code>val("host")</code>, <code>val("env PATH")</code>, <code>val("shell echo hello")</code> and <code>val("reg HKEY_LOCAL_MACHINE\\XX;Value")</code></li>
 <li>Support to compile the microsoft resource file (.rc)</li>
 <li>Add <code>has_flags</code>, <code>features</code> and <code>has_features</code> for detect module interfaces.</li>
 <li>Add <code>option.on_check</code>, <code>option.after_check</code> and <code>option.before_check</code> api</li>
@@ -550,7 +550,7 @@
 <li>Improve <code>print</code> interface to dump table</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/111">#111</a>: Add <code>--root</code> common option to allow run xmake command as root</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/113">#113</a>: Privilege manage when running as root, store the root privilege and degrade.</li>
-<li>Improve <code>xxx_script</code> in <code>xmake.lua</code> to support pattern match, .e.g <code>on_build(&quot;iphoneos|arm*&quot;, function (target) end)</code></li>
+<li>Improve <code>xxx_script</code> in <code>xmake.lua</code> to support pattern match, .e.g <code>on_build("iphoneos|arm*", function (target) end)</code></li>
 <li>improve builtin-variables to support to get the value envirnoment and registry</li>
 <li>Improve to detect vstudio sdk and cross toolchains envirnoment</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/71">#71</a>: Improve to detect compiler and linker from env vars</li>
@@ -561,7 +561,7 @@
 <li>Optimize <code>xmake rebuild</code> speed on windows</li>
 <li>Move <code>core.project.task</code> to <code>core.base.task</code></li>
 <li>Move <code>echo</code> and <code>app2ipa</code> plugins to <a href="https://github.com/xmake-io/xmake-plugins">xmake-plugins</a> repo.</li>
-<li>Add new api <code>set_config_header(&quot;config.h&quot;, {prefix = &quot;&quot;})</code> instead of <code>set_config_h</code> and <code>set_config_h_prefix</code></li>
+<li>Add new api <code>set_config_header("config.h", {prefix = ""})</code> instead of <code>set_config_h</code> and <code>set_config_h_prefix</code></li>
 </ul>
 <h3 id="bugs-fixed">Bugs fixed</h3>
 <ul>
@@ -694,7 +694,7 @@
 <h2 id="v2-0-4">v2.0.4</h2>
 <h3 id="new-features">New features</h3>
 <ul>
-<li>Add native shell support for <code>xmake.lua</code>. .e.g <code>add_ldflags(&quot;$(shell pkg-config --libs sqlite3)&quot;)</code></li>
+<li>Add native shell support for <code>xmake.lua</code>. .e.g <code>add_ldflags("$(shell pkg-config --libs sqlite3)")</code></li>
 <li>Enable pdb symbol files for windows</li>
 <li>Add debugger support on windows (vsjitdebugger, ollydbg, windbg ... )</li>
 <li>Add <code>getenv</code> interface for the global scope of <code>xmake.lua</code></li>

+ 6 - 6
mirror/about/sponsor.html

@@ -95,22 +95,22 @@
 <h2 id="paypal">Paypal</h2>
 <p><a href="https://paypal.me/tboox/5"><img src="/assets/img/paypal.png" alt="Paypal Me"></a></p>
 <h2 id="github-sponsor">Github Sponsor</h2>
-<p>&lt;iframe src=&quot;https://github.com/sponsors/waruqi/card&quot; title=&quot;Sponsor waruqi&quot; height=&quot;130&quot; width=&quot;600&quot; style=&quot;border: 0;&quot;&gt;&lt;/iframe&gt;
+<p><iframe src="https://github.com/sponsors/waruqi/card" title="Sponsor waruqi" height="130" width="600" style="border: 0;"></iframe>
 
 </p>
 <h2 id="bitcoin">Bitcoin</h2>
 <pre><code>bc1qstzyehpjsryh8qwj8kf95js4cjcj3p670s5j9fyd3gkj946qdt7qx0xjpa
 </code></pre><h2 id="backers">Backers</h2>
-<p>&lt;a href=&quot;https://opencollective.com/xmake#backers&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/backers.svg?width=890&quot;&gt;&lt;/a&gt;</p>
+<p><a href="https://opencollective.com/xmake#backers" target="_blank"><img src="https://opencollective.com/xmake/backers.svg?width=890"></a></p>
 <h2 id="sponsors">Sponsors</h2>
 <p>Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [<a href="https://opencollective.com/xmake#sponsor">Become a sponsor</a>]</p>
-<p>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/0/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/0/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/1/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/1/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/2/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/2/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/3/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/3/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/4/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/4/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/5/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/5/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/6/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/6/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/7/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/7/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/8/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/8/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/9/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/9/avatar.svg&quot;&gt;&lt;/a&gt;</p>
+<p><a href="https://opencollective.com/xmake/sponsor/0/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/0/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/1/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/1/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/2/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/2/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/3/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/3/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/4/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/4/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/5/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/5/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/6/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/6/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/7/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/7/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/8/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/8/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/9/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/9/avatar.svg"></a></p>
 <h2 id="alipay">Alipay</h2>
-<p>&lt;img src=&quot;/assets/img/alipay.png&quot; alt=&quot;alipay&quot; width=&quot;256&quot; height=&quot;256&quot;&gt;</p>
+<p><img src="/assets/img/alipay.png" alt="alipay" width="256" height="256"></p>
 <h2 id="weixin">Weixin</h2>
-<p>&lt;img src=&quot;/assets/img/weixin.png&quot; alt=&quot;weixin&quot; width=&quot;218&quot; height=&quot;218&quot;&gt;</p>
+<p><img src="/assets/img/weixin.png" alt="weixin" width="218" height="218"></p>
 <h2 id="afdian">Afdian</h2>
-<p>&lt;a href=&quot;https://afdian.net/@xmake&quot; target=&quot;_blank&quot;&gt;<br>&lt;img src=&quot;/assets/img/afdian-xmake.png&quot; alt=&quot;afdian&quot; width=&quot;50%&quot; height=&quot;50%&quot;&gt;<br>&lt;/a&gt;</p>
+<p><a href="https://afdian.net/@xmake" target="_blank"><br><img src="/assets/img/afdian-xmake.png" alt="afdian" width="50%" height="50%"><br></a></p>
 <h2 id="supporters">Supporters</h2>
 <table>
 <thead>

+ 52 - 52
mirror/getting_started.html

@@ -95,18 +95,18 @@
 <p>👉 <a href="https://xmake.io/#/about/sponsor">Sponsor Page</a></p>
 <h2 id="installation">Installation</h2>
 <h4 id="via-curl">via curl</h4>
-<pre><code class="lang-bash">bash &lt;(curl -fsSL https://xmake.io/shget.text)
+<pre><code class="lang-bash">bash <(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h4 id="via-wget">via wget</h4>
-<pre><code class="lang-bash">bash &lt;(wget https://xmake.io/shget.text -O -)
+<pre><code class="lang-bash">bash <(wget https://xmake.io/shget.text -O -)
 </code></pre>
 <h4 id="via-powershell">via powershell</h4>
 <pre><code class="lang-powershell">Invoke-Expression (Invoke-Webrequest &#39;https://xmake.io/psget.text&#39; -UseBasicParsing).Content
 </code></pre>
 <h2 id="simple-description">Simple description</h2>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/showcode1.png&quot; width=&quot;340px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/showcode1.png" width="340px" /></p>
 <h2 id="package-dependences">Package dependences</h2>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/add_require.png&quot; width=&quot;600px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/add_require.png" width="600px" /></p>
 <p>An official xmake package repository: <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a></p>
 <h2 id="build-project">Build project</h2>
 <pre><code class="lang-bash">$ xmake
@@ -124,7 +124,7 @@ $ xmake
 <h2 id="menu-configuration">Menu configuration</h2>
 <pre><code class="lang-bash">$ xmake f --menu
 </code></pre>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/menuconf.png&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/menuconf.png" width="650px" /></p>
 <h2 id="build-as-fast-as-ninja">Build as fast as ninja</h2>
 <p>The test project: <a href="https://github.com/xmake-io/xmake/tree/master/core">xmake-core</a></p>
 <h3 id="multi-task-parallel-compilation">Multi-task parallel compilation</h3>
@@ -203,9 +203,9 @@ $ xmake
 </table>
 <h2 id="package-management">Package management</h2>
 <h3 id="download-and-build">Download and build</h3>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/package_manage.png&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/package_manage.png" width="650px" /></p>
 <h3 id="processing-architecture">Processing architecture</h3>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/package_arch.png&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/package_arch.png" width="650px" /></p>
 <h2 id="supported-platforms">Supported platforms</h2>
 <ul>
 <li>Windows (x86, x64)</li>
@@ -246,73 +246,73 @@ $ xmake
 </ul>
 <h2 id="more-examples">More Examples</h2>
 <p>Debug and release modes:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
 
-target(&quot;console&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    if is_mode(&quot;debug&quot;) then
-        add_defines(&quot;DEBUG&quot;)
+target("console")
+    set_kind("binary")
+    add_files("src/*.c")
+    if is_mode("debug") then
+        add_defines("DEBUG")
     end
 </code></pre>
 <p>Custom scripts:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
     after_build(function (target)
-        print(&quot;hello: %s&quot;, target:name())
-        os.exec(&quot;echo %s&quot;, target:targetfile())
+        print("hello: %s", target:name())
+        os.exec("echo %s", target:targetfile())
     end)
 </code></pre>
 <p>Download and use packages in <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a> or third-party repositories:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox &gt;1.6.1&quot;, &quot;libuv master&quot;, &quot;vcpkg::ffmpeg&quot;, &quot;brew::pcre2/libpcre2-8&quot;)
-add_requires(&quot;conan::OpenSSL/1.0.2n@conan/stable&quot;, {alias = &quot;openssl&quot;, optional = true, debug = true}) 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;tbox&quot;, &quot;libuv&quot;, &quot;vcpkg::ffmpeg&quot;, &quot;brew::pcre2/libpcre2-8&quot;, &quot;openssl&quot;)
+<pre><code class="lang-lua">add_requires("tbox >1.6.1", "libuv master", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8")
+add_requires("conan::OpenSSL/1.0.2n@conan/stable", {alias = "openssl", optional = true, debug = true}) 
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("tbox", "libuv", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8", "openssl")
 </code></pre>
 <p>Qt QuickApp Program:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.quickapp&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/qml.qrc&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.quickapp")
+    add_files("src/*.cpp")
+    add_files("src/qml.qrc")
 </code></pre>
 <p>Cuda Program:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.cu&quot;)
-    add_cugencodes(&quot;native&quot;)
-    add_cugencodes(&quot;compute_30&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.cu")
+    add_cugencodes("native")
+    add_cugencodes("compute_30")
 </code></pre>
 <p>WDK/UMDF Driver Program:</p>
-<pre><code class="lang-lua">target(&quot;echo&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;driver/*.c&quot;) 
-    add_files(&quot;driver/*.inx&quot;)
-    add_includedirs(&quot;exe&quot;)
+<pre><code class="lang-lua">target("echo")
+    add_rules("wdk.driver", "wdk.env.umdf")
+    add_files("driver/*.c") 
+    add_files("driver/*.inx")
+    add_includedirs("exe")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;exe/*.cpp&quot;)
+target("app")
+    add_rules("wdk.binary", "wdk.env.umdf")
+    add_files("exe/*.cpp")
 </code></pre>
 <p>More wdk driver program examples (umdf/kmdf/wdm), please see <a href="https://xmake.io/#/guide/project_examples?id=wdk-driver-program">WDK Program Examples</a></p>
 <h2 id="plugins">Plugins</h2>
 <h4 id="generate-ide-project-file-plugin-makefile-vs2002-vs2019-">Generate IDE project file plugin(makefile, vs2002 - vs2019 .. )</h4>
-<pre><code class="lang-bash">$ xmake project -k vsxmake -m &quot;debug;release&quot; # New vsproj generator (Recommended)
-$ xmake project -k vs -m &quot;debug;release&quot;
+<pre><code class="lang-bash">$ xmake project -k vsxmake -m "debug;release" # New vsproj generator (Recommended)
+$ xmake project -k vs -m "debug;release"
 $ xmake project -k cmake
 $ xmake project -k ninja
 $ xmake project -k compile_commands
 </code></pre>
 <h4 id="run-the-custom-lua-script-plugin">Run the custom lua script plugin</h4>
 <pre><code class="lang-bash">$ xmake l ./test.lua
-$ xmake l -c &quot;print(&#39;hello xmake!&#39;)&quot;
+$ xmake l -c "print(&#39;hello xmake!&#39;)"
 $ xmake l lib.detect.find_tool gcc
 $ xmake l
-&gt; print(&quot;hello xmake!&quot;)
-&gt; {1, 2, 3}
-&lt; { 
+> print("hello xmake!")
+> {1, 2, 3}
+< { 
     1,
     2,
     3 
@@ -324,15 +324,15 @@ $ xmake l
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-vscode">xmake-vscode</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-vscode/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-vscode/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-sublime">xmake-sublime</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-sublime/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-sublime/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-idea">xmake-idea</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-idea/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-idea/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><p><a href="https://github.com/luzhlon/xmake.vim">xmake.vim</a> (third-party, thanks <a href="https://github.com/luzhlon">@luzhlon</a>)</p>
 </li>
@@ -348,7 +348,7 @@ $ xmake l
 <li><a href="https://github.com/xmake-io/awesome-xmake">more</a></li>
 </ul>
 <h2 id="example-video">Example Video</h2>
-<p>&lt;a href=&quot;https://asciinema.org/a/133693&quot;&gt;<br>&lt;img src=&quot;https://asciinema.org/a/133693.png&quot; width=&quot;650px&quot; /&gt;<br>&lt;/a&gt;</p>
+<p><a href="https://asciinema.org/a/133693"><br><img src="https://asciinema.org/a/133693.png" width="650px" /><br></a></p>
 <h2 id="contacts">Contacts</h2>
 <ul>
 <li>Email:<a href="mailto:[email protected]">[email protected]</a></li>
@@ -360,7 +360,7 @@ $ xmake l
 <li>Wechat Public: tboox-os</li>
 </ul>
 <h2 id="thanks">Thanks</h2>
-<p>This project exists thanks to all the people who have <a href="CONTRIBUTING.md">contributed</a>:<br>&lt;a href=&quot;https://github.com/xmake-io/xmake/graphs/contributors&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/contributors.svg?width=890&amp;button=false&quot; /&gt;&lt;/a&gt;</p>
+<p>This project exists thanks to all the people who have <a href="CONTRIBUTING.md">contributed</a>:<br><a href="https://github.com/xmake-io/xmake/graphs/contributors"><img src="https://opencollective.com/xmake/contributors.svg?width=890&amp;button=false" /></a></p>
 <ul>
 <li><a href="https://github.com/TitanSnow">TitanSnow</a>: provide the xmake <a href="https://github.com/TitanSnow/ts-xmake-logo">logo</a> and install scripts</li>
 <li><a href="https://github.com/uael">uael</a>: provide the semantic versioning library <a href="https://github.com/uael/sv">sv</a></li>

+ 53 - 53
mirror/guide/configuration.html

@@ -92,14 +92,14 @@
 </style>
     <p>Set compilation configuration before building project with command <code>xmake f|config</code>.</p>
 <p>And if you want to known more options, please run: <code>xmake f --help</code>。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    You can use short or long command option, for example: &lt;br&gt;<br>    <code>xmake f</code> or <code>xmake config</code>.&lt;br&gt;<br>    <code>xmake f -p linux</code> or <code>xmake config --plat=linux</code>.<br>&lt;/p&gt;
+<p><p class="tip"><br>    You can use short or long command option, for example: <br><br>    <code>xmake f</code> or <code>xmake config</code>.<br><br>    <code>xmake f -p linux</code> or <code>xmake config --plat=linux</code>.<br></p>
 
 </p>
 <h2 id="target-platforms">Target Platforms</h2>
 <h3 id="current-host">Current Host</h3>
 <pre><code class="lang-bash">$ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    XMake will detect the current host platform automatically and build project.<br>&lt;/p&gt;
+<p><p class="tip"><br>    XMake will detect the current host platform automatically and build project.<br></p>
 
 </p>
 <h3 id="linux">Linux</h3>
@@ -115,7 +115,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p android --ndk=~/files/android-ndk-r10e/ -a arm64-v8a --bin=~/files/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin
 </code></pre>
 <p>The <a href="#-bin">--bin</a> option is used to set <code>bin</code> directory of toolchains.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>Please attempt to set <code>--arch=</code> option if it had failed to check compiler.<br>&lt;/p&gt;
+<p><p class="tip"><br>Please attempt to set <code>--arch=</code> option if it had failed to check compiler.<br></p>
 
 </p>
 <h3 id="iphoneos">iPhoneOS</h3>
@@ -164,7 +164,7 @@ arm-linux-armeabi-strip
 $ xmake
 </code></pre>
 <p>Among them, <code>-p cross</code> is used to specify that the current platform is a cross-compilation platform, and <code>--sdk=</code> is used to specify the root directory of the cross toolchain.</p>
-<p>Note: We can also specify the <code>-p linux</code> platform to configure cross compilation, the effect is the same, the only difference is that the name of the linux platform is additionally identified, which is convenient for xmake.lua to determine the platform by<code>is_plat (&quot;linux&quot;)</code> .</p>
+<p>Note: We can also specify the <code>-p linux</code> platform to configure cross compilation, the effect is the same, the only difference is that the name of the linux platform is additionally identified, which is convenient for xmake.lua to determine the platform by<code>is_plat ("linux")</code> .</p>
 <p>At this time, xmake will automatically detect the prefix name cross of gcc and other compilers: <code>arm-linux-armeabi-</code>, and when compiling, it will also automatically add search options for<code>link library</code> and <code>header files</code> :</p>
 <pre><code>-I/home/toolchains_sdkdir/include 
 -L/home/toolchains_sdkdir/lib
@@ -224,32 +224,32 @@ $ xmake
 <li>arflags: specify the generation parameters of the static library</li>
 </ul>
 <p>e.g:</p>
-<pre><code class="lang-bash">$ xmake f -p linux --sdk=/usr/toolsdk --cflags=&quot;-DTEST -I/xxx/xxx&quot; --ldflags=&quot;-lpthread&quot;
+<pre><code class="lang-bash">$ xmake f -p linux --sdk=/usr/toolsdk --cflags="-DTEST -I/xxx/xxx" --ldflags="-lpthread"
 </code></pre>
 <h3 id="project-description-settings">Project description settings</h3>
 <h4 id="set_toolchains">set_toolchains</h4>
 <p>This sets up different tool chains for a specific target individually. Unlike set_toolset, this interface is an overall switch for a complete tool chain, such as cc/ld/sh and a series of tool sets.</p>
 <p>This is also a recommended practice, because most compiler tool chains like gcc/clang, the compiler and the linker are used together. To cut it, you have to cut it as a whole. Separate and scattered switch settings will be cumbersome.</p>
 <p>For example, we switch the test target to two tool chains of clang+yasm:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    set_toolchains(&quot;clang&quot;, &quot;yasm&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    set_toolchains("clang", "yasm")
 </code></pre>
 <h4 id="set_toolset">set_toolset</h4>
 <p>If you feel that it is more complicated to configure through the command line each time, some configurations can be pre-configured in xmake.lua to simplify the command configuration. For example, the specification of the compiler can be set individually for each target through set_toolset.</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;)
-    set_toolset(&quot;ld&quot;, &quot;clang++&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    set_toolset("cxx", "clang")
+    set_toolset("ld", "clang++")
 </code></pre>
 <p>Force the compiler and linker of the test target to use the clang compiler, or specify the compiler name or path in the cross-compilation tool chain.</p>
 <h4 id="set_config">set_config</h4>
 <p>We can also set the default value of each configuration parameter in the <code>xmake f/config</code> command through <code>set_config</code>. This is a global api and will take effect for each target.</p>
-<pre><code class="lang-lua">set_config(&quot;cflags&quot;, &quot;-DTEST&quot;)
-set_config(&quot;sdk&quot;, &quot;/home/xxx/tooksdk&quot;)
-set_config(&quot;cc&quot;, &quot;gcc&quot;)
-set_config(&quot;ld&quot;, &quot;g++&quot;)
+<pre><code class="lang-lua">set_config("cflags", "-DTEST")
+set_config("sdk", "/home/xxx/tooksdk")
+set_config("cc", "gcc")
+set_config("ld", "g++")
 </code></pre>
 <p>However, we can still use xmake f --name = value` to modify the default configuration in xmake.lua.</p>
 <h3 id="custom-build-platform">Custom build platform</h3>
@@ -259,27 +259,27 @@ set_config(&quot;ld&quot;, &quot;g++&quot;)
 $ xmake
 </code></pre>
 <p>We passed in the myplat custom platform name as the current cross-toolchain compilation platform, and then we set the corresponding settings for this platform in xmake.lua:</p>
-<pre><code class="lang-lua">if is_plat(&quot;myplat&quot;) then
-    add_defines(&quot;TEST&quot;)
+<pre><code class="lang-lua">if is_plat("myplat") then
+    add_defines("TEST")
 end
 </code></pre>
 <p>In this way, xmake can be easily extended to deal with various compilation platforms, users can extend their own support for freebsd, netbsd, sunos and other cross-compiling platforms.</p>
 <p>I excerpted a cross-compilation configuration written before porting libuv, and intuitively feel:</p>
 <pre><code class="lang-lua">-- for gragonfly/freebsd/netbsd/openbsd platform
-if is_plat(&quot;gragonfly&quot;, &quot;freebsd&quot;, &quot;netbsd&quot;, &quot;openbsd&quot;) then
-    add_files(&quot;src/unix/bsd-ifaddrs.c&quot;)
-    add_files(&quot;src/unix/freebsd.c&quot;)
-    add_files(&quot;src/unix/kqueue.c&quot;)
-    add_files(&quot;src/unix/posix-hrtime.c&quot;)
-    add_headerfiles(&quot;(include/uv-bsd.h)&quot;)
+if is_plat("gragonfly", "freebsd", "netbsd", "openbsd") then
+    add_files("src/unix/bsd-ifaddrs.c")
+    add_files("src/unix/freebsd.c")
+    add_files("src/unix/kqueue.c")
+    add_files("src/unix/posix-hrtime.c")
+    add_headerfiles("(include/uv-bsd.h)")
 end 
 
 -- for sunos platform
-if is_plat(&quot;sunos&quot;) then
-    add_files(&quot;src/unix/no-proctitle.c&quot;)
-    add_files(&quot;src/unix/sunos.c&quot;)
-    add_defines(&quot;__EXTENSIONS_&quot;, &quot;_XOPEN_SOURCE=600&quot;)
-    add_headerfiles(&quot;(include/uv-sunos.h)&quot;)
+if is_plat("sunos") then
+    add_files("src/unix/no-proctitle.c")
+    add_files("src/unix/sunos.c")
+    add_defines("__EXTENSIONS_", "_XOPEN_SOURCE=600")
+    add_headerfiles("(include/uv-sunos.h)")
 end
 </code></pre>
 <p>Then, we can switch these platforms to compile:</p>
@@ -292,7 +292,7 @@ $ xmake
 </code></pre>
 <p>As long as the <code>--sdk=</code> and other parameters are set, the cross-compilation mode of the Linux platform will be enabled.</p>
 <h3 id="toolchain-configuration">Toolchain configuration</h3>
-<p>!&gt; This feature requires v2.3.4 or later to support</p>
+<p>!> This feature requires v2.3.4 or later to support</p>
 <p>The above describes the general cross-compilation toolchain configuration. If some specific toolchains need to be imported into additional scenarios such as <code>--ldflags/--includedirs</code>, it is more cumbersome<br>Therefore, xmake also has some common tool chains built-in, which can save the complicated configuration process of cross-compilation tool chain, and only need to execute:</p>
 <pre><code class="lang-bash">$ xmake f --toolchain=gnu-rm --sdk=/xxx/
 $ xmake
@@ -330,18 +330,18 @@ fasm          Flat Assembler
 </code></pre>
 <h4 id="custom-toolchain">Custom toolchain</h4>
 <p>In addition, we can also customize the toolchain in xmake.lua, and then specify the switch through <code>xmake f --toolchain=myclang</code>, for example:</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;ld&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;sh&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;ar&quot;, &quot;ar&quot;)
-    set_toolset(&quot;ex&quot;, &quot;ar&quot;)
-    set_toolset(&quot;strip&quot;, &quot;strip&quot;)
-    set_toolset(&quot;mm&quot;, &quot;clang&quot;)
-    set_toolset(&quot;mxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;as&quot;, &quot;clang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
     - ...
 </code></pre>
@@ -387,7 +387,7 @@ $ xmake
 <p>In addition, the usage of other tool chain configuration parameters is the same as that described above. For example, <code>--cross</code>,<code>--bin=</code>, etc. can be adjusted according to the actual needs of the environment. Own mingw tool chain.</p>
 <h4 id="llvm-toolchain">LLVM Toolchain</h4>
 <p>The tool chain of llvm is relatively standard, only need to set the sdk configuration path to use:</p>
-<pre><code class="lang-bash">$ xmake f -p cross --toolchain=llvm --sdk=&quot;C:\Program Files\LLVM&quot;
+<pre><code class="lang-bash">$ xmake f -p cross --toolchain=llvm --sdk="C:\Program Files\LLVM"
 $ xmake
 </code></pre>
 <h4 id="gnu-rm-toolchain">GNU-RM Toolchain</h4>
@@ -578,7 +578,7 @@ $ xmake
 </tr>
 </tbody>
 </table>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>if you want to known more options, please run: <code>xmake f --help</code>。<br>&lt;/p&gt;
+<p><p class="tip"><br>if you want to known more options, please run: <code>xmake f --help</code>。<br></p>
 
 </p>
 <h4 id="-sdk">--sdk</h4>
@@ -610,7 +610,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/home/toolchains_sdkdir --bin=/usr/opt/bin
 $ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>Before v2.2.1 version, this parameter name is <code>--toolchains</code>, exists more ambiguous, so we changed to <code>--bin=</code> to set the bin directory.<br>&lt;/p&gt;
+<p><p class="tip"><br>Before v2.2.1 version, this parameter name is <code>--toolchains</code>, exists more ambiguous, so we changed to <code>--bin=</code> to set the bin directory.<br></p>
 
 </p>
 <h4 id="-cross">--cross</h4>
@@ -631,7 +631,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --as=armv7-linux-as
 </code></pre>
 <p>If the &#39;AS&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --as=gcc@/home/xxx/asmips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --as=gcc@/home/xxx/asmips.exe</code><br></p>
 
 </p>
 <h4 id="-cc">--cc</h4>
@@ -641,7 +641,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --cc=armv7-linux-clang
 </code></pre>
 <p>If the &#39;CC&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --cc=gcc@/home/xxx/ccmips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --cc=gcc@/home/xxx/ccmips.exe</code><br></p>
 
 </p>
 <h4 id="-cxx">--cxx</h4>
@@ -651,7 +651,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --cxx=armv7-linux-clang++
 </code></pre>
 <p>If the &#39;CXX&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --cxx=g++@/home/xxx/c++mips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --cxx=g++@/home/xxx/c++mips.exe</code><br></p>
 
 </p>
 <h4 id="-ld">--ld</h4>
@@ -661,7 +661,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --ld=armv7-linux-clang++
 </code></pre>
 <p>If the &#39;LD&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang linker, .e.g <code>xmake f --ld=g++@/home/xxx/c++mips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang linker, .e.g <code>xmake f --ld=g++@/home/xxx/c++mips.exe</code><br></p>
 
 </p>
 <h4 id="-sh">--sh</h4>
@@ -671,7 +671,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --sh=armv7-linux-clang++
 </code></pre>
 <p>If the &#39;SH&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang linker, .e.g <code>xmake f --sh=g++@/home/xxx/c++mips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang linker, .e.g <code>xmake f --sh=g++@/home/xxx/c++mips.exe</code><br></p>
 
 </p>
 <h4 id="-ar">--ar</h4>
@@ -681,7 +681,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --ar=armv7-linux-ar
 </code></pre>
 <p>If the &#39;AR&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-ar archiver, .e.g <code>xmake f --ar=ar@/home/xxx/armips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-ar archiver, .e.g <code>xmake f --ar=ar@/home/xxx/armips.exe</code><br></p>
 
 </p>
 <h2 id="global-configuration">Global Configuration</h2>
@@ -693,7 +693,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p android
 $ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    You can use short or long command option, for example: <code>xmake g</code> or <code>xmake global</code>.&lt;br&gt;<br>&lt;/p&gt;
+<p><p class="tip"><br>    You can use short or long command option, for example: <code>xmake g</code> or <code>xmake global</code>.<br><br></p>
 
 </p>
 <h2 id="clean-configuration">Clean Configuration</h2>

+ 9 - 9
mirror/guide/installation.html

@@ -91,24 +91,24 @@
 }
 </style>
     <h2 id="master">Master</h2>
-<p>!&gt; Note! xmake is not recommended to install under root!</p>
+<p>!> Note! xmake is not recommended to install under root!</p>
 <h4 id="via-curl">via curl</h4>
-<pre><code class="lang-bash">bash &lt;(curl -fsSL https://xmake.io/shget.text)
+<pre><code class="lang-bash">bash <(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h4 id="via-wget">via wget</h4>
-<pre><code class="lang-bash">bash &lt;(wget https://xmake.io/shget.text -O -)
+<pre><code class="lang-bash">bash <(wget https://xmake.io/shget.text -O -)
 </code></pre>
 <h4 id="via-powershell">via powershell</h4>
 <pre><code class="lang-powershell">Invoke-Expression (Invoke-Webrequest &#39;https://xmake.io/psget.text&#39; -UseBasicParsing).Content
 </code></pre>
-<p>!&gt; If the ps script execution prompt fails, you can try to execute in administrator mode.</p>
+<p>!> If the ps script execution prompt fails, you can try to execute in administrator mode.</p>
 <h2 id="windows">Windows</h2>
 <h3 id="via-installer">via installer</h3>
 <ol>
 <li>Download xmake windows installer from <a href="https://github.com/xmake-io/xmake/releases">Releases</a></li>
 <li>Run xmake-[version].[win32|win64].exe</li>
 </ol>
-<p>!&gt; Releases/xmake-[version].[win32|win64].zip has not installer, we need unzip it and add PATH environment variables by ourself.</p>
+<p>!> Releases/xmake-[version].[win32|win64].zip has not installer, we need unzip it and add PATH environment variables by ourself.</p>
 <h3 id="via-scoop">via scoop</h3>
 <pre><code class="lang-bash">scoop install xmake
 </code></pre>
@@ -138,7 +138,7 @@
 </code></pre>
 <h2 id="source-compilation-and-installation">Source compilation and installation</h2>
 <h3 id="installation">Installation</h3>
-<p>!&gt; Note! xmake is not recommended to install under root!</p>
+<p>!> Note! xmake is not recommended to install under root!</p>
 <pre><code class="lang-bash">git clone --recursive https://github.com/xmake-io/xmake.git
 cd ./xmake
 make build
@@ -149,7 +149,7 @@ source ~/.xmake/profile
 <pre><code class="lang-bash">git clone --recursive https://gitee.com/tboox/xmake.git
 git clone --recursive https://gitlab.com/tboox/xmake.git
 </code></pre>
-<p>!&gt; Since the current xmake source maintains dependencies via git submodule, it is necessary to add the <code>--recursive</code> parameter to pull all submodules at the same time. Please do not download the tar.gz source directly, because github does not automatically package submodules. Code.</p>
+<p>!> Since the current xmake source maintains dependencies via git submodule, it is necessary to add the <code>--recursive</code> parameter to pull all submodules at the same time. Please do not download the tar.gz source directly, because github does not automatically package submodules. Code.</p>
 <p>If you forget to add <code>--recursive</code> when git clone, you can also execute <code>git submodule update --init</code> to pull all submodules, for example:</p>
 <pre><code class="lang-bash">git clone https://github.com/xmake-io/xmake.git
 cd ./xmake
@@ -157,7 +157,7 @@ git submodule update --init
 make build
 ./scripts/get.sh __local__ __install_only__
 </code></pre>
-<p>!&gt; <code>./get.sh __local__</code> is installed to <code>~/.local/xmake</code>, and then loaded by <code>source ~/.xmake/profile</code>, so after the installation, the current terminal fails to execute xmake, If the prompt is not found, manually execute <code>source ~/.xmake/profile</code>, and the next time you open the terminal, you don&#39;t need it.</p>
+<p>!> <code>./get.sh __local__</code> is installed to <code>~/.local/xmake</code>, and then loaded by <code>source ~/.xmake/profile</code>, so after the installation, the current terminal fails to execute xmake, If the prompt is not found, manually execute <code>source ~/.xmake/profile</code>, and the next time you open the terminal, you don&#39;t need it.</p>
 <h3 id="uninstall">Uninstall</h3>
 <pre><code class="lang-bash">./scripts/get.sh __uninstall__
 </code></pre>
@@ -173,7 +173,7 @@ make build
 <li>If you want to speed up compilation, you can install ccache, xmake will automatically detect and use, which is also optional.</li>
 </ol>
 <h2 id="other-installation-methods">Other installation methods</h2>
-<p>!&gt; This is also the source code compilation and installation, but the installation path will be written directly to <code>/usr/</code>, which requires root privileges, so unless special circumstances, this installation method is not recommended, it is recommended to use the <code>./get. Sh __local__</code> way to install, the installation path of the two installation methods is different, do not mix.</p>
+<p>!> This is also the source code compilation and installation, but the installation path will be written directly to <code>/usr/</code>, which requires root privileges, so unless special circumstances, this installation method is not recommended, it is recommended to use the <code>./get. Sh __local__</code> way to install, the installation path of the two installation methods is different, do not mix.</p>
 <p>Compile and install via make:</p>
 <pre><code class="lang-bash">make build; sudo make install
 </code></pre>

+ 86 - 86
mirror/guide/other_features.html

@@ -147,12 +147,12 @@ $ xmake
 <h3 id="fastly-cross-compile">Fastly cross compile</h3>
 <p>As we all know, although many projects maintained by autotools support cross-compilation, the configuration process of cross-compilation is very complicated. There are still many differences in different toolchain processing methods, and many pits will be stepped in the middle.</p>
 <p>Even if you run through a toolchain&#39;s cross-compilation, if you switch to another toolchain environment, it may take a long time, and if you use xmake, you usually only need two simple commands:</p>
-<p>!&gt; At present autotools supports cross-compilation of xmake, and other build systems such as cmake will be added later.</p>
+<p>!> At present autotools supports cross-compilation of xmake, and other build systems such as cmake will be added later.</p>
 <h4 id="cross-compile-android-platform">Cross compile android platform</h4>
 <pre><code class="lang-bash">$ xmake f -p android --trybuild=autotools [--ndk=xxx]
 $ xmake
 </code></pre>
-<p>!&gt; Among them, the --ndk parameter configuration is optional. If the user sets the ANDROID_NDK_HOME environment variable, or if the ndk is placed in ~/Library/Android/sdk/ndk-bundle, xmake can automatically detect it.</p>
+<p>!> Among them, the --ndk parameter configuration is optional. If the user sets the ANDROID_NDK_HOME environment variable, or if the ndk is placed in ~/Library/Android/sdk/ndk-bundle, xmake can automatically detect it.</p>
 <p>Is not it simple? If you think this is not much, then you can directly operate <code>./configure</code> to configure cross-compilation. You can see this document for comparison: [Using NDK with other compilation systems] (<a href="https://developer.android">https://developer.android</a> .com/ndk/guides/other_build_systems # autoconf)</p>
 <p>To put it bluntly, you probably have to do this, you may not be able to do it once:</p>
 <pre><code class="lang-bash">$ export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG
@@ -181,7 +181,7 @@ $ xmake
 <p>For more cross compilation configuration details, please refer to the document: <a href="https://xmake.io/#/guide/configuration?id=cross-compilation">Cross Compilation</a>, except for an additional <code>--trybuild=</code> parameter, all other cross-compilation configuration parameters are completely universal.</p>
 <h3 id="passing-user-configuration-parameters">Passing user configuration parameters</h3>
 <p>We can use <code>--tryconfigs=</code> to pass additional configuration parameters of the user to the corresponding third-party build system. For example: autotools will be passed to <code>. / Configure</code>, cmake will be passed to the<code>cmake</code> command.</p>
-<pre><code class="lang-bash">$ xmake f --trybuild=autotools --tryconfigs=&quot;-enable-shared=no&quot;
+<pre><code class="lang-bash">$ xmake f --trybuild=autotools --tryconfigs="-enable-shared=no"
 $ xmake
 </code></pre>
 <p>For example, the above command, pass <code>--enable-shared=no</code> to<code>./configure</code> to disable dynamic library compilation.</p>
@@ -192,7 +192,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f --trybuild=[autotools|cmake|meson|ninja|bazel|make|msbuild|xcodebuild]
 $ xmake
 </code></pre>
-<p>!&gt; We also need to make sure that the build tool specified by --trybuild is installed and working properly.</p>
+<p>!> We also need to make sure that the build tool specified by --trybuild is installed and working properly.</p>
 <h4 id="building-android-jni-programs">Building Android jni programs</h4>
 <p>If <code>jni/Android.mk</code> exists in the current project, then xmake can directly call ndk-build to build the jni library.</p>
 <pre><code class="lang-bash">$ xmake f -p android --trybuild=ndkbuild [--ndk =]
@@ -262,29 +262,29 @@ checking for the debugger (dd) ... xcrun -sdk macosx lldb
 checking for the golang compiler (go) ... go
 configure
 {
-    ex = &quot;xcrun -sdk macosx ar&quot;
-,   sh = &quot;xcrun -sdk macosx clang++&quot;
-,   host = &quot;macosx&quot;
-,   ar = &quot;xcrun -sdk macosx ar&quot;
-,   buildir = &quot;build&quot;
-,   as = &quot;xcrun -sdk macosx clang&quot;
-,   plat = &quot;macosx&quot;
-,   xcode_dir = &quot;/Applications/Xcode.app&quot;
-,   arch = &quot;x86_64&quot;
-,   mxx = &quot;xcrun -sdk macosx clang++&quot;
-,   go = &quot;go&quot;
-,   target_minver = &quot;10.12&quot;
-,   ccache = &quot;ccache&quot;
-,   mode = &quot;release&quot;
+    ex = "xcrun -sdk macosx ar"
+,   sh = "xcrun -sdk macosx clang++"
+,   host = "macosx"
+,   ar = "xcrun -sdk macosx ar"
+,   buildir = "build"
+,   as = "xcrun -sdk macosx clang"
+,   plat = "macosx"
+,   xcode_dir = "/Applications/Xcode.app"
+,   arch = "x86_64"
+,   mxx = "xcrun -sdk macosx clang++"
+,   go = "go"
+,   target_minver = "10.12"
+,   ccache = "ccache"
+,   mode = "release"
 ,   clean = true
-,   cxx = &quot;xcrun -sdk macosx clang&quot;
-,   cc = &quot;xcrun -sdk macosx clang&quot;
-,   dd = &quot;xcrun -sdk macosx lldb&quot;
-,   kind = &quot;static&quot;
-,   ld = &quot;xcrun -sdk macosx clang++&quot;
-,   xcode_sdkver = &quot;10.12&quot;
-,   sc = &quot;xcrun -sdk macosx swiftc&quot;
-,   mm = &quot;xcrun -sdk macosx clang&quot;
+,   cxx = "xcrun -sdk macosx clang"
+,   cc = "xcrun -sdk macosx clang"
+,   dd = "xcrun -sdk macosx lldb"
+,   kind = "static"
+,   ld = "xcrun -sdk macosx clang++"
+,   xcode_sdkver = "10.12"
+,   sc = "xcrun -sdk macosx swiftc"
+,   mm = "xcrun -sdk macosx clang"
 }
 configure ok!
 clean ok!
@@ -311,27 +311,27 @@ build ok!👌
 <p>It is compiled directly and a xmake.lua file was generated which we can edit this xmake.lua to build more complicated project. </p>
 <p>The content of the generated xmake.lua:</p>
 <pre><code class="lang-lua">-- define target
-target(&quot;zlib-1.2&quot;)
+target("zlib-1.2")
 
     -- set kind
-    set_kind(&quot;static&quot;)
+    set_kind("static")
 
     -- add files
-    add_files(&quot;./adler32.c&quot;)
-    add_files(&quot;./compress.c&quot;)
-    add_files(&quot;./crc32.c&quot;)
-    add_files(&quot;./deflate.c&quot;)
-    add_files(&quot;./gzclose.c&quot;)
-    add_files(&quot;./gzlib.c&quot;)
-    add_files(&quot;./gzread.c&quot;)
-    add_files(&quot;./gzwrite.c&quot;)
-    add_files(&quot;./infback.c&quot;)
-    add_files(&quot;./inffast.c&quot;)
-    add_files(&quot;./inflate.c&quot;)
-    add_files(&quot;./inftrees.c&quot;)
-    add_files(&quot;./trees.c&quot;)
-    add_files(&quot;./uncompr.c&quot;)
-    add_files(&quot;./zutil.c&quot;)
+    add_files("./adler32.c")
+    add_files("./compress.c")
+    add_files("./crc32.c")
+    add_files("./deflate.c")
+    add_files("./gzclose.c")
+    add_files("./gzlib.c")
+    add_files("./gzread.c")
+    add_files("./gzwrite.c")
+    add_files("./infback.c")
+    add_files("./inffast.c")
+    add_files("./inflate.c")
+    add_files("./inftrees.c")
+    add_files("./trees.c")
+    add_files("./uncompr.c")
+    add_files("./zutil.c")
 </code></pre>
 <h3 id="fastly-compile-and-run-testing-code">Fastly compile and run testing code</h3>
 <p>For example, I want to write a simple program in the main.c only to echo &#39;hello world!&#39;.</p>
@@ -394,27 +394,27 @@ checking for the shared library linker (sh) ... xcrun -sdk iphoneos clang++
 checking for the swift compiler (sc) ... xcrun -sdk iphoneos swiftc
 configure
 {
-    ex = &quot;xcrun -sdk iphoneos ar&quot;
-,   ccache = &quot;ccache&quot;
-,   host = &quot;macosx&quot;
-,   ar = &quot;xcrun -sdk iphoneos ar&quot;
-,   buildir = &quot;build&quot;
-,   as = &quot;/usr/local/share/xmake/tools/utils/gas-preprocessor.pl xcrun -sdk iphoneos clang&quot;
-,   arch = &quot;armv7&quot;
-,   mxx = &quot;xcrun -sdk iphoneos clang++&quot;
-,   cxx = &quot;xcrun -sdk iphoneos clang&quot;
-,   target_minver = &quot;10.1&quot;
-,   xcode_dir = &quot;/Applications/Xcode.app&quot;
+    ex = "xcrun -sdk iphoneos ar"
+,   ccache = "ccache"
+,   host = "macosx"
+,   ar = "xcrun -sdk iphoneos ar"
+,   buildir = "build"
+,   as = "/usr/local/share/xmake/tools/utils/gas-preprocessor.pl xcrun -sdk iphoneos clang"
+,   arch = "armv7"
+,   mxx = "xcrun -sdk iphoneos clang++"
+,   cxx = "xcrun -sdk iphoneos clang"
+,   target_minver = "10.1"
+,   xcode_dir = "/Applications/Xcode.app"
 ,   clean = true
-,   sh = &quot;xcrun -sdk iphoneos clang++&quot;
-,   cc = &quot;xcrun -sdk iphoneos clang&quot;
-,   ld = &quot;xcrun -sdk iphoneos clang++&quot;
-,   mode = &quot;release&quot;
-,   kind = &quot;static&quot;
-,   plat = &quot;iphoneos&quot;
-,   xcode_sdkver = &quot;10.1&quot;
-,   sc = &quot;xcrun -sdk iphoneos swiftc&quot;
-,   mm = &quot;xcrun -sdk iphoneos clang&quot;
+,   sh = "xcrun -sdk iphoneos clang++"
+,   cc = "xcrun -sdk iphoneos clang"
+,   ld = "xcrun -sdk iphoneos clang++"
+,   mode = "release"
+,   kind = "static"
+,   plat = "iphoneos"
+,   xcode_sdkver = "10.1"
+,   sc = "xcrun -sdk iphoneos swiftc"
+,   mm = "xcrun -sdk iphoneos clang"
 }
 configure ok!
 clean ok!
@@ -527,29 +527,29 @@ checking for the debugger (dd) ... xcrun -sdk macosx lldb
 checking for the golang compiler (go) ... go
 configure
 {
-    ex = &quot;xcrun -sdk macosx ar&quot;
-,   sh = &quot;xcrun -sdk macosx clang++&quot;
-,   host = &quot;macosx&quot;
-,   ar = &quot;xcrun -sdk macosx ar&quot;
-,   buildir = &quot;build&quot;
-,   as = &quot;xcrun -sdk macosx clang&quot;
-,   plat = &quot;macosx&quot;
-,   xcode_dir = &quot;/Applications/Xcode.app&quot;
-,   arch = &quot;x86_64&quot;
-,   mxx = &quot;xcrun -sdk macosx clang++&quot;
-,   go = &quot;go&quot;
-,   target_minver = &quot;10.12&quot;
-,   ccache = &quot;ccache&quot;
-,   mode = &quot;release&quot;
+    ex = "xcrun -sdk macosx ar"
+,   sh = "xcrun -sdk macosx clang++"
+,   host = "macosx"
+,   ar = "xcrun -sdk macosx ar"
+,   buildir = "build"
+,   as = "xcrun -sdk macosx clang"
+,   plat = "macosx"
+,   xcode_dir = "/Applications/Xcode.app"
+,   arch = "x86_64"
+,   mxx = "xcrun -sdk macosx clang++"
+,   go = "go"
+,   target_minver = "10.12"
+,   ccache = "ccache"
+,   mode = "release"
 ,   clean = true
-,   cxx = &quot;xcrun -sdk macosx clang&quot;
-,   cc = &quot;xcrun -sdk macosx clang&quot;
-,   dd = &quot;xcrun -sdk macosx lldb&quot;
-,   kind = &quot;static&quot;
-,   ld = &quot;xcrun -sdk macosx clang++&quot;
-,   xcode_sdkver = &quot;10.12&quot;
-,   sc = &quot;xcrun -sdk macosx swiftc&quot;
-,   mm = &quot;xcrun -sdk macosx clang&quot;
+,   cxx = "xcrun -sdk macosx clang"
+,   cc = "xcrun -sdk macosx clang"
+,   dd = "xcrun -sdk macosx lldb"
+,   kind = "static"
+,   ld = "xcrun -sdk macosx clang++"
+,   xcode_sdkver = "10.12"
+,   sc = "xcrun -sdk macosx swiftc"
+,   mm = "xcrun -sdk macosx clang"
 }
 configure ok!
 clean ok!
@@ -650,7 +650,7 @@ target(wrjpgcom): binary
 </code></pre><h4 id="manual-configuration">Manual configuration</h4>
 <p>we need add them before compiling if the source code requires some special compiler options</p>
 <p>For example:</p>
-<pre><code class="lang-bash">$ xmake f --cxflags=&quot;&quot; --ldflags=&quot;&quot; --includedirs=&quot;&quot; --linkdirs=&quot;&quot;; xmake
+<pre><code class="lang-bash">$ xmake f --cxflags="" --ldflags="" --includedirs="" --linkdirs=""; xmake
 </code></pre>
 </article>
 </body>

+ 186 - 186
mirror/guide/project_examples.html

@@ -95,36 +95,36 @@
 <pre><code class="lang-bash">xmake create --help
 </code></pre>
 <h2 id="executable-program">Executable Program</h2>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*c")
 </code></pre>
 <p>For a complete example, execute the following command to create:</p>
 <pre><code class="lang-bash">xmake create -l c -t console test
 </code></pre>
 <h2 id="static-library-program">Static Library Program</h2>
-<pre><code class="lang-lua">target(&quot;library&quot;)
-    set_kind(&quot;static&quot;)
-    add_files(&quot;src/library/*.c&quot;)
+<pre><code class="lang-lua">target("library")
+    set_kind("static")
+    add_files("src/library/*.c")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
-    add_deps(&quot;library&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*c")
+    add_deps("library")
 </code></pre>
 <p>We use <code>add_deps</code> to link a static library to test target.</p>
 <p>For a complete example, execute the following command to create:</p>
 <pre><code class="lang-bash">xmake create -l c -t static test
 </code></pre>
 <h2 id="share-library-program">Share Library Program</h2>
-<pre><code class="lang-lua">target(&quot;library&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;src/library/*.c&quot;)
+<pre><code class="lang-lua">target("library")
+    set_kind("shared")
+    add_files("src/library/*.c")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
-    add_deps(&quot;library&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*c")
+    add_deps("library")
 </code></pre>
 <p>We use <code>add_deps</code> to link a share library to test target.</p>
 <p>For a complete example, execute the following command to create:</p>
@@ -154,37 +154,37 @@ $ xmake create -l c++ -t quickapp_qt test
 </code></pre>
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/160">#160</a>.</p>
 <h3 id="static-library">Static Library</h3>
-<pre><code class="lang-lua">target(&quot;qt_static_library&quot;)
-    add_rules(&quot;qt.static&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("qt_static_library")
+    add_rules("qt.static")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h3 id="shared-library">Shared Library</h3>
-<pre><code class="lang-lua">target(&quot;qt_shared_library&quot;)
-    add_rules(&quot;qt.shared&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("qt_shared_library")
+    add_rules("qt.shared")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h3 id="console-program">Console Program</h3>
-<pre><code class="lang-lua">target(&quot;qt_console&quot;)
-    add_rules(&quot;qt.console&quot;)
-    add_files(&quot;src/*.cpp&quot;)
+<pre><code class="lang-lua">target("qt_console")
+    add_rules("qt.console")
+    add_files("src/*.cpp")
 </code></pre>
 <h3 id="quick-application">Quick Application</h3>
 <p>v2.2.9 or higher:</p>
-<pre><code class="lang-lua">target(&quot;qt_quickapp&quot;)
-    add_rules(&quot;qt.quickapp&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/qml.qrc&quot;)
-</code></pre>
-<p>!&gt; The new version provides the <code>qt.quickapp</code> rule, built-in QtQuick built-in rules, the use of simpler, the following version of the <code>qt.application</code> is still supported, backward compatible:</p>
-<pre><code class="lang-lua">target(&quot;qt_quickapp&quot;)
-    add_rules(&quot;qt.application&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/qml.qrc&quot;)
-    add_frameworks(&quot;QtQuick&quot;)
-</code></pre>
-<p>!&gt; If you are using your own compiled static version of the QT SDK, you need to switch to the <code>add_rules(&quot;qt.quickapp_static&quot;)</code> static rule,<br>because the linked libraries are different and need to be statically linked.</p>
+<pre><code class="lang-lua">target("qt_quickapp")
+    add_rules("qt.quickapp")
+    add_files("src/*.cpp")
+    add_files("src/qml.qrc")
+</code></pre>
+<p>!> The new version provides the <code>qt.quickapp</code> rule, built-in QtQuick built-in rules, the use of simpler, the following version of the <code>qt.application</code> is still supported, backward compatible:</p>
+<pre><code class="lang-lua">target("qt_quickapp")
+    add_rules("qt.application")
+    add_files("src/*.cpp") 
+    add_files("src/qml.qrc")
+    add_frameworks("QtQuick")
+</code></pre>
+<p>!> If you are using your own compiled static version of the QT SDK, you need to switch to the <code>add_rules("qt.quickapp_static")</code> static rule,<br>because the linked libraries are different and need to be statically linked.</p>
 <p>Next, we try to compile, usually, if you use the Qt installation package to install by default, and do not modify the installation path, then in most cases you can automatically detect the root path of the QT SDK, for example:</p>
 <pre><code class="lang-bash">$ xmake
 checking for the architecture ... x86_64
@@ -204,21 +204,21 @@ Build ok!
 <p><img src="/assets/img/guide/qt_quickapp.png" alt=""></p>
 <h3 id="widgets-application">Widgets Application</h3>
 <p>v2.2.9 or higher:</p>
-<pre><code class="lang-lua">target(&quot;qt_widgetapp&quot;)
-    add_rules(&quot;qt.widgetapp&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;)  -- add files with Q_OBJECT meta (only for qt.moc)
-</code></pre>
-<p>!&gt; The new version provides the <code>qt.widgetapp</code> rule, built-in QtWidgets built-in rules, the use of simpler, the following version of the <code>qt.application</code> is still supported, backward compatible:</p>
-<pre><code class="lang-lua">target(&quot;qt_widgetapp&quot;)
-    add_rules(&quot;qt.application&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;)  -- add files with Q_OBJECT meta (only for qt.moc)
-    add_frameworks(&quot;QtWidgets&quot;)
-</code></pre>
-<p>!&gt; If you are using your own compiled static version of the QT SDK, you need to switch to the <code>add_rules(&quot;qt.widgetapp_static&quot;)</code> static rule,<br>because the linked libraries are different and need to be statically linked.</p>
+<pre><code class="lang-lua">target("qt_widgetapp")
+    add_rules("qt.widgetapp")
+    add_files("src/*.cpp")
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- add files with Q_OBJECT meta (only for qt.moc)
+</code></pre>
+<p>!> The new version provides the <code>qt.widgetapp</code> rule, built-in QtWidgets built-in rules, the use of simpler, the following version of the <code>qt.application</code> is still supported, backward compatible:</p>
+<pre><code class="lang-lua">target("qt_widgetapp")
+    add_rules("qt.application")
+    add_files("src/*.cpp") 
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- add files with Q_OBJECT meta (only for qt.moc)
+    add_frameworks("QtWidgets")
+</code></pre>
+<p>!> If you are using your own compiled static version of the QT SDK, you need to switch to the <code>add_rules("qt.widgetapp_static")</code> static rule,<br>because the linked libraries are different and need to be statically linked.</p>
 <p>The effect is as follows:</p>
 <p><img src="/assets/img/guide/qt_widgetapp.png" alt=""></p>
 <h3 id="android-application">Android Application</h3>
@@ -246,15 +246,15 @@ $ cd test
 $ xmake
 </code></pre>
 <pre><code class="lang-lua">-- define target
-target(&quot;cuda_console&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.cu&quot;)
+target("cuda_console")
+    set_kind("binary")
+    add_files("src/*.cu")
     -- generate SASS code for SM architecture of current host
-    add_cugencodes(&quot;native&quot;)
+    add_cugencodes("native")
     -- generate PTX code for the virtual architecture to guarantee compatibility
-    add_cugencodes(&quot;compute_30&quot;)
+    add_cugencodes("compute_30")
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>Starting with v2.2.7, the default build will enable device-link. (see <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>If you want to disable device-link, you can set it with <code>add_values(&quot;cuda.devlink&quot;, false)</code>.<br>&lt;/p&gt;
+<p><p class="tip"><br>Starting with v2.2.7, the default build will enable device-link. (see <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>If you want to disable device-link, you can set it with <code>add_values("cuda.devlink", false)</code>.<br></p>
 
 </p>
 <p>xmake will detect Cuda SDK automatically and we can also set the SDK directory manually.</p>
@@ -264,50 +264,50 @@ $ xmake
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/158">#158</a>.</p>
 <h2 id="wdk-driver-program">WDK Driver Program</h2>
 <p>xmake will detect WDK automatically and we can also set the WDK directory manually.</p>
-<pre><code class="lang-console">$ xmake f --wdk=&quot;G:\Program Files\Windows Kits\10&quot; -c
+<pre><code class="lang-console">$ xmake f --wdk="G:\Program Files\Windows Kits\10" -c
 $ xmake
 </code></pre>
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/159">#159</a>.</p>
 <p>And see <a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/wdk">WDK examples</a></p>
 <h3 id="umdf-driver-program">UMDF Driver Program</h3>
-<pre><code class="lang-lua">target(&quot;echo&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;driver/*.c&quot;) 
-    add_files(&quot;driver/*.inx&quot;)
-    add_includedirs(&quot;exe&quot;)
+<pre><code class="lang-lua">target("echo")
+    add_rules("wdk.driver", "wdk.env.umdf")
+    add_files("driver/*.c") 
+    add_files("driver/*.inx")
+    add_includedirs("exe")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;exe/*.cpp&quot;) 
+target("app")
+    add_rules("wdk.binary", "wdk.env.umdf")
+    add_files("exe/*.cpp") 
 </code></pre>
 <h3 id="kmdf-driver-program">KMDF Driver Program</h3>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.kmdf&quot;)
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;driver/*.rc&quot;)
+<pre><code class="lang-lua">target("nonpnp")
+    add_rules("wdk.driver", "wdk.env.kmdf")
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
+    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.rc")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.kmdf&quot;)
-    add_files(&quot;exe/*.c&quot;) 
-    add_files(&quot;exe/*.inf&quot;)
+target("app")
+    add_rules("wdk.binary", "wdk.env.kmdf")
+    add_files("exe/*.c") 
+    add_files("exe/*.inf")
 </code></pre>
 <h3 id="wdm-driver-program">WDM Driver Program</h3>
-<pre><code class="lang-lua">target(&quot;kcs&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    add_values(&quot;wdk.man.flags&quot;, &quot;-prefix Kcs&quot;)
-    add_values(&quot;wdk.man.resource&quot;, &quot;kcsCounters.rc&quot;)
-    add_values(&quot;wdk.man.header&quot;, &quot;kcsCounters.h&quot;)
-    add_values(&quot;wdk.man.counter_header&quot;, &quot;kcsCounters_counters.h&quot;)
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;, &quot;*.man&quot;) 
-</code></pre>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TracePrint((LEVEL,FLAGS,MSG,...))&quot;)
-    add_files(&quot;*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;*.rc&quot;, &quot;*.inf&quot;)
-    add_files(&quot;*.mof|msdsm.mof&quot;)
-    add_files(&quot;msdsm.mof&quot;, {values = {wdk_mof_header = &quot;msdsmwmi.h&quot;}}) 
+<pre><code class="lang-lua">target("kcs")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    add_values("wdk.man.flags", "-prefix Kcs")
+    add_values("wdk.man.resource", "kcsCounters.rc")
+    add_values("wdk.man.header", "kcsCounters.h")
+    add_values("wdk.man.counter_header", "kcsCounters_counters.h")
+    add_files("*.c", "*.rc", "*.man") 
+</code></pre>
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
+    add_files("*.c", {rule = "wdk.tracewpp"}) 
+    add_files("*.rc", "*.inf")
+    add_files("*.mof|msdsm.mof")
+    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}}) 
 </code></pre>
 <h3 id="package-driver">Package Driver</h3>
 <p>We can run the following command to generate a .cab driver package.</p>
@@ -322,85 +322,85 @@ $ xmake [p|package] -o outputdir
        - debug/x86/sampledsm.cab
        - release/x64/sampledsm.cab
 </code></pre><h3 id="driver-signing">Driver Signing</h3>
-<p>The driver signing is disabled when we compile driver in default case,<br>but we can add <code>set_values(&quot;wdk.sign.mode&quot;)</code> to enable test/release sign.</p>
+<p>The driver signing is disabled when we compile driver in default case,<br>but we can add <code>set_values("wdk.sign.mode")</code> to enable test/release sign.</p>
 <h4 id="testsign">TestSign</h4>
 <p>We can use test certificate of xmake to do testsign, but please run <code>$xmake l utils.wdk.testcert</code> install as admin to install a test certificate first (only once)!</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
 </code></pre>
 <p>Or we set a valid certificate thumbprint to do it in local machine.</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
-    set_values(&quot;wdk.sign.thumbprint&quot;, &quot;032122545DCAA6167B1ADBE5F7FDF07AE2234AAA&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
+    set_values("wdk.sign.thumbprint", "032122545DCAA6167B1ADBE5F7FDF07AE2234AAA")
 </code></pre>
 <p>We can also do testsign via setting store/company info.</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
-    set_values(&quot;wdk.sign.store&quot;, &quot;PrivateCertStore&quot;)
-    set_values(&quot;wdk.sign.company&quot;, &quot;tboox.org(test)&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
+    set_values("wdk.sign.store", "PrivateCertStore")
+    set_values("wdk.sign.company", "tboox.org(test)")
 </code></pre>
 <h4 id="releasesign">ReleaseSign</h4>
 <p>We can set a certificate file for release signing.</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;release&quot;)
-    set_values(&quot;wdk.sign.company&quot;, &quot;xxxx&quot;)
-    set_values(&quot;wdk.sign.certfile&quot;, path.join(os.projectdir(), &quot;xxxx.cer&quot;))
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "release")
+    set_values("wdk.sign.company", "xxxx")
+    set_values("wdk.sign.certfile", path.join(os.projectdir(), "xxxx.cer"))
 </code></pre>
 <h3 id="support-low-version-system">Support Low-version System</h3>
 <p>We can set <code>wdk.env.winver</code> to generate a driver package that is compatible with a low version system.</p>
-<pre><code class="lang-lua">set_values(&quot;wdk.env.winver&quot;, &quot;win10&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win10_rs3&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win81&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win8&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp1&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp2&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp3&quot;)
+<pre><code class="lang-lua">set_values("wdk.env.winver", "win10")
+set_values("wdk.env.winver", "win10_rs3")
+set_values("wdk.env.winver", "win81")
+set_values("wdk.env.winver", "win8")
+set_values("wdk.env.winver", "win7")
+set_values("wdk.env.winver", "win7_sp1")
+set_values("wdk.env.winver", "win7_sp2")
+set_values("wdk.env.winver", "win7_sp3")
 </code></pre>
 <p>We can also set windows version for WDK driver program:</p>
 <pre><code class="lang-console">$ xmake f --wdk_winver=[win10_rs3|win8|win7|win7_sp1]
 $ xmake
 </code></pre>
 <h2 id="winsdk-application-program">WinSDK Application Program</h2>
-<pre><code class="lang-lua">target(&quot;usbview&quot;)
-    add_rules(&quot;win.sdk.application&quot;)
+<pre><code class="lang-lua">target("usbview")
+    add_rules("win.sdk.application")
 
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;)
-    add_files(&quot;xmlhelper.cpp&quot;, {rule = &quot;win.sdk.dotnet&quot;})
+    add_files("*.c", "*.rc")
+    add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
 </code></pre>
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/173">#173</a>.</p>
 <h2 id="mfc-application-program">MFC Application Program</h2>
 <h3 id="mfc-static-library">MFC Static Library</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;win.sdk.mfc.static&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("win.sdk.mfc.static")
+    add_files("src/*.c")
 </code></pre>
 <h3 id="mfc-shared-library">MFC Shared Library</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;win.sdk.mfc.shared&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("win.sdk.mfc.shared")
+    add_files("src/*.c")
 </code></pre>
 <h3 id="mfc-application-static-">MFC Application (Static)</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;win.sdk.mfc.static_app&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("win.sdk.mfc.static_app")
+    add_files("src/*.c")
 </code></pre>
 <h3 id="mfc-application-shared-">MFC Application (Shared)</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;win.sdk.mfc.shared_app&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("win.sdk.mfc.shared_app")
+    add_files("src/*.c")
 </code></pre>
 <h2 id="ios-macos-program">iOS/MacOS Program</h2>
 <h3 id="application">Application</h3>
 <p>Generate <em>.app/</em>.ipa application and supports iOS/MacOS.</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.application&quot;)
-    add_files(&quot;src/*.m&quot;, &quot;src/**.storyboard&quot;, &quot;src/*.xcassets&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.application")
+    add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
+    add_files("src/Info.plist")
 </code></pre>
 <h4 id="create-project">Create Project</h4>
 <p>We can also quickly create project through template:</p>
@@ -428,32 +428,32 @@ $ xmake
 $ xmake
 </code></pre>
 <p>If it is cumbersome to configure the signature every time, you can set it to the <code>xmake global</code> global configuration, or you can set it separately for each target in xmake.lua:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.application&quot;)
-    add_files(&quot;src/*.m&quot;, &quot;src/**.storyboard&quot;, &quot;src/*.xcassets&quot;)
-    add_files(&quot;src/Info.plist&quot;)
-    add_values(&quot;xcode.bundle_identifier&quot;, &quot;org.tboox.test&quot;)
-    add_values(&quot;xcode.codesign_identity&quot;, &quot;Apple Development: [email protected] (T3NA4MRVPU)&quot;)
-    add_values(&quot;xcode.mobile_provision&quot;, &quot;iOS Team Provisioning Profile: org.tboox.test&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.application")
+    add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
+    add_files("src/Info.plist")
+    add_values("xcode.bundle_identifier", "org.tboox.test")
+    add_values("xcode.codesign_identity", "Apple Development: [email protected] (T3NA4MRVPU)")
+    add_values("xcode.mobile_provision", "iOS Team Provisioning Profile: org.tboox.test")
 </code></pre>
 <p>How do we know the signature configuration we need? One is to view it in xcode. In addition, xmake also provides some auxiliary tools to dump all currently available signature configurations:</p>
 <pre><code class="lang-console">$ xmake l private.tools.codesign.dump
 ==================================== codesign identities ====================================
 { 
-  &quot;Apple Development: [email protected] (T3NA4MRVPU)&quot; = &quot;AF73C231A0C35335B72761BD3759694739D34EB1&quot; 
+  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1" 
 }
 
 ===================================== mobile provisions =====================================
 { 
-  &quot;iOS Team Provisioning Profile: org.tboox.test&quot; = &quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
-&lt;plist version=&quot;1.0&quot;&gt;
-&lt;dict&gt;
-    &lt;key&gt;AppIDName&lt;/key&gt;
-    &lt;string&gt;XC org tboox test&lt;/string&gt;
-    &lt;key&gt;ApplicationIdentifierPrefix&lt;/key&gt;
-    &lt;array&gt;
-    &lt;string&gt;43AAQM58X3&lt;/string&gt;
+  "iOS Team Provisioning Profile: org.tboox.test" = "<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>AppIDName</key>
+    <string>XC org tboox test</string>
+    <key>ApplicationIdentifierPrefix</key>
+    <array>
+    <string>43AAQM58X3</string>
 ...
 </code></pre>
 <p>We also provide other auxiliary tools to re-sign existing ipa / app programs, for example:</p>
@@ -461,8 +461,8 @@ $ xmake
 </code></pre>
 <p>Among them, the following signature parameters are optional, if not set, then a valid signature will be detected by default:</p>
 <pre><code class="lang-console">$ xmake l utils.ipa.resign test.ipa
-$ xmake l utils.ipa.resign test.app &quot;Apple Development: [email protected] (T3NA4MRVPU)&quot;
-$ xmake l utils.ipa.resign test.ipa &quot;Apple Development: [email protected] (T3NA4MRVPU)&quot; iOS Team Provisioning Profile: org.tboox.test&quot; org.tboox.test
+$ xmake l utils.ipa.resign test.app "Apple Development: [email protected] (T3NA4MRVPU)"
+$ xmake l utils.ipa.resign test.ipa "Apple Development: [email protected] (T3NA4MRVPU)" iOS Team Provisioning Profile: org.tboox.test" org.tboox.test
 </code></pre>
 <h4 id="run-the-application">Run the application</h4>
 <p>Currently only supports running macos program:</p>
@@ -488,55 +488,55 @@ package ok!
 $ xmake l utils.ipa.install test.ipa
 </code></pre>
 <h4 id="uninstall">Uninstall</h4>
-<p>!&gt; Currently only the macos program is supported</p>
+<p>!> Currently only the macos program is supported</p>
 <pre><code class="lang-console">$ xmake uninstall
 </code></pre>
 <h3 id="framework-program">Framework Program</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.framework&quot;)
-    add_files(&quot;src/*.m&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.framework")
+    add_files("src/*.m")
+    add_files("src/Info.plist")
 </code></pre>
 <p>We can also quickly create project through template:</p>
 <pre><code class="lang-console">$ xmake create -t xcode.framework -l objc test
 </code></pre>
 <h3 id="bundle-program">Bundle Program</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.bundle&quot;)
-    add_files(&quot;src/*.m&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.bundle")
+    add_files("src/*.m")
+    add_files("src/Info.plist")
 </code></pre>
 <p>We can also quickly create project through template:</p>
 <pre><code class="lang-console">$ xmake create -t xcode.bundle -l objc test
 </code></pre>
 <h2 id="protobuf-program">Protobuf program</h2>
 <h3 id="using-c-library">Using c library</h3>
-<pre><code class="lang-lua">add_requires(&quot;protobuf-c&quot;)
+<pre><code class="lang-lua">add_requires("protobuf-c")
 
-target(&quot;console_c&quot;)
-     set_kind(&quot;binary&quot;)
-     add_packages(&quot;protobuf-c&quot;)
+target("console_c")
+     set_kind("binary")
+     add_packages("protobuf-c")
 
-     add_files(&quot;src/*.c&quot;)
-     add_files(&quot;src/*.proto&quot;, {rules = &quot;protobuf.c&quot;})
+     add_files("src/*.c")
+     add_files("src/*.proto", {rules = "protobuf.c"})
 </code></pre>
 <h3 id="using-the-c-library">Using the C++ library</h3>
-<pre><code class="lang-lua">add_requires(&quot;protobuf-cpp&quot;)
+<pre><code class="lang-lua">add_requires("protobuf-cpp")
 
-target(&quot;console_c++&quot;)
-     set_kind(&quot;binary&quot;)
-     set_languages(&quot;c++11&quot;)
+target("console_c++")
+     set_kind("binary")
+     set_languages("c++11")
 
-     add_packages(&quot;protobuf-cpp&quot;)
+     add_packages("protobuf-cpp")
 
-     add_files(&quot;src/*.cpp&quot;)
-     add_files(&quot;src/*.proto&quot;, {rules = &quot;protobuf.cpp&quot;})
+     add_files("src/*.cpp")
+     add_files("src/*.proto", {rules = "protobuf.cpp"})
 </code></pre>
 <h2 id="lexyacc-program">Lex&amp;Yacc Program</h2>
-<pre><code class="lang-lua">target(&quot;calc&quot;)
-     set_kind(&quot;binary&quot;)
-     add_rules(&quot;lex&quot;, &quot;yacc&quot;)
-     add_files(&quot;src/*.l&quot;, &quot;src/*.y&quot;)
+<pre><code class="lang-lua">target("calc")
+     set_kind("binary")
+     add_rules("lex", "yacc")
+     add_files("src/*.l", "src/*.y")
 </code></pre>
 </article>
 </body>

+ 10 - 10
mirror/guide/quickstart.html

@@ -102,9 +102,9 @@
 └── xmake.lua
 </code></pre><p>It is a simple console program only for printing <code>hello xmake!</code></p>
 <p>The content of <code>xmake.lua</code> is very simple:</p>
-<pre><code class="lang-lua">target(&quot;hello&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
+<pre><code class="lang-lua">target("hello")
+    set_kind("binary")
+    add_files("src/*.c") 
 </code></pre>
 <p>Support languages:</p>
 <ul>
@@ -117,7 +117,7 @@
 <li>golang</li>
 <li>rust</li>
 </ul>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    If you want to known more options, please run: <code>xmake create --help</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    If you want to known more options, please run: <code>xmake create --help</code><br></p>
 
 </p>
 <h2 id="build-project">Build Project</h2>
@@ -130,7 +130,7 @@
 <pre><code class="lang-bash">$ xmake run -d hello 
 </code></pre>
 <p>It will start the debugger (.e.g lldb, gdb, windbg, vsjitdebugger, ollydbg ..) to load our program.</p>
-<pre><code class="lang-bash">[lldb]$target create &quot;build/hello&quot;
+<pre><code class="lang-bash">[lldb]$target create "build/hello"
 Current executable set to &#39;build/hello&#39; (x86_64).
 [lldb]$b main
 Breakpoint 1: where = hello`main, address = 0x0000000100000f50
@@ -140,13 +140,13 @@ Process 7509 stopped
 * thread #1: tid = 0x435a2, 0x0000000100000f50 hello`main, queue = &#39;com.apple.main-thread&#39;, stop reason = breakpoint 1.1
     frame #0: 0x0000000100000f50 hello`main
 hello`main:
--&gt;  0x100000f50 &lt;+0&gt;:  pushq  %rbp
-    0x100000f51 &lt;+1&gt;:  movq   %rsp, %rbp
-    0x100000f54 &lt;+4&gt;:  leaq   0x2b(%rip), %rdi          ; &quot;hello world!&quot;
-    0x100000f5b &lt;+11&gt;: callq  0x100000f64               ; symbol stub for: puts
+->  0x100000f50 <+0>:  pushq  %rbp
+    0x100000f51 <+1>:  movq   %rsp, %rbp
+    0x100000f54 <+4>:  leaq   0x2b(%rip), %rdi          ; "hello world!"
+    0x100000f5b <+11>: callq  0x100000f64               ; symbol stub for: puts
 [lldb]$
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    You can also use short command option, for example: <code>xmake r</code> or <code>xmake run</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    You can also use short command option, for example: <code>xmake r</code> or <code>xmake run</code><br></p>
 
 </p>
 </article>

+ 135 - 135
mirror/guide/syntax_description.html

@@ -92,9 +92,9 @@
 </style>
     <p>xmake&#39;s project description file xmake.lua is based on the lua syntax, but in order to make the project build logic more convenient and concise, xmake encapsulates it, making writing xmake.lua not as cumbersome as some makefiles.</p>
 <p>Basically write a simple project build description, just three lines, for example:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <h2 id="configuration-separation">Configuration Separation</h2>
 <p>Xmake.lua uses the 28th principle to implement a two-layer separate configuration of the description domain and the script domain.</p>
@@ -103,61 +103,61 @@
 <p>Therefore, xmake isolates 80% of simple configuration and 20% of complex configuration by describing two different configurations of domain and script domain, making the whole xmake.lua look very clear and intuitive, readable and maintainable. Get the best.</p>
 <h3 id="description-scope">Description Scope</h3>
 <p>for beginners who are just getting started, or just to maintain some simple small projects, the requirements are fully met by describing the configuration completely. What is the description domain? It looks like this:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;DEBUG&quot;)
-    add_syslinks(&quot;pthread&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("DEBUG")
+    add_syslinks("pthread")
 </code></pre>
 <p>At first glance, it is actually a configuration set of <code>set_xxx</code>/<code>add_xxx</code>. for the novice, you can not use it as a lua script, just as an ordinary, but there are some basic rules configuration files.</p>
 <p>if, by looking, there are parentheses, or function calls like scripting languages, then we can also write this (whether with parentheses to see personal preferences):</p>
-<pre><code class="lang-lua">target &quot;test&quot;
-    set_kind &quot;binary&quot;
-    add_files &quot;src/*.c&quot;
-    add_defines &quot;DEBUG&quot;
-    add_syslinks &quot;pthread&quot;
+<pre><code class="lang-lua">target "test"
+    set_kind "binary"
+    add_files "src/*.c"
+    add_defines "DEBUG"
+    add_syslinks "pthread"
 </code></pre>
 <p>Is this looking more like a profile? In fact, the description field is a configuration file, similar to the configuration of keys/values such as json, so even if you are not a newcomer to lua, you can quickly get started.</p>
 <p>Moreover, for the usual projects, only the various settings of the project are configured by <code>set_xxx/add_xxx</code>, which has fully met the requirements.</p>
 <p>This is what I said at the beginning: 80% of the time, you can use the simplest configuration rules to simplify the configuration of the project, improve readability and maintainability, so that users and developers will be very friendly and more intuitive.</p>
 <p>What if we want to make some conditional judgments for different platforms and architectures? It doesn&#39;t matter, the description field is in addition to the basic configuration, it also supports conditional judgment, as well as the for loop:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;DEBUG&quot;)
-    if is_plat(&quot;linux&quot;, &quot;macosx&quot;) then
-        add_links(&quot;pthread&quot;, &quot;m&quot;, &quot;dl&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("DEBUG")
+    if is_plat("linux", "macosx") then
+        add_links("pthread", "m", "dl")
     end
 </code></pre>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;DEBUG&quot;)
-    for _, name in ipairs({&quot;pthread&quot;, &quot;m&quot;, &quot;dl&quot;}) do
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("DEBUG")
+    for _, name in ipairs({"pthread", "m", "dl"}) do
         add_links(name)
     end
 </code></pre>
 <p>Is this looking a bit like lua? Although, it can usually be regarded as a common configuration problem, but xmake is based on lua after all, so the description domain still supports the basic language features of lua.</p>
-<p>!&gt; However, it should be noted that although the description field supports lua script syntax, try not to write too complicated lua scripts in the description field, such as some time-consuming function calls and for loops.</p>
+<p>!> However, it should be noted that although the description field supports lua script syntax, try not to write too complicated lua scripts in the description field, such as some time-consuming function calls and for loops.</p>
 <p>And in the description field, the main purpose is to set the configuration item, so xmake does not completely open all module interfaces, many interfaces are forbidden to be called in the description field.<br>Even open callable interfaces are completely read-only, and time-consuming security interfaces such as <code>os.getenv()</code> read some general system information for configuration logic control.</p>
-<p>!&gt; Also note that xmake.lua is parsed multiple times to resolve different configuration fields at different stages: for example: <code>option()</code>, <code>target()</code>, etc.</p>
+<p>!> Also note that xmake.lua is parsed multiple times to resolve different configuration fields at different stages: for example: <code>option()</code>, <code>target()</code>, etc.</p>
 <p>So, don&#39;t think about writing complex lua scripts in the description field of xmake.lua, and don&#39;t call print in the description field to display the information, because it will be executed multiple times, remember: it will be executed multiple times! ! !</p>
 <h3 id="script-scope">Script Scope</h3>
 <p>Restrict the description field to write complex lua, all kinds of lua modules and interfaces are not used? How to do? This time is the time for the script domain to appear.</p>
 <p>if the user is already fully familiar with xmake&#39;s description domain configuration and feels that some of the special configuration maintenance on the project is not met, then we can do more complex configuration logic in the script domain:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
     on_load(function (target)
-        if is_plat(&quot;linux&quot;, &quot;macosx&quot;) then
-            target:add(&quot;links&quot;, &quot;pthread&quot;, &quot;m&quot;, &quot;dl&quot;)
+        if is_plat("linux", "macosx") then
+            target:add("links", "pthread", "m", "dl")
         end
     end)
     after_build(function (target)
-        Import(&quot;core.project.config&quot;)
+        Import("core.project.config")
         Local targetfile = target:targetfile()
         Os.cp(targetfile, path.join(config.buildir(), path.filename(targetfile)))
-        Print(&quot;build %s&quot;, targetfile)
+        Print("build %s", targetfile)
     end)
 </code></pre>
 <p>As long as it is similar: <code>on_xxx</code>, <code>after_xxx</code>, <code>before_xxx</code>, etc. The script inside the function body belongs to the script field.</p>
@@ -165,11 +165,11 @@
 <p>We can implement any function you want to implement in the script domain, even if you write a separate project.</p>
 <p>for some script fragments, it is not very bloated, such as the above built-in writing is enough, if you need to implement more complex scripts, do not want to be filled in a xmake.lua, you can separate the script into a separate lua file for maintenance.</p>
 <p>E.g:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    on_load(&quot;modules.test.load&quot;)
-    on_install(&quot;modules.test.install&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    on_load("modules.test.load")
+    on_install("modules.test.install")
 </code></pre>
 <p>We can place the custom scripts in the corresponding directory of xmake.lua, and maintain them independently in <code>modules/test/load.lua</code> and <code>modules/test/install.lua</code>.</p>
 <p>In these independent lua scripts, we can also import various built-in modules and custom modules through <a href="/zh-cn/manual/builtin_modules?id=import">import</a>, just like to write lua, java is no different. .</p>
@@ -177,35 +177,35 @@
 <p>In other stages, there are many, such as: <code>on/after/before</code>_<code>build/install/package/run</code>, etc. See the target api manual section later, so I won’t go into details here.</p>
 <h2 id="configuration-type">Configuration Type</h2>
 <p>In the description domain configuration, you can configure the configuration fields and configuration items. In the configuration domain, you can configure various configuration items through the interface of <code>set_xxx</code>/<code>add_xxx</code>.</p>
-<pre><code class="lang-lua">target(&quot;test1&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test1")
+    set_kind("binary")
+    add_files("src/*.c")
 
-target(&quot;test2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("test2")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <p>In the above configuration, the target belongs to the configuration domain, and all the <code>set_xx</code>/<code>add_xxx</code> interface configurations below it belong to the configuration item, which is partially effective for this target.</p>
 <p>We can understand it as a local scope, similar to the block block in c:</p>
-<pre><code>target(&quot;test1&quot;)
+<pre><code>target("test1")
 {
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+    set_kind("binary")
+    add_files("src/*.c")
 }
-target(&quot;test2&quot;)
+target("test2")
 {
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+    set_kind("binary")
+    add_files("src/*.c")
 }
 </code></pre><p>However, in order to simplify the writing, xmake stipulates that each newly defined target field starts, and the last configuration field ends automatically. Of course, if the user feels troubled, you can manually configure the leaving domain:</p>
-<pre><code class="lang-lua">target(&quot;test1&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test1")
+    set_kind("binary")
+    add_files("src/*.c")
 target_end()
 
-target(&quot;test2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("test2")
+    set_kind("binary")
+    add_files("src/*.c")
 target_end()
 </code></pre>
 <h3 id="configuration-scope">Configuration Scope</h3>
@@ -223,11 +223,11 @@ target_end()
 </ul>
 <p>Which ones belong to the outside and which ones belong to the inside? if you look at the comments below, you know what it is:</p>
 <pre><code class="lang-lua">-- external scope
-target(&quot;test&quot;)
+target("test")
 
     -- external scope
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+    set_kind("binary")
+    add_files("src/*.c")
 
     on_run(function ()
         -- Internal scope
@@ -238,7 +238,7 @@ target(&quot;test&quot;)
         end)
 
 -- external scope
-task(&quot;hello&quot;)
+task("hello")
 
     -- external scope
     on_run(function ()
@@ -249,15 +249,15 @@ task(&quot;hello&quot;)
 <h3 id="external-scope">external Scope</h3>
 <p>For most projects, you don&#39;t need complicated engineering descriptions, and you don&#39;t need custom scripting support. You just need a simple <code>set_xxx</code> or <code>add_xxx</code> to meet your needs.</p>
 <p>Then according to the 28th law, 80% of the cases, we only need to write:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;static&quot;)
-    add_files(&quot;src/test/*.c&quot;)
-
-target(&quot;demo&quot;)
-    add_deps(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_links(&quot;test&quot;)
-    add_files(&quot;src/demo/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    add_files("src/test/*.c")
+
+target("demo")
+    add_deps("test")
+    set_kind("binary")
+    add_links("test")
+    add_files("src/demo/*.c")
 </code></pre>
 <p>No complicated api calls, no complicated variable definitions, and if judgments and for loops. It&#39;s succinct and readable. At a glance, it doesn&#39;t matter if you don&#39;t understand lua grammar.</p>
 <p>As a simple description of the syntax, it looks a bit like a function call, you will know how to configure it at a basic point of programming.</p>
@@ -279,12 +279,12 @@ target(&quot;demo&quot;)
 <li>format: format string, short version of string.format</li>
 </ul>
 <p>There are also variable definitions and logical operations that can be used. after all, it is based on lua. The basic syntax is still there. We can switch the compiled files by if:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;static&quot;)
-    if is_plat(&quot;iphoneos&quot;) then
-        add_files(&quot;src/test/ios/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    if is_plat("iphoneos") then
+        add_files("src/test/ios/*.c")
     else
-        add_files(&quot;src/test/*.c&quot;)
+        add_files("src/test/*.c")
     end
 </code></pre>
 <p>It should be noted that the variable definition is divided into global variables and local variables. The local variables are only valid for the current xmake.lua, and do not affect the child xmake.lua.</p>
@@ -294,20 +294,20 @@ local var1 = 0
 -- global variables that affect all subsmake.lua included after includes()
 var2 = 1
 
-includes(&quot;src&quot;)
+includes("src")
 </code></pre>
 <h3 id="internal-scope">Internal Scope</h3>
 <p>Also known as plug-ins, script scope, provide more complex and flexible script support, generally used to write some custom scripts, plug-in development, custom task tasks, custom modules, etc.</p>
 <p>Usually included by <code>function () end</code>, and passed to the <code>on_xxx</code>, <code>before_xxx</code> and <code>after_xxx</code> interfaces, are all self-scoped.</p>
 <p>E.g:</p>
 <pre><code class="lang-lua">-- custom script
-target(&quot;hello&quot;)
+target("hello")
     after_build(function ()
         -- Internal scope
         end)
 
 -- custom tasks, plugins
-task(&quot;hello&quot;)
+task("hello")
     on_run(function ()
         -- Internal scope
         end)
@@ -315,13 +315,13 @@ task(&quot;hello&quot;)
 <p>In this scope, not only can you use most lua apis, but you can also use many extension modules provided by xmake. All extension modules are imported through import.</p>
 <p>For details, please refer to: <a href="/manual/builtin_modules?id=import">import module document</a></p>
 <p>Here we give a simple example, after the compilation is complete, ldid signature on the ios target program:</p>
-<pre><code class="lang-lua">target(&quot;iosdemo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.m&quot;)
+<pre><code class="lang-lua">target("iosdemo")
+    set_kind("binary")
+    add_files("*.m")
     after_build(function (target)
 
         -- Execute signature, if it fails, automatically interrupt, giving a highlight error message
-        os.run(&quot;ldid -S$(projectdir)/entitlements.plist %s&quot;, target:targetfile())
+        os.run("ldid -S$(projectdir)/entitlements.plist %s", target:targetfile())
     end)
 </code></pre>
 <p>It should be noted that in the internal scope, all calls are enabled with the exception catching mechanism. if the operation is wrong, xmake will be automatically interrupted and an error message will be given.</p>
@@ -329,52 +329,52 @@ task(&quot;hello&quot;)
 <h3 id="interface-scope">Interface Scope</h3>
 <p>All descriptions of api settings in the external scope are also scoped. They are called in different places and have different scopes of influence, for example:</p>
 <pre><code class="lang-lua">-- global root scope, affecting all targets, including subproject target settings in includes()
-add_defines(&quot;DEBUG&quot;)
+add_defines("DEBUG")
 
 -- define or enter the demo target scope (support multiple entry to append settings)
-target(&quot;demo&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo")
+    set_kind("shared")
+    add_files("src/*.c")
     -- the current target scope only affects the current target
-    add_defines(&quot;DEBUG2&quot;)
+    add_defines("DEBUG2")
 
 -- option settings, only local settings are supported, not affected by global api settings
-option(&quot;test&quot;)
+option("test")
     -- local scope of the current option
     set_default(false)
 
 -- other target settings, -DDEBUG will also be set
-target(&quot;demo2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo2")
+    set_kind("binary")
+    add_files("src/*.c")
 
 -- re-enter the demo target scope
-target(&quot;demo&quot;)
+target("demo")
     -- append macro definitions, only valid for the current demo target
-    add_defines(&quot;DEBUG3&quot;)
+    add_defines("DEBUG3")
 </code></pre>
 <p>Normally, entering another target/option domain setting will automatically leave the previous target/option field, but sometimes in order to compare some scope pollution, we can show off a domain, for example:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_default(false)
 option_end()
 
-target(&quot;demo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo")
+    set_kind("binary")
+    add_files("src/*.c")
 target_end()
 </code></pre>
 <p>Call <code>option_end()</code>, <code>target_end()</code> to explicitly leave the current target/option field setting.</p>
 <h3 id="scope-indentation">Scope Indentation</h3>
 <p>Indentation in xmake.lua is just a specification for more clear distinction. The current setting is for that scope, although it is ok even if it is not indented, but it is not very readable. .</p>
 <p>e.g:</p>
-<pre><code class="lang-lua">target(&quot;xxxx&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.c&quot;)
+<pre><code class="lang-lua">target("xxxx")
+    set_kind("binary")
+    add_files("*.c")
 </code></pre>
 <p>with</p>
-<pre><code class="lang-lua">target(&quot;xxxx&quot;)
-set_kind(&quot;binary&quot;)
-add_files(&quot;*.c&quot;)
+<pre><code class="lang-lua">target("xxxx")
+set_kind("binary")
+add_files("*.c")
 </code></pre>
 <p>The above two methods are the same in effect, but in understanding, the first one is more intuitive. At first glance, you know that <code>add_files</code> is only set for target, not global.</p>
 <p>Therefore, proper indentation helps to better maintain xmake.lua</p>
@@ -389,61 +389,61 @@ add_files(&quot;*.c&quot;)
       - xmake.lua
 </code></pre><p><code>projectdir/xmake.lua</code> is the project&#39;s root xmake.lua configuration, and <code>src/xmake.lua</code> is a sub-configuration of the project.</p>
 <p><code>projectdir/xmake.lua</code> content:</p>
-<pre><code class="lang-lua">add_defines(&quot;ROOT&quot;)
+<pre><code class="lang-lua">add_defines("ROOT")
 
-target(&quot;test1&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;TEST1&quot;)
+target("test1")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST1")
 
-target(&quot;test2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;TEST2&quot;)
+target("test2")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST2")
 
-Includes(&quot;src&quot;)
+Includes("src")
 </code></pre>
-<p>The global root domain is configured with <code>add_defines(&quot;ROOT&quot;)</code>, which affects all target configurations below, including all target configurations in the sub-xmake.lua of includes, so this is the global total configuration.</p>
-<p>The <code>add_defines(&quot;TEST1&quot;)</code> and <code>add_defines(&quot;TEST2&quot;)</code> in test1/test2 belong to the local configuration and only take effect on the current target.</p>
+<p>The global root domain is configured with <code>add_defines("ROOT")</code>, which affects all target configurations below, including all target configurations in the sub-xmake.lua of includes, so this is the global total configuration.</p>
+<p>The <code>add_defines("TEST1")</code> and <code>add_defines("TEST2")</code> in test1/test2 belong to the local configuration and only take effect on the current target.</p>
 <p><code>src/xmake.lua</code> content:</p>
-<pre><code class="lang-lua">add_defines(&quot;ROOT2&quot;)
+<pre><code class="lang-lua">add_defines("ROOT2")
 
-target(&quot;test3&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;TEST3&quot;)
+target("test3")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST3")
 </code></pre>
-<p>In the <code>src/xmake.lua</code> sub-configuration, there is also a global root domain, configured with <code>add_defines(&quot;ROOT2&quot;)</code>, which belongs to the sub-configuration root domain and only takes effect on all targets in the current sub-xmake.lua. For the target xmake.lua in the lower level includes the target, because previously said, xmake is the configuration inheritance relationship of the tree structure.</p>
+<p>In the <code>src/xmake.lua</code> sub-configuration, there is also a global root domain, configured with <code>add_defines("ROOT2")</code>, which belongs to the sub-configuration root domain and only takes effect on all targets in the current sub-xmake.lua. For the target xmake.lua in the lower level includes the target, because previously said, xmake is the configuration inheritance relationship of the tree structure.</p>
 <p>Therefore, the final configuration results of these targets are:</p>
-<pre><code>target(&quot;test1&quot;): -DROOT -DTEST1
-target(&quot;test2&quot;): -DROOT -DTEST2
-target(&quot;test3&quot;): -DROOT -DROOT2 -DTEST3
+<pre><code>target("test1"): -DROOT -DTEST1
+target("test2"): -DROOT -DTEST2
+target("test3"): -DROOT -DROOT2 -DTEST3
 </code></pre><h2 id="syntax-simplification">Syntax simplification</h2>
 <p>The configuration field syntax of xmake.lua is very flexible and can be used in a variety of complex and flexible configurations in the relevant domain, but for many streamlined small block configurations, this time is slightly redundant:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;)
+<pre><code class="lang-lua">option("test1")
     set_default(true)
     set_showmenu(true)
-    set_description(&quot;test1 option&quot;)
+    set_description("test1 option")
 
-option(&quot;test2&quot;)
+option("test2")
     set_default(true)
     set_showmeu(true)
 
-option(&quot;test3&quot;)
-    set_default(&quot;hello&quot;)
+option("test3")
+    set_default("hello")
 </code></pre>
 <p>xmake 2.2.6 or later, for the above small block option domain settings, we can simplify the description into a single line:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;, {default = true, showmenu = true, description = &quot;test1 option&quot;})
-option(&quot;test2&quot;, {default = true, showmenu = true})
-option(&quot;test3&quot;, {default = &quot;hello&quot;})
+<pre><code class="lang-lua">option("test1", {default = true, showmenu = true, description = "test1 option"})
+option("test2", {default = true, showmenu = true})
+option("test3", {default = "hello"})
 </code></pre>
 <p>In addition to the option field, this simplified writing is also supported for other domains, such as:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("demo")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <p>Simplified to:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;, {kind = &quot;binary&quot;, files = &quot;src/*.c&quot;})
+<pre><code class="lang-lua">target("demo", {kind = "binary", files = "src/*.c"})
 </code></pre>
 <p>Of course, if the configuration requirements are more complicated, or the original multi-line setting method is more convenient, this depends on your own needs to evaluate which method is used.</p>
 </article>

+ 268 - 268
mirror/index.html

@@ -96,10 +96,10 @@
 <h2 id="installation">Installation</h2>
 <h4 id="master">Master</h4>
 <h4 id="via-curl">via curl</h4>
-<pre><code class="lang-bash">bash &lt;(curl -fsSL https://xmake.io/shget.text)
+<pre><code class="lang-bash">bash <(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h4 id="via-wget">via wget</h4>
-<pre><code class="lang-bash">bash &lt;(wget https://xmake.io/shget.text -O -)
+<pre><code class="lang-bash">bash <(wget https://xmake.io/shget.text -O -)
 </code></pre>
 <h4 id="via-powershell">via powershell</h4>
 <pre><code class="lang-powershell">Invoke-Expression (Invoke-Webrequest &#39;https://xmake.io/psget.text&#39; -UseBasicParsing).Content
@@ -179,9 +179,9 @@ $ xmake update dev
 └── xmake.lua
 </code></pre><p>It is a simple console program only for printing <code>hello xmake!</code></p>
 <p>The content of <code>xmake.lua</code> is very simple:</p>
-<pre><code class="lang-lua">target(&quot;hello&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
+<pre><code class="lang-lua">target("hello")
+    set_kind("binary")
+    add_files("src/*.c") 
 </code></pre>
 <p>Support languages:</p>
 <ul>
@@ -194,7 +194,7 @@ $ xmake update dev
 <li>golang</li>
 <li>rust</li>
 </ul>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    If you want to known more options, please run: <code>xmake create --help</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    If you want to known more options, please run: <code>xmake create --help</code><br></p>
 
 </p>
 <h4 id="build-project">Build Project</h4>
@@ -207,7 +207,7 @@ $ xmake update dev
 <pre><code class="lang-bash">$ xmake run -d hello 
 </code></pre>
 <p>It will start the debugger (.e.g lldb, gdb, windbg, vsjitdebugger, ollydbg ..) to load our program.</p>
-<pre><code class="lang-bash">[lldb]$target create &quot;build/hello&quot;
+<pre><code class="lang-bash">[lldb]$target create "build/hello"
 Current executable set to &#39;build/hello&#39; (x86_64).
 [lldb]$b main
 Breakpoint 1: where = hello`main, address = 0x0000000100000f50
@@ -217,41 +217,41 @@ Process 7509 stopped
 * thread #1: tid = 0x435a2, 0x0000000100000f50 hello`main, queue = &#39;com.apple.main-thread&#39;, stop reason = breakpoint 1.1
     frame #0: 0x0000000100000f50 hello`main
 hello`main:
--&gt;  0x100000f50 &lt;+0&gt;:  pushq  %rbp
-    0x100000f51 &lt;+1&gt;:  movq   %rsp, %rbp
-    0x100000f54 &lt;+4&gt;:  leaq   0x2b(%rip), %rdi          ; &quot;hello world!&quot;
-    0x100000f5b &lt;+11&gt;: callq  0x100000f64               ; symbol stub for: puts
+->  0x100000f50 <+0>:  pushq  %rbp
+    0x100000f51 <+1>:  movq   %rsp, %rbp
+    0x100000f54 <+4>:  leaq   0x2b(%rip), %rdi          ; "hello world!"
+    0x100000f5b <+11>: callq  0x100000f64               ; symbol stub for: puts
 [lldb]$
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    You can also use short command option, for exmaple: <code>xmake r</code> or <code>xmake run</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    You can also use short command option, for exmaple: <code>xmake r</code> or <code>xmake run</code><br></p>
 
 </p>
 <h2 id="project-examples">Project Examples</h2>
 <h4 id="executable-program">Executable Program</h4>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*c")
 </code></pre>
 <h4 id="static-library-program">Static Library Program</h4>
-<pre><code class="lang-lua">target(&quot;library&quot;)
-    set_kind(&quot;static&quot;)
-    add_files(&quot;src/library/*.c&quot;)
+<pre><code class="lang-lua">target("library")
+    set_kind("static")
+    add_files("src/library/*.c")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
-    add_deps(&quot;library&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*c")
+    add_deps("library")
 </code></pre>
 <p>We use <code>add_deps</code> to link a static library to test target.</p>
 <h4 id="share-library-program">Share Library Program</h4>
-<pre><code class="lang-lua">target(&quot;library&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;src/library/*.c&quot;)
+<pre><code class="lang-lua">target("library")
+    set_kind("shared")
+    add_files("src/library/*.c")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
-    add_deps(&quot;library&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*c")
+    add_deps("library")
 </code></pre>
 <p>We use <code>add_deps</code> to link a share library to test target.</p>
 <h4 id="qt-program">Qt Program</h4>
@@ -269,36 +269,36 @@ $ xmake create -l c++ -t quickapp_qt test
 </code></pre>
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/160">#160</a>.</p>
 <h5 id="static-library">Static Library</h5>
-<pre><code class="lang-lua">target(&quot;qt_static_library&quot;)
-    add_rules(&quot;qt.static&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("qt_static_library")
+    add_rules("qt.static")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h5 id="shared-library">Shared Library</h5>
-<pre><code class="lang-lua">target(&quot;qt_shared_library&quot;)
-    add_rules(&quot;qt.shared&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("qt_shared_library")
+    add_rules("qt.shared")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h5 id="console-program">Console Program</h5>
-<pre><code class="lang-lua">target(&quot;qt_console&quot;)
-    add_rules(&quot;qt.console&quot;)
-    add_files(&quot;src/*.cpp&quot;)
+<pre><code class="lang-lua">target("qt_console")
+    add_rules("qt.console")
+    add_files("src/*.cpp")
 </code></pre>
 <h5 id="quick-application">Quick Application</h5>
-<pre><code class="lang-lua">target(&quot;qt_quickapp&quot;)
-    add_rules(&quot;qt.application&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/qml.qrc&quot;)
-    add_frameworks(&quot;QtQuick&quot;)
+<pre><code class="lang-lua">target("qt_quickapp")
+    add_rules("qt.application")
+    add_files("src/*.cpp") 
+    add_files("src/qml.qrc")
+    add_frameworks("QtQuick")
 </code></pre>
 <h5 id="widgets-application">Widgets Application</h5>
-<pre><code class="lang-lua">target(&quot;qt_widgetapp&quot;)
-    add_rules(&quot;qt.application&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;)  -- add files with Q_OBJECT meta (only for qt.moc)
-    add_frameworks(&quot;QtWidgets&quot;)
+<pre><code class="lang-lua">target("qt_widgetapp")
+    add_rules("qt.application")
+    add_files("src/*.cpp") 
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- add files with Q_OBJECT meta (only for qt.moc)
+    add_frameworks("QtWidgets")
 </code></pre>
 <h5 id="android-application">Android Application</h5>
 <p>After the 2.2.6 version, you can directly switch to the android platform to compile the Quick/Widgets application, generate the apk package, and install it to the device via the <code>xmake install</code> command.</p>
@@ -325,15 +325,15 @@ $ cd test
 $ xmake
 </code></pre>
 <pre><code class="lang-lua">-- define target
-target(&quot;cuda_console&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.cu&quot;)
+target("cuda_console")
+    set_kind("binary")
+    add_files("src/*.cu")
     -- generate SASS code for SM architecture of current host
-    add_cugencodes(&quot;native&quot;)
+    add_cugencodes("native")
     -- generate PTX code for the virtual architecture to guarantee compatibility
-    add_cugencodes(&quot;compute_30&quot;)
+    add_cugencodes("compute_30")
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>Starting with v2.2.7, the default build will enable device-link. (see <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>If you want to disable device-link, you can set it with <code>add_values(&quot;cuda.devlink&quot;, false)</code>.<br>&lt;/p&gt;
+<p><p class="tip"><br>Starting with v2.2.7, the default build will enable device-link. (see <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>If you want to disable device-link, you can set it with <code>add_values("cuda.devlink", false)</code>.<br></p>
 
 </p>
 <p>xmake will detect Cuda SDK automatically and we can also set the SDK directory manually.</p>
@@ -343,49 +343,49 @@ $ xmake
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/158">#158</a>.</p>
 <h4 id="wdk-driver-program">WDK Driver Program</h4>
 <p>xmake will detect WDK automatically and we can also set the WDK directory manually.</p>
-<pre><code class="lang-console">$ xmake f --wdk=&quot;G:\Program Files\Windows Kits\10&quot; -c
+<pre><code class="lang-console">$ xmake f --wdk="G:\Program Files\Windows Kits\10" -c
 $ xmake
 </code></pre>
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/159">#159</a>.</p>
 <h5 id="umdf-driver-program">UMDF Driver Program</h5>
-<pre><code class="lang-lua">target(&quot;echo&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;driver/*.c&quot;) 
-    add_files(&quot;driver/*.inx&quot;)
-    add_includedirs(&quot;exe&quot;)
+<pre><code class="lang-lua">target("echo")
+    add_rules("wdk.driver", "wdk.env.umdf")
+    add_files("driver/*.c") 
+    add_files("driver/*.inx")
+    add_includedirs("exe")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;exe/*.cpp&quot;) 
+target("app")
+    add_rules("wdk.binary", "wdk.env.umdf")
+    add_files("exe/*.cpp") 
 </code></pre>
 <h5 id="kmdf-driver-program">KMDF Driver Program</h5>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.kmdf&quot;)
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;driver/*.rc&quot;)
+<pre><code class="lang-lua">target("nonpnp")
+    add_rules("wdk.driver", "wdk.env.kmdf")
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
+    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.rc")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.kmdf&quot;)
-    add_files(&quot;exe/*.c&quot;) 
-    add_files(&quot;exe/*.inf&quot;)
+target("app")
+    add_rules("wdk.binary", "wdk.env.kmdf")
+    add_files("exe/*.c") 
+    add_files("exe/*.inf")
 </code></pre>
 <h5 id="wdm-driver-program">WDM Driver Program</h5>
-<pre><code class="lang-lua">target(&quot;kcs&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    add_values(&quot;wdk.man.flags&quot;, &quot;-prefix Kcs&quot;)
-    add_values(&quot;wdk.man.resource&quot;, &quot;kcsCounters.rc&quot;)
-    add_values(&quot;wdk.man.header&quot;, &quot;kcsCounters.h&quot;)
-    add_values(&quot;wdk.man.counter_header&quot;, &quot;kcsCounters_counters.h&quot;)
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;, &quot;*.man&quot;) 
-</code></pre>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TracePrint((LEVEL,FLAGS,MSG,...))&quot;)
-    add_files(&quot;*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;*.rc&quot;, &quot;*.inf&quot;)
-    add_files(&quot;*.mof|msdsm.mof&quot;)
-    add_files(&quot;msdsm.mof&quot;, {values = {wdk_mof_header = &quot;msdsmwmi.h&quot;}}) 
+<pre><code class="lang-lua">target("kcs")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    add_values("wdk.man.flags", "-prefix Kcs")
+    add_values("wdk.man.resource", "kcsCounters.rc")
+    add_values("wdk.man.header", "kcsCounters.h")
+    add_values("wdk.man.counter_header", "kcsCounters_counters.h")
+    add_files("*.c", "*.rc", "*.man") 
+</code></pre>
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
+    add_files("*.c", {rule = "wdk.tracewpp"}) 
+    add_files("*.rc", "*.inf")
+    add_files("*.mof|msdsm.mof")
+    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}}) 
 </code></pre>
 <h5 id="package-driver">Package Driver</h5>
 <p>We can run the following command to generate a .cab driver package.</p>
@@ -400,68 +400,68 @@ $ xmake [p|package] -o outputdir
        - debug/x86/sampledsm.cab
        - release/x64/sampledsm.cab
 </code></pre><h5 id="driver-signing">Driver Signing</h5>
-<p>The driver signing is disabled when we compile driver in default case,<br>but we can add <code>set_values(&quot;wdk.sign.mode&quot;)</code> to enable test/release sign.</p>
+<p>The driver signing is disabled when we compile driver in default case,<br>but we can add <code>set_values("wdk.sign.mode")</code> to enable test/release sign.</p>
 <h6 id="testsign">TestSign</h6>
 <p>We can use test certificate of xmake to do testsign, but please run <code>$xmake l utils.wdk.testcert</code> install as admin to install a test certificate first (only once)!</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
 </code></pre>
 <p>Or we set a valid certificate thumbprint to do it in local machine.</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
-    set_values(&quot;wdk.sign.thumbprint&quot;, &quot;032122545DCAA6167B1ADBE5F7FDF07AE2234AAA&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
+    set_values("wdk.sign.thumbprint", "032122545DCAA6167B1ADBE5F7FDF07AE2234AAA")
 </code></pre>
 <p>We can also do testsign via setting store/company info.</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
-    set_values(&quot;wdk.sign.store&quot;, &quot;PrivateCertStore&quot;)
-    set_values(&quot;wdk.sign.company&quot;, &quot;tboox.org(test)&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
+    set_values("wdk.sign.store", "PrivateCertStore")
+    set_values("wdk.sign.company", "tboox.org(test)")
 </code></pre>
 <h6 id="releasesign">ReleaseSign</h6>
 <p>We can set a certificate file for release signing.</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;release&quot;)
-    set_values(&quot;wdk.sign.company&quot;, &quot;xxxx&quot;)
-    set_values(&quot;wdk.sign.certfile&quot;, path.join(os.projectdir(), &quot;xxxx.cer&quot;))
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "release")
+    set_values("wdk.sign.company", "xxxx")
+    set_values("wdk.sign.certfile", path.join(os.projectdir(), "xxxx.cer"))
 </code></pre>
 <h5 id="support-low-version-system">Support Low-version System</h5>
 <p>We can set <code>wdk.env.winver</code> to generate a driver package that is compatible with a low version system.</p>
-<pre><code class="lang-lua">set_values(&quot;wdk.env.winver&quot;, &quot;win10&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win10_rs3&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win81&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win8&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp1&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp2&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp3&quot;)
+<pre><code class="lang-lua">set_values("wdk.env.winver", "win10")
+set_values("wdk.env.winver", "win10_rs3")
+set_values("wdk.env.winver", "win81")
+set_values("wdk.env.winver", "win8")
+set_values("wdk.env.winver", "win7")
+set_values("wdk.env.winver", "win7_sp1")
+set_values("wdk.env.winver", "win7_sp2")
+set_values("wdk.env.winver", "win7_sp3")
 </code></pre>
 <p>We can also set windows version for WDK driver program:</p>
 <pre><code class="lang-console">$ xmake f --wdk_winver=[win10_rs3|win8|win7|win7_sp1]
 $ xmake
 </code></pre>
 <h4 id="winsdk-application-program">WinSDK Application Program</h4>
-<pre><code class="lang-lua">target(&quot;usbview&quot;)
-    add_rules(&quot;win.sdk.application&quot;)
+<pre><code class="lang-lua">target("usbview")
+    add_rules("win.sdk.application")
 
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;)
-    add_files(&quot;xmlhelper.cpp&quot;, {rule = &quot;win.sdk.dotnet&quot;})
+    add_files("*.c", "*.rc")
+    add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
 </code></pre>
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/173">#173</a>.</p>
 <h2 id="configuration">Configuration</h2>
 <p>Set compilation configuration before building project with command <code>xmake f|config</code>.</p>
 <p>And if you want to known more options, please run: <code>xmake f --help</code>。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    You can use short or long command option, for exmaple: &lt;br&gt;<br>    <code>xmake f</code> or <code>xmake config</code>.&lt;br&gt;<br>    <code>xmake f -p linux</code> or <code>xmake config --plat=linux</code>.<br>&lt;/p&gt;
+<p><p class="tip"><br>    You can use short or long command option, for exmaple: <br><br>    <code>xmake f</code> or <code>xmake config</code>.<br><br>    <code>xmake f -p linux</code> or <code>xmake config --plat=linux</code>.<br></p>
 
 </p>
 <h4 id="target-platforms">Target Platforms</h4>
 <h5 id="current-host">Current Host</h5>
 <pre><code class="lang-bash">$ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    XMake will detect the current host platform automatically and build project.<br>&lt;/p&gt;
+<p><p class="tip"><br>    XMake will detect the current host platform automatically and build project.<br></p>
 
 </p>
 <h5 id="linux">Linux</h5>
@@ -477,7 +477,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p android --ndk=~/files/android-ndk-r10e/ -a arm64-v8a --bin=~/files/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin
 </code></pre>
 <p>The <a href="#-bin">--bin</a> option is used to set <code>bin</code> directory of toolchains.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>Please attempt to set <code>--arch=</code> option if it had failed to check compiler.<br>&lt;/p&gt;
+<p><p class="tip"><br>Please attempt to set <code>--arch=</code> option if it had failed to check compiler.<br></p>
 
 </p>
 <h5 id="iphoneos">iPhoneOS</h5>
@@ -505,7 +505,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p cross --sdk=/usr/local/arm-xxx-gcc/ [--bin=/sdk/bin] [--cross=arm-linux-]
 $ xmake
 </code></pre>
-<p>For custem cross platform (<code>is_plat(&quot;myplat&quot;)</code>):</p>
+<p>For custem cross platform (<code>is_plat("myplat")</code>):</p>
 <pre><code class="lang-bash">$ xmake f -p myplat --sdk=/usr/local/arm-xxx-gcc/ [--bin=/sdk/bin] [--cross=arm-linux-]
 $ xmake
 </code></pre>
@@ -691,7 +691,7 @@ $ xmake
 </tr>
 </tbody>
 </table>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>if you want to known more options, please run: <code>xmake f --help</code>。<br>&lt;/p&gt;
+<p><p class="tip"><br>if you want to known more options, please run: <code>xmake f --help</code>。<br></p>
 
 </p>
 <h6 id="-sdk">--sdk</h6>
@@ -723,7 +723,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/home/toolchains_sdkdir --bin=/usr/opt/bin
 $ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>Before v2.2.1 version, this parameter name is <code>--toolchains</code>, exists more ambiguous, so we changed to <code>--bin=</code> to set the bin directory.<br>&lt;/p&gt;
+<p><p class="tip"><br>Before v2.2.1 version, this parameter name is <code>--toolchains</code>, exists more ambiguous, so we changed to <code>--bin=</code> to set the bin directory.<br></p>
 
 </p>
 <h6 id="-cross">--cross</h6>
@@ -744,7 +744,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --as=armv7-linux-as
 </code></pre>
 <p>If the &#39;AS&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --as=gcc@/home/xxx/asmips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --as=gcc@/home/xxx/asmips.exe</code><br></p>
 
 </p>
 <h6 id="-cc">--cc</h6>
@@ -754,7 +754,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --cc=armv7-linux-clang
 </code></pre>
 <p>If the &#39;CC&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --cc=gcc@/home/xxx/ccmips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --cc=gcc@/home/xxx/ccmips.exe</code><br></p>
 
 </p>
 <h6 id="-cxx">--cxx</h6>
@@ -764,7 +764,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --cxx=armv7-linux-clang++
 </code></pre>
 <p>If the &#39;CXX&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --cxx=g++@/home/xxx/c++mips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang compiler, .e.g <code>xmake f --cxx=g++@/home/xxx/c++mips.exe</code><br></p>
 
 </p>
 <h6 id="-ld">--ld</h6>
@@ -774,7 +774,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --ld=armv7-linux-clang++
 </code></pre>
 <p>If the &#39;LD&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang linker, .e.g <code>xmake f --ld=g++@/home/xxx/c++mips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang linker, .e.g <code>xmake f --ld=g++@/home/xxx/c++mips.exe</code><br></p>
 
 </p>
 <h6 id="-sh">--sh</h6>
@@ -784,7 +784,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --sh=armv7-linux-clang++
 </code></pre>
 <p>If the &#39;SH&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-gcc/clang linker, .e.g <code>xmake f --sh=g++@/home/xxx/c++mips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-gcc/clang linker, .e.g <code>xmake f --sh=g++@/home/xxx/c++mips.exe</code><br></p>
 
 </p>
 <h6 id="-ar">--ar</h6>
@@ -794,7 +794,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --ar=armv7-linux-ar
 </code></pre>
 <p>If the &#39;AR&#39; environment variable exists, it will use the values specified in the current environment variables.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>We can set a unknown compiler as like-ar archiver, .e.g <code>xmake f --ar=ar@/home/xxx/armips.exe</code><br>&lt;/p&gt;
+<p><p class="tip"><br>We can set a unknown compiler as like-ar archiver, .e.g <code>xmake f --ar=ar@/home/xxx/armips.exe</code><br></p>
 
 </p>
 <h4 id="global-configuration">Global Configuration</h4>
@@ -806,7 +806,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p android
 $ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    You can use short or long command option, for exmaple: <code>xmake g</code> or <code>xmake global</code>.&lt;br&gt;<br>&lt;/p&gt;
+<p><p class="tip"><br>    You can use short or long command option, for exmaple: <code>xmake g</code> or <code>xmake global</code>.<br><br></p>
 
 </p>
 <h4 id="clean-configuration">Clean Configuration</h4>
@@ -821,9 +821,9 @@ $ xmake
 <h2 id="syntax-description">Syntax Description</h2>
 <p>xmake&#39;s project description file xmake.lua is based on the lua syntax, but in order to make the project build logic more convenient and concise, xmake encapsulates it, making writing xmake.lua not as cumbersome as some makefiles.</p>
 <p>Basically write a simple project build description, just three lines, for example:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <h4 id="scope">Scope</h4>
 <p>The description syntax of xmake is divided by scope, which is mainly divided into:</p>
@@ -834,11 +834,11 @@ $ xmake
 </ul>
 <p>Which ones belong to the outside and which ones belong to the inside? if you look at the comments below, you know what it is:</p>
 <pre><code class="lang-lua">-- external scope
-target(&quot;test&quot;)
+target("test")
 
     -- external scope
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+    set_kind("binary")
+    add_files("src/*.c")
 
     on_run(function ()
         -- Internal scope
@@ -849,7 +849,7 @@ target(&quot;test&quot;)
         end)
 
 -- external scope
-task(&quot;hello&quot;)
+task("hello")
 
     -- external scope
     on_run(function ()
@@ -860,15 +860,15 @@ task(&quot;hello&quot;)
 <h5 id="external-scope">external Scope</h5>
 <p>For most projects, you don&#39;t need complicated engineering descriptions, and you don&#39;t need custom scripting support. You just need a simple <code>set_xxx</code> or <code>add_xxx</code> to meet your needs.</p>
 <p>Then according to the 28th law, 80% of the cases, we only need to write:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;static&quot;)
-    add_files(&quot;src/test/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    add_files("src/test/*.c")
 
-target(&quot;demo&quot;)
-    add_deps(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_links(&quot;test&quot;)
-    add_files(&quot;src/demo/*.c&quot;)
+target("demo")
+    add_deps("test")
+    set_kind("binary")
+    add_links("test")
+    add_files("src/demo/*.c")
 </code></pre>
 <p>No complicated api calls, no complicated variable definitions, and if judgments and for loops. It&#39;s succinct and readable. At a glance, it doesn&#39;t matter if you don&#39;t understand lua grammar.</p>
 <p>As a simple description of the syntax, it looks a bit like a function call, you will know how to configure it at a basic point of programming.</p>
@@ -890,12 +890,12 @@ target(&quot;demo&quot;)
 <li>format: format string, short version of string.format</li>
 </ul>
 <p>There are also variable definitions and logical operations that can be used. after all, it is based on lua. The basic syntax is still there. We can switch the compiled files by if:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;static&quot;)
-    if is_plat(&quot;iphoneos&quot;) then
-        add_files(&quot;src/test/ios/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    if is_plat("iphoneos") then
+        add_files("src/test/ios/*.c")
     else
-        add_files(&quot;src/test/*.c&quot;)
+        add_files("src/test/*.c")
     end
 </code></pre>
 <p>It should be noted that the variable definition is divided into global variables and local variables. The local variables are only valid for the current xmake.lua, and do not affect the child xmake.lua.</p>
@@ -905,20 +905,20 @@ local var1 = 0
 -- global variables that affect all subsmake.lua included after includes()
 var2 = 1
 
-Includes(&quot;src&quot;)
+Includes("src")
 </code></pre>
 <h5 id="internal-scope">Internal Scope</h5>
 <p>Also known as plug-ins, script scope, provide more complex and flexible script support, generally used to write some custom scripts, plug-in development, custom task tasks, custom modules, etc.</p>
 <p>Usually included by <code>function () end</code>, and passed to the <code>on_xxx</code>, <code>before_xxx</code> and <code>after_xxx</code> interfaces, are all self-scoped.</p>
 <p>E.g:</p>
 <pre><code class="lang-lua">-- custom script
-target(&quot;hello&quot;)
+target("hello")
     after_build(function ()
         -- Internal scope
         end)
 
 -- custom tasks, plugins
-task(&quot;hello&quot;)
+task("hello")
     on_run(function ()
         -- Internal scope
         end)
@@ -926,13 +926,13 @@ task(&quot;hello&quot;)
 <p>In this scope, not only can you use most lua apis, but you can also use many extension modules provided by xmake. All extension modules are imported through import.</p>
 <p>For details, please refer to: <a href="https://xmake.io/#/zh/manual?id=import">import module document</a></p>
 <p>Here we give a simple example, after the compilation is complete, ldid signature on the ios target program:</p>
-<pre><code class="lang-lua">target(&quot;iosdemo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.m&quot;)
+<pre><code class="lang-lua">target("iosdemo")
+    set_kind("binary")
+    add_files("*.m")
     after_build(function (target)
 
         -- Execute signature, if it fails, automatically interrupt, giving a highlight error message
-        Os.run(&quot;ldid -S$(projectdir)/entitlements.plist %s&quot;, target:targetfile())
+        Os.run("ldid -S$(projectdir)/entitlements.plist %s", target:targetfile())
     end)
 </code></pre>
 <p>It should be noted that in the internal scope, all calls are enabled with the exception catching mechanism. if the operation is wrong, xmake will be automatically interrupted and an error message will be given.</p>
@@ -940,82 +940,82 @@ task(&quot;hello&quot;)
 <h5 id="interface-scope">Interface Scope</h5>
 <p>All descriptions of api settings in the external scope are also scoped. They are called in different places and have different scopes of influence, for example:</p>
 <pre><code class="lang-lua">-- global root scope, affecting all targets, including subproject target settings in includes()
-add_defines(&quot;DEBUG&quot;)
+add_defines("DEBUG")
 
 -- define or enter the demo target scope (support multiple entry to append settings)
-target(&quot;demo&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo")
+    set_kind("shared")
+    add_files("src/*.c")
     -- the current target scope only affects the current target
-    add_defines(&quot;DEBUG2&quot;)
+    add_defines("DEBUG2")
 
 -- option settings, only local settings are supported, not affected by global api settings
-option(&quot;test&quot;)
+option("test")
     -- local scope of the current option
     set_default(false)
 
 -- other target settings, -DDEBUG will also be set
-target(&quot;demo2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo2")
+    set_kind("binary")
+    add_files("src/*.c")
 
 -- re-enter the demo target scope
-target(&quot;demo&quot;)
+target("demo")
     -- append macro definitions, only valid for the current demo target
-    add_defines(&quot;DEBUG3&quot;)
+    add_defines("DEBUG3")
 </code></pre>
 <p>Normally, entering another target/option domain setting will automatically leave the previous target/option field, but sometimes in order to compare some scope pollution, we can show off a domain, for example:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_default(false)
 option_end()
 
-target(&quot;demo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo")
+    set_kind("binary")
+    add_files("src/*.c")
 target_end()
 </code></pre>
 <p>Call <code>option_end()</code>, <code>target_end()</code> to explicitly leave the current target/option field setting.</p>
 <h5 id="scope-indentation">Scope indentation</h5>
 <p>Indentation in xmake.lua is just a specification for more clear distinction. The current setting is for that scope, although it is ok even if it is not indented, but it is not very readable. .</p>
 <p>e.g:</p>
-<pre><code class="lang-lua">target(&quot;xxxx&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.c&quot;)
+<pre><code class="lang-lua">target("xxxx")
+    set_kind("binary")
+    add_files("*.c")
 </code></pre>
 <p>with</p>
-<pre><code class="lang-lua">target(&quot;xxxx&quot;)
-set_kind(&quot;binary&quot;)
-add_files(&quot;*.c&quot;)
+<pre><code class="lang-lua">target("xxxx")
+set_kind("binary")
+add_files("*.c")
 </code></pre>
 <p>The above two methods are the same in effect, but in understanding, the first one is more intuitive. At first glance, you know that <code>add_files</code> is only set for target, not global.</p>
 <p>Therefore, proper indentation helps to better maintain xmake.lua</p>
 <p>Finally attached, tbox&#39;s <a href="https://github.com/tboox/tbox/blob/master/src/tbox/xmake.lua">xmake.lua</a> description, for reference only. .</p>
 <h4 id="syntax-simplification">Syntax simplification</h4>
 <p>The configuration field syntax of xmake.lua is very flexible and can be used in a variety of complex and flexible configurations in the relevant domain, but for many streamlined small block configurations, this time is slightly redundant:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;)
+<pre><code class="lang-lua">option("test1")
     set_default(true)
     set_showmenu(true)
-    set_description(&quot;test1 option&quot;)
+    set_description("test1 option")
 
-option(&quot;test2&quot;)
+option("test2")
     set_default(true)
     set_showmeu(true)
 
-option(&quot;test3&quot;)
-    set_default(&quot;hello&quot;)
+option("test3")
+    set_default("hello")
 </code></pre>
 <p>xmake 2.2.6 or later, for the above small block option domain settings, we can simplify the description into a single line:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;, {default = true, showmenu = true, description = &quot;test1 option&quot;})
-option(&quot;test2&quot;, {default = true, showmenu = true})
-option(&quot;test3&quot;, {default = &quot;hello&quot;})
+<pre><code class="lang-lua">option("test1", {default = true, showmenu = true, description = "test1 option"})
+option("test2", {default = true, showmenu = true})
+option("test3", {default = "hello"})
 </code></pre>
 <p>In addition to the option field, this simplified writing is also supported for other domains, such as:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("demo")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <p>Simplified to:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;, {kind = &quot;binary&quot;, files = &quot;src/*.c&quot;})
+<pre><code class="lang-lua">target("demo", {kind = "binary", files = "src/*.c"})
 </code></pre>
 <p>Of course, if the configuration requirements are more complicated, or the original multi-line setting method is more convenient, this depends on your own needs to evaluate which method is used.</p>
 <h2 id="dependency-package-management">Dependency Package Management</h2>
@@ -1030,11 +1030,11 @@ option(&quot;test3&quot;, {default = &quot;hello&quot;})
 - pcre.pkg
 - ...
 </code></pre><p>If you want the current project to recognize loading these packages, you first need to specify the package directory path, for example:</p>
-<pre><code class="lang-lua">add_packagedirs(&quot;packages&quot;)
+<pre><code class="lang-lua">add_packagedirs("packages")
 </code></pre>
 <p>Once specified, you can add integration package dependencies in the target scope via the <a href="https://xmake.io/#/zh/manual?id=targetadd_packages">add_packages</a> interface, for example:</p>
-<pre><code class="lang-lua">target(&quot;tbox&quot;)
-    add_packages(&quot;zlib&quot;, &quot;polarssl&quot;, &quot;pcre&quot;, &quot;mysql&quot;)
+<pre><code class="lang-lua">target("tbox")
+    add_packages("zlib", "polarssl", "pcre", "mysql")
 </code></pre>
 <p>So how to generate a *.pkg package, if it is based on xmake project, the generation method is very simple, only need:</p>
 <pre><code class="lang-console">$ cd tbox
@@ -1055,25 +1055,25 @@ $ xmake package -o ../test/packages
 <li>pkg-config</li>
 </ul>
 <p>And through the system and third-party package management tools for the installation of the dependency package, and then integrated with xmake, for example, we look for an openssl package:</p>
-<pre><code class="lang-lua">local packages = find_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">local packages = find_packages("openssl", "zlib")
 </code></pre>
 <p>The returned results are as follows:</p>
 <pre><code class="lang-lua">{
-    {links = {&quot;ssl&quot;, &quot;crypto&quot;}, linkdirs = {&quot;/usr/local/lib&quot;}, includedirs = {&quot;/usr/local/include&quot;}},
-    {links = {&quot;z&quot;}, linkdirs = {&quot;/usr/local/lib&quot;}, includedirs = {&quot;/usr/local/include&quot;}}
+    {links = {"ssl", "crypto"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}},
+    {links = {"z"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}}
 }
 </code></pre>
 <p>If the search is successful, return a table containing all the package information, if it fails, return nil</p>
 <p>The return result here can be directly passed as the parameter of <code>target:add</code>, <code>option:add</code>, which is used to dynamically increase the configuration of <code>target/option</code>:</p>
-<pre><code class="lang-lua">option(&quot;zlib&quot;)
+<pre><code class="lang-lua">option("zlib")
     set_showmenu(true)
     before_check(function (option)
-        option:add(find_packages(&quot;openssl&quot;, &quot;zlib&quot;))
+        option:add(find_packages("openssl", "zlib"))
     end)
 </code></pre>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
     on_load(function (target)
-        target:add(find_packages(&quot;openssl&quot;, &quot;zlib&quot;))
+        target:add(find_packages("openssl", "zlib"))
     end)
 </code></pre>
 <p>If third-party tools such as <code>homebrew</code>, <code>pkg-config</code> are installed on the system, then this interface will try to use them to improve the search results.</p>
@@ -1090,30 +1090,30 @@ $ xmake package -o ../test/packages
 </code></pre>
 <h4 id="remote-dependency-mode">Remote dependency mode</h4>
 <p>This has been initially supported after the 2.2.2 version, the usage is much simpler, just set the corresponding dependency package, for example:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;libpng ~1.16&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "libpng ~1.16", "zlib")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("tbox", "libpng", "zlib")
 </code></pre>
 <p>The above <code>add_requires</code> is used to describe the dependencies required by the current project, and <code>add_packages</code> is used to apply dependencies to the test target. Only settings will automatically add links, linkdirs, includedirs, etc.</p>
 <p>Then directly compile:</p>
 <pre><code class="lang-console">$ xmake
 </code></pre>
 <p>xmake will remotely pull the relevant source package, then automatically compile and install, finally compile the project, and link the dependency package. The specific effect is shown in the following figure:</p>
-<p>&lt;img src=&quot;/assets/img/index/package_manage.png&quot; width=&quot;80%&quot; /&gt;</p>
+<p><img src="/assets/img/index/package_manage.png" width="80%" /></p>
 <p>For more information and progress on package dependency management see the related issues: <a href="https://github.com/xmake-io/xmake/issues/69">Remote package management</a></p>
 <h5 id="currently-supported-features">Currently Supported Features</h5>
 <ul>
-<li>Semantic version support, for example: &quot;&gt;= 1.1.0 &lt; 1.2&quot;, &quot;~1.6&quot;, &quot;1.2.x&quot;, &quot;1.*&quot;</li>
+<li>Semantic version support, for example: ">= 1.1.0 < 1.2", "~1.6", "1.2.x", "1.*"</li>
 <li>Provide multi-warehouse management support such as official package warehouse, self-built private warehouse, project built-in warehouse, etc.</li>
 <li>Cross-platform package compilation integration support (packages of different platforms and different architectures can be installed at the same time, fast switching use)</li>
 <li>Debug dependency package support, source code debugging</li>
 </ul>
 <h5 id="dependency-package-processing-mechanism">Dependency Package Processing Mechanism</h5>
 <p>Here we briefly introduce the processing mechanism of the entire dependency package:</p>
-<p>&lt;div align=&quot;center&quot;&gt;<br>&lt;img src=&quot;/assets/img/index/package_arch.png&quot; width=&quot;80%&quot; /&gt;<br>&lt;/div&gt;
+<p><div align="center"><br><img src="/assets/img/index/package_arch.png" width="80%" /><br></div>
 
 </p>
 <ol>
@@ -1122,73 +1122,73 @@ target(&quot;test&quot;)
 <li>Compile the project, and finally automatically link the enabled dependencies</li>
 </ol>
 <h5 id="semantic-version-settings">Semantic Version Settings</h5>
-<p>Xmake&#39;s dependency package management fully supports semantic version selection, for example: &quot;~1.6.1&quot;. For a detailed description of the semantic version, see: <a href="https://semver.org/">https://semver.org/</a></p>
+<p>Xmake&#39;s dependency package management fully supports semantic version selection, for example: "~1.6.1". For a detailed description of the semantic version, see: <a href="https://semver.org/">https://semver.org/</a></p>
 <p>Some semantic versions are written:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;pcre 1.3.x&quot;, &quot;libpng ^1.18&quot;)
-add_requires(&quot;libpng ~1.16&quot;, &quot;zlib 1.1.2 || &gt;=1.2.11 &lt;1.3.0&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "pcre 1.3.x", "libpng ^1.18")
+add_requires("libpng ~1.16", "zlib 1.1.2 || >=1.2.11 <1.3.0")
 </code></pre>
 <p>The semantic version parser currently used by xmake is the <a href="https://github.com/uael/sv">sv</a> library contributed by <a href="https://github.com/uael">uael</a>, which also has a description of the version. For detailed instructions, please refer to the following: <a href="https://github.com/uael/sv#versions">Version Description</a></p>
 <p>Of course, if we have no special requirements for the current version of the dependency package, then we can write directly:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox", "libpng", "zlib")
 </code></pre>
 <p>This will use the latest version of the package known, or the source code compiled by the master branch. If the current package has a git repo address, we can also specify a specific branch version:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox master&quot;)
-add_requires(&quot;tbox dev&quot;)
+<pre><code class="lang-lua">add_requires("tbox master")
+add_requires("tbox dev")
 </code></pre>
 <h5 id="extra-package-information-settings">Extra Package Information Settings</h5>
 <h6 id="optional-package-settings">Optional Package Settings</h6>
 <p>If the specified dependency package is not supported by the current platform, or if the compilation and installation fails, then xmake will compile the error, which is reasonable for some projects that must rely on certain packages to work.<br>However, if some packages are optional dependencies, they can be set to optional packages even if they are not compiled properly.</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {optional = true})
+<pre><code class="lang-lua">add_requires("tbox", {optional = true})
 </code></pre>
 <h6 id="disable-system-library">Disable System Library</h6>
 <p>With the default settings, xmake will first check to see if the system library exists (if no version is required). If the user does not want to use the system library and the library provided by the third-party package management, then you can set:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {system = false})
+<pre><code class="lang-lua">add_requires("tbox", {system = false})
 </code></pre>
 <h6 id="using-the-debug-version-of-the-package">Using the debug version of the package</h6>
 <p>If we want to debug the dependencies at the same time, we can set them to use the debug version of the package (provided that this package supports debug compilation):</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {debug = true})
+<pre><code class="lang-lua">add_requires("tbox", {debug = true})
 </code></pre>
 <p>If the current package does not support debug compilation, you can submit the modified compilation rules in the repository to support the debug, for example:</p>
-<pre><code class="lang-lua">package(&quot;openssl&quot;)
-    on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
-        os.vrun(&quot;./config %s --prefix=\&quot;%s\&quot;&quot;, package:debug() and &quot;--debug&quot; or &quot;&quot;, package:installdir())
-        os.vrun(&quot;make -j4&quot;)
-        os.vrun(&quot;make install&quot;)
+<pre><code class="lang-lua">package("openssl")
+    on_install("linux", "macosx", function (package)
+        os.vrun("./config %s --prefix=\"%s\"", package:debug() and "--debug" or "", package:installdir())
+        os.vrun("make -j4")
+        os.vrun("make install")
     end)
 </code></pre>
 <h6 id="passing-additional-compilation-information-to-the-package">Passing additional compilation information to the package</h6>
 <p>Some packages have various compile options at compile time, and we can pass them in. Of course, the package itself supports:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {configs = {small=true}})
+<pre><code class="lang-lua">add_requires("tbox", {configs = {small=true}})
 </code></pre>
 <p>Pass <code>--small=true</code> to the tbox package so that compiling the installed tbox package is enabled.</p>
 <h5 id="install-third-party-packages">Install third-party packages</h5>
 <p>After version 2.2.5, xmake supports support for dependency libraries in third-party package managers, such as: conan, brew, vcpkg, etc.</p>
 <p>Add a homebrew dependency package:</p>
-<pre><code class="lang-lua">add_requires(&quot;brew::zlib&quot;, {alias = &quot;zlib&quot;}})
-add_requires(&quot;brew::pcre2/libpcre2-8&quot;, {alias = &quot;pcre2&quot;}})
+<pre><code class="lang-lua">add_requires("brew::zlib", {alias = "zlib"}})
+add_requires("brew::pcre2/libpcre2-8", {alias = "pcre2"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;pcre2&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("pcre2", "zlib")
 </code></pre>
 <p>Add a dependency package for vcpkg:</p>
-<pre><code class="lang-lua">add_requires(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+<pre><code class="lang-lua">add_requires("vcpkg::zlib", "vcpkg::pcre2")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("vcpkg::zlib", "vcpkg::pcre2")
 </code></pre>
 <p>Add a conan dependency package:</p>
-<pre><code class="lang-lua">add_requires(&quot;CONAN::zlib/1.2.11@conan/stable&quot;, {alias = &quot;zlib&quot;, debug = true})
-add_requires(&quot;CONAN::OpenSSL/1.0.2n@conan/stable&quot;, {alias = &quot;openssl&quot;, 
-    configs = {options = &quot;OpenSSL:shared=True&quot;}})
+<pre><code class="lang-lua">add_requires("CONAN::zlib/1.2.11@conan/stable", {alias = "zlib", debug = true})
+add_requires("CONAN::OpenSSL/1.0.2n@conan/stable", {alias = "openssl", 
+    configs = {options = "OpenSSL:shared=True"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("openssl", "zlib")
 </code></pre>
 <p>After executing xmake to compile:</p>
 <pre><code class="lang-console">ruki:test_package ruki$ xmake
@@ -1196,12 +1196,12 @@ checking for the architecture ... x86_64
 checking for the Xcode directory ... /Applications/Xcode.app
 checking for the SDK version of Xcode ... 10.14
 note: try installing these packages (pass -y to skip confirm)?
-  -&gt; CONAN::zlib/1.2.11@conan/stable  (debug)
-  -&gt; CONAN::OpenSSL/1.0.2n@conan/stable  
+  -> CONAN::zlib/1.2.11@conan/stable  (debug)
+  -> CONAN::OpenSSL/1.0.2n@conan/stable  
 please input: y (y/n)
 
-  =&gt; installing CONAN::zlib/1.2.11@conan/stable .. ok
-  =&gt; installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
+  => installing CONAN::zlib/1.2.11@conan/stable .. ok
+  => installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
 
 [  0%]: ccache compiling.release src/main.c
 [100%]: linking.release test
@@ -1216,7 +1216,7 @@ please input: y (y/n)
 <pre><code class="lang-console">$ xmake repo --add myrepo [email protected]:myrepo/xmake-repo.git dev
 </code></pre>
 <p>Or we write directly in xmake.lua:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo [email protected]:myrepo/xmake-repo.git")
 </code></pre>
 <p>If we just want to add one or two private packages, this time to build a git repo is too big, we can directly put the package repository into the project, for example:</p>
 <pre><code>projectdir
@@ -1228,35 +1228,35 @@ please input: y (y/n)
     - main.c
   - xmake.lua
 </code></pre><p>The above myrepo directory is your own private package repository, built into your own project, and then add this repository location in xmake.lua:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo myrepo&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo myrepo")
 </code></pre>
 <p>This can be referred to <a href="https://github.com/tboox/benchbox">benchbox</a> project, which has a built-in private repository.</p>
 <p>We can even build a package without directly building a package description into the project xmake.lua, which is useful for relying on one or two packages, for example:</p>
-<pre><code class="lang-lua">package(&quot;libjpeg&quot;)
+<pre><code class="lang-lua">package("libjpeg")
 
-    set_urls(&quot;http://www.ijg.org/files/jpegsrc.$(version).tar.gz&quot;)
+    set_urls("http://www.ijg.org/files/jpegsrc.$(version).tar.gz")
 
-    add_versions(&quot;v9c&quot;, &quot;650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122&quot;)
+    add_versions("v9c", "650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122")
 
-    on_install(&quot;windows&quot;, function (package)
-        os.mv(&quot;jconfig.vc&quot;, &quot;jconfig.h&quot;)
-        os.vrun(&quot;nmake -f makefile.vc&quot;)
-        os.cp(&quot;*.h&quot;, package:installdir(&quot;include&quot;))
-        os.cp(&quot;libjpeg.lib&quot;, package:installdir(&quot;lib&quot;))
+    on_install("windows", function (package)
+        os.mv("jconfig.vc", "jconfig.h")
+        os.vrun("nmake -f makefile.vc")
+        os.cp("*.h", package:installdir("include"))
+        os.cp("libjpeg.lib", package:installdir("lib"))
     end)
 
-    on_install(&quot;macosx&quot;, &quot;linux&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).install(package)
+    on_install("macosx", "linux", function (package)
+        import("package.tools.autoconf").install(package)
     end)
 
 package_end()
 
-add_requires(&quot;libjpeg&quot;)
+add_requires("libjpeg")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;libjpeg&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("libjpeg")
 </code></pre>
 <h5 id="package-management-command-use">Package Management Command Use</h5>
 <p>The package management command <code>$ xmake require</code> can be used to manually display the download, install, uninstall, retrieve, and view package information.</p>
@@ -1264,13 +1264,13 @@ target(&quot;test&quot;)
 <pre><code class="lang-console">$ xmake require tbox
 </code></pre>
 <p>Install the specified version package:</p>
-<pre><code class="lang-console">$ xmake require tbox &quot;~1.6&quot;
+<pre><code class="lang-console">$ xmake require tbox "~1.6"
 </code></pre>
 <p>Force a re-download of the installation and display detailed installation information:</p>
-<pre><code class="lang-console">$ xmake require -f -v tbox &quot;1.5.x&quot;
+<pre><code class="lang-console">$ xmake require -f -v tbox "1.5.x"
 </code></pre>
 <p>Pass additional setup information:</p>
-<pre><code class="lang-console">$ xmake require --extra=&quot;debug=true,config={small=true}&quot; tbox
+<pre><code class="lang-console">$ xmake require --extra="debug=true,config={small=true}" tbox
 </code></pre>
 <p>Install the debug package and pass the compilation configuration information of <code>small=true</code> to the package.</p>
 <h6 id="uninstalling-the-specified-package">Uninstalling the specified package</h6>

File diff suppressed because it is too large
+ 171 - 171
mirror/manual/builtin_modules.html


+ 29 - 29
mirror/manual/builtin_variables.html

@@ -91,23 +91,23 @@
 }
 </style>
     <p>Xmake provides the syntax of <code>$(varname)</code> to support the acquisition of built-in variables, for example:</p>
-<pre><code class="lang-lua">add_cxflags(&quot;-I$(buildir)&quot;)
+<pre><code class="lang-lua">add_cxflags("-I$(buildir)")
 </code></pre>
 <p>It will convert the built-in <code>buildir</code> variable to the actual build output directory when compiling: <code>-I./build</code></p>
 <p>General built-in variables can be used to quickly get and splicing variable strings when passing arguments, for example:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
 
     -- Add source files in the project source directory
-    add_files(&quot;$(projectdir)/src/*.c&quot;)
+    add_files("$(projectdir)/src/*.c")
 
     -- Add a header file search path under the build directory
-    add_includedirs(&quot;$(buildir)/inc&quot;)
+    add_includedirs("$(buildir)/inc")
 </code></pre>
 <p>It can also be used in the module interface of a custom script, for example:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
     on_run(function (target)
         -- Copy the header file in the current script directory to the output directory
-        os.cp(&quot;$(scriptdir)/xxx.h&quot;, &quot;$(buildir)/inc&quot;)
+        os.cp("$(scriptdir)/xxx.h", "$(buildir)/inc")
     end)
 </code></pre>
 <p>All built-in variables can also be retrieved via the <a href="#val">val</a> interface.</p>
@@ -124,75 +124,75 @@
 <tr>
 <td><a href="#varos">$(os)</a></td>
 <td>Get the operating system of the current build platform</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varhost">$(host)</a></td>
 <td>Get native operating system</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#vartmpdir">$(tmpdir)</a></td>
 <td>Get Temporary Directory</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varcurdir">$(curdir)</a></td>
 <td>Get current directory</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varbuildir">$(buildir)</a></td>
 <td>Get the build output directory</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varscriptdir">$(scriptdir)</a></td>
 <td>Get Project Description Script Directory</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="#varglobaldir">$(globaldir)</a></td>
 <td>Get Global Configuration Directory</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varconfigdir">$(configdir)</a></td>
 <td>Get Local Project Configuration Directory</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varprogramdir">$(programdir)</a></td>
 <td>xmake installation script directory</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#varprojectdir">$(projectdir)</a></td>
 <td>Get the project root directory</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varshell">$(shell)</a></td>
 <td>Execute external shell command</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varenv">$(env)</a></td>
 <td>Get external environment variables</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#varreg">$(reg)</a></td>
 <td>Get the value of the windows registry configuration item</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 </tbody>
 </table>
 <p>Of course, this variable mode can also be extended. By default, the <code>xmake f --var=val</code> command can be used to directly obtain the parameters. For example:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_defines(&quot;-DTEST=$(var)&quot;)
+<pre><code class="lang-lua">target("test")
+    add_defines("-DTEST=$(var)")
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>All the parameter values ​​of the <code>xmake f --xxx=...</code> configuration can be obtained through built-in variables, for example: <code>xmake f --arch=x86</code> corresponds to <code>$(arch)</code>, others have <code>$(plat)</code>, <code>$(mode)</code> and so on.<br>What are the specific parameters, you can check it out by <code>xmake f -h</code>.<br>&lt;/p&gt;
+<p><p class="tip"><br>All the parameter values ​​of the <code>xmake f --xxx=...</code> configuration can be obtained through built-in variables, for example: <code>xmake f --arch=x86</code> corresponds to <code>$(arch)</code>, others have <code>$(plat)</code>, <code>$(mode)</code> and so on.<br>What are the specific parameters, you can check it out by <code>xmake f -h</code>.<br></p>
 
 </p>
 <p>Since the support is directly obtained from the configuration options, it is of course convenient to extend the custom options to get the custom variables. For details on how to customize the options, see: <a href="#option">option</a></p>
@@ -231,10 +231,10 @@
 <h4 id="executing-external-shell-commands">Executing external shell commands</h4>
 <p>In addition to the built-in variable handling, xmake also supports the native shell to handle some of the features that xmake does not support.</p>
 <p>For example, there is a need now, I want to use the <code>pkg-config</code> to get the actual third-party link library name when compiling the Linux program, you can do this:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    if is_plat(&quot;linux&quot;) then
-        add_ldflags(&quot;$(shell pkg-config --libs sqlite3)&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    if is_plat("linux") then
+        add_ldflags("$(shell pkg-config --libs sqlite3)")
     end
 </code></pre>
 <p>Of course, xmake has its own automated third library detection mechanism, which generally does not need such trouble, and lua&#39;s own scripting is very good. .</p>
@@ -242,13 +242,13 @@
 <h3 id="var-env-">var.$(env)</h3>
 <h4 id="get-external-environment-variables">Get external environment variables</h4>
 <p>For example, you can get the path in the environment variable:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_includedirs(&quot;$(env PROGRAMFILES)/OpenSSL/inc&quot;)
+<pre><code class="lang-lua">target("test")
+    add_includedirs("$(env PROGRAMFILES)/OpenSSL/inc")
 </code></pre>
 <h3 id="var-reg-">var.$(reg)</h3>
 <h4 id="get-the-value-of-the-windows-registry-configuration-item">Get the value of the windows registry configuration item</h4>
 <p>Get the value of an item in the registry by <code>regpath; name</code>:</p>
-<pre><code class="lang-lua">print(&quot;$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\XXXX;Name)&quot;)
+<pre><code class="lang-lua">print("$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\XXXX;Name)")
 </code></pre>
 </article>
 </body>

+ 62 - 62
mirror/manual/conditions.html

@@ -103,59 +103,59 @@
 <tr>
 <td><a href="#is_os">is_os</a></td>
 <td>Is the current compilation target system?</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_arch">is_arch</a></td>
 <td>Is the current compilation architecture?</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_plat">is_plat</a></td>
 <td>Is the current compilation platform?</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_host">is_host</a></td>
 <td>Is the current compilation host system?</td>
-<td>&gt;= 2.1.4</td>
+<td>>= 2.1.4</td>
 </tr>
 <tr>
 <td><a href="#is_mode">is_mode</a></td>
 <td>Is the current compilation mode?</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_kind">is_kind</a></td>
 <td>Is the current target kind?</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_option">is_option</a></td>
 <td>Is the given options enabled?</td>
-<td>&gt;= 2.0.1 &lt; 2.2.2 deprecated</td>
+<td>>= 2.0.1 < 2.2.2 deprecated</td>
 </tr>
 <tr>
 <td><a href="#is_config">is_config</a></td>
 <td>Is the given config values?</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#has_config">has_config</a></td>
 <td>Is the given configs enabled?</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#has_package">has_package</a></td>
 <td>Is the given dependent package enabled?</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 </tbody>
 </table>
 <h3 id="is_os">is_os</h3>
 <h4 id="is-the-current-compilation-target-system">Is the current compilation target system</h4>
-<pre><code class="lang-lua">if is_os(&quot;ios&quot;) then
-    add_files(&quot;src/xxx/*.m&quot;)
+<pre><code class="lang-lua">if is_os("ios") then
+    add_files("src/xxx/*.m")
 end
 </code></pre>
 <p>Support operation systems:</p>
@@ -170,18 +170,18 @@ end
 <h4 id="is-the-current-compilation-architecture">Is the current compilation architecture</h4>
 <p>You can this api to check the configuration command: <code>xmake f -a armv7</code></p>
 <pre><code class="lang-lua">-- if the current architecture is x86_64 or i386
-if is_arch(&quot;x86_64&quot;, &quot;i386&quot;) then
-    add_files(&quot;src/xxx/*.c&quot;)
+if is_arch("x86_64", "i386") then
+    add_files("src/xxx/*.c")
 end
 
 -- if the current architecture is armv7 or arm64 or armv7s or armv7-a
-if is_arch(&quot;armv7&quot;, &quot;arm64&quot;, &quot;armv7s&quot;, &quot;armv7-a&quot;) then
+if is_arch("armv7", "arm64", "armv7s", "armv7-a") then
     -- ...
 end
 </code></pre>
 <p>And you can also use the wildchard: <code>*</code> to check all matched architectures.</p>
 <pre><code class="lang-lua">-- if the current architecture is arm which contains armv7, arm64, armv7s and armv7-a ...
-if is_arch(&quot;arm*&quot;) then
+if is_arch("arm*") then
     -- ...
 end
 </code></pre>
@@ -189,13 +189,13 @@ end
 <h4 id="is-the-current-compilation-platform">Is the current compilation platform</h4>
 <p>You can this api to check the configuration command: <code>xmake f -p iphoneos</code></p>
 <pre><code class="lang-lua">-- if the current platform is android
-if is_plat(&quot;android&quot;) then
-    add_files(&quot;src/xxx/*.c&quot;)
+if is_plat("android") then
+    add_files("src/xxx/*.c")
 end
 
 -- if the current platform is macosx or iphoneos
-if is_plat(&quot;macosx&quot;, &quot;iphoneos&quot;) then
-    add_frameworks(&quot;Foundation&quot;)
+if is_plat("macosx", "iphoneos") then
+    add_frameworks("Foundation")
 end
 </code></pre>
 <p>Support platforms:</p>
@@ -211,10 +211,10 @@ end
 <h4 id="is-the-current-compilation-host-system">Is the current compilation host system</h4>
 <p>Some compilation platforms can be built on multiple different operating systems, for example: android ndk (on linux, macOS and windows).</p>
 <p>So, we can use this api to determine the current host operating system.</p>
-<pre><code class="lang-lua">if is_host(&quot;windows&quot;) then
-    add_includedirs(&quot;C:\\includes&quot;)
+<pre><code class="lang-lua">if is_host("windows") then
+    add_includedirs("C:\\includes")
 else
-    add_includedirs(&quot;/usr/includess&quot;)
+    add_includedirs("/usr/includess")
 end
 </code></pre>
 <p>Support hosts:</p>
@@ -230,57 +230,57 @@ end
 <p>The compilation mode is not builtin mode for xmake, so you can set the mode value by yourself.</p>
 <p>We often use these configuration values: <code>debug</code>, <code>release</code>, <code>profile</code>, etc.</p>
 <pre><code class="lang-lua">-- if the current compilation mode is debug?
-if is_mode(&quot;debug&quot;) then
+if is_mode("debug") then
 
     -- add macro: DEBUG
-    add_defines(&quot;DEBUG&quot;)
+    add_defines("DEBUG")
 
     -- enable debug symbols
-    set_symbols(&quot;debug&quot;)
+    set_symbols("debug")
 
     -- disable optimization
-    set_optimize(&quot;none&quot;)
+    set_optimize("none")
 
 end
 
 -- if the current compilation mode is release or profile?
-if is_mode(&quot;release&quot;, &quot;profile&quot;) then
+if is_mode("release", "profile") then
 
-    if is_mode(&quot;release&quot;) then
+    if is_mode("release") then
 
         -- mark symbols visibility as hidden
-        set_symbols(&quot;hidden&quot;)
+        set_symbols("hidden")
 
         -- strip all symbols
-        set_strip(&quot;all&quot;)
+        set_strip("all")
 
         -- fomit frame pointer
-        add_cxflags(&quot;-fomit-frame-pointer&quot;)
-        add_mxflags(&quot;-fomit-frame-pointer&quot;)
+        add_cxflags("-fomit-frame-pointer")
+        add_mxflags("-fomit-frame-pointer")
 
     else
 
         -- enable debug symbols
-        set_symbols(&quot;debug&quot;)
+        set_symbols("debug")
 
     end
 
     -- add vectorexts
-    add_vectorexts(&quot;sse2&quot;, &quot;sse3&quot;, &quot;ssse3&quot;, &quot;mmx&quot;)
+    add_vectorexts("sse2", "sse3", "ssse3", "mmx")
 end
 </code></pre>
 <h3 id="is_kind">is_kind</h3>
 <h4 id="is-the-current-target-kind">Is the current target kind</h4>
 <p>You can this api to check the configuration command: <code>xmake f -k [static|shared]</code></p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
 
     -- set target kind from the configuration command
-    set_kind(&quot;$(kind)&quot;)
-    add_files(&quot;src/*c&quot;)
+    set_kind("$(kind)")
+    add_files("src/*c")
 
     -- compile target for static?
-    if is_kind(&quot;static&quot;) then
-        add_files(&quot;src/xxx.c&quot;)
+    if is_kind("static") then
+        add_files("src/xxx.c")
     end
 </code></pre>
 <p>You can switch the target kind by configuration command.</p>
@@ -294,13 +294,13 @@ $ xmake
 </code></pre>
 <h3 id="is_option">is_option</h3>
 <h4 id="is-the-given-options-enabled">Is the given options enabled</h4>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>This interface has been deprecated after v2.2.2, please use <a href="#has_config">has_config</a> instead.<br>&lt;/p&gt;
+<p><p class="tip"><br>This interface has been deprecated after v2.2.2, please use <a href="#has_config">has_config</a> instead.<br></p>
 
 </p>
 <p>You can use this api to check the custom option configuration command:<code>xmake f --xxxx=y</code></p>
 <p>For example, we want to enable the custom option: <code>xmake f --demo=y</code> and check it from <code>xmake.lua</code>.</p>
-<pre><code class="lang-lua">if is_option(&quot;demo&quot;) then
-    add_subdirs(&quot;src/demo&quot;)
+<pre><code class="lang-lua">if is_option("demo") then
+    add_subdirs("src/demo")
 end
 </code></pre>
 <h3 id="is_config">is_config</h3>
@@ -309,21 +309,21 @@ end
 <p>For example:</p>
 <pre><code class="lang-console">$ xmake f --test=hello1
 </code></pre>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    set_showmenu(&quot;true&quot;)
-    set_description(&quot;The test config option&quot;)
+<pre><code class="lang-lua">option("test")
+    set_showmenu("true")
+    set_description("The test config option")
 option_end()
 
-if is_config(&quot;test&quot;, &quot;hello1&quot;, &quot;hello2&quot;) then
-    add_defines(&quot;HELLO&quot;)
+if is_config("test", "hello1", "hello2") then
+    add_defines("HELLO")
 end
 </code></pre>
 <p>Not only that, we can also set pattern matching rules to determine values, such as:</p>
-<pre><code class="lang-lua">if is_config(&quot;test&quot;, &quot;hello.*&quot;) then
-    add_defines(&quot;HELLO&quot;)
+<pre><code class="lang-lua">if is_config("test", "hello.*") then
+    add_defines("HELLO")
 end
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>This interface is not only able to determine the custom options defined through the <a href="#option">option</a>,<br>but also to determine the built-in global and local configuration.<br>&lt;/p&gt;
+<p><p class="tip"><br>This interface is not only able to determine the custom options defined through the <a href="#option">option</a>,<br>but also to determine the built-in global and local configuration.<br></p>
 
 </p>
 <h3 id="has_config">has_config</h3>
@@ -338,8 +338,8 @@ $ xmake f --test1=true
 # set the config value
 $ xmake f --test2=value
 </code></pre>
-<pre><code class="lang-lua">if has_config(&quot;test1&quot;, &quot;test2&quot;) then
-    add_defines(&quot;TEST&quot;)
+<pre><code class="lang-lua">if has_config("test1", "test2") then
+    add_defines("TEST")
 end
 </code></pre>
 <p>And the following configuration will be false:</p>
@@ -348,26 +348,26 @@ $ xmake f --test1=n
 $ xmake f --test1=no
 $ xmake f --test1=false
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>This interface can determine not only the built-in global and local configs,<br>but also the custom options defined through the <a href="#option">option</a>.<br>&lt;/p&gt;
+<p><p class="tip"><br>This interface can determine not only the built-in global and local configs,<br>but also the custom options defined through the <a href="#option">option</a>.<br></p>
 
 </p>
 <h3 id="has_package">has_package</h3>
 <h4 id="is-the-given-dependent-package-enabled-">Is the given dependent package enabled?</h4>
 <p>This interface is introduced from version 2.2.3 to detect whether a dependent package exists or is enabled.</p>
 <p>It is usually used to <a href="/zh-cn/manual/global_interfaces?id=add_requires">add_requires</a>.</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {optional = true})
+<pre><code class="lang-lua">add_requires("tbox", {optional = true})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;tbox&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("tbox")
 
-    if has_package(&quot;tbox&quot;) then
-        add_defines(&quot;HAVE_TBOX&quot;)
+    if has_package("tbox") then
+        add_defines("HAVE_TBOX")
     end
 </code></pre>
 <p>If the remote dependencies are added via the optional add-on package added by <code>add_requires</code>, or the current platform does not support the actual installation, then <code>has_package</code> will return false.<br>Indicates that it does not exist, and then does some special processing for other flags definitions and even source file compilation controls.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>The difference between this interface and <a href="#has_config">has_config</a> is that <a href="#has_config">has_config</a> is used for <a href="#option">option</a> whereas this is used for <a href="#add_requires">add_requires</a>.<br>&lt;/p&gt;
+<p><p class="tip"><br>The difference between this interface and <a href="#has_config">has_config</a> is that <a href="#has_config">has_config</a> is used for <a href="#option">option</a> whereas this is used for <a href="#add_requires">add_requires</a>.<br></p>
 </p>
 </article>
 </body>

+ 137 - 137
mirror/manual/configuration_option.html

@@ -91,22 +91,22 @@
 }
 </style>
     <p>Define and set option switches. Each <code>option</code> corresponds to an option that can be used to customize the build configuration options and switch settings.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>All domain interfaces except <code>target</code>, such as <code>option</code>, <code>task</code>, etc., cannot be placed in the outer global scope by default (unless some interfaces are shared with the target).<br>If you want to set the value to affect all options such as <code>option</code>, <code>task</code>, you can set it by anonymous global domain.<br>&lt;/p&gt;
+<p><p class="tip"><br>All domain interfaces except <code>target</code>, such as <code>option</code>, <code>task</code>, etc., cannot be placed in the outer global scope by default (unless some interfaces are shared with the target).<br>If you want to set the value to affect all options such as <code>option</code>, <code>task</code>, you can set it by anonymous global domain.<br></p>
 
 </p>
 <p>E.g:</p>
 <pre><code class="lang-lua">-- Enter the anonymous global domain of the option, the settings inside will affect the test and test2 options.
 option()
-    add_defines(&quot;DEBUG&quot;)
+    add_defines("DEBUG")
 
-option(&quot;test&quot;)
+option("test")
     -- ...
     -- Try to keep indented, because all settings after this are for the test option.
 
-option(&quot;test2&quot;)
+option("test2")
     -- ...
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>The <code>option</code> field can be repeatedly entered to implement separate settings. If you want to display the scope settings away from the current option, you can manually call the <a href="#option_end">option_end</a> interface.<br>&lt;/p&gt;
+<p><p class="tip"><br>The <code>option</code> field can be repeatedly entered to implement separate settings. If you want to display the scope settings away from the current option, you can manually call the <a href="#option_end">option_end</a> interface.<br></p>
 
 
 </p>
@@ -122,242 +122,242 @@ option(&quot;test2&quot;)
 <tr>
 <td><a href="#option">option</a></td>
 <td>Define Options</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#option_end">option_end</a></td>
 <td>End Definition Options</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_deps">add_deps</a></td>
 <td>Add Options Dependencies</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionbefore_check">before_check</a></td>
 <td>Execute this script before option detection</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionon_check">on_check</a></td>
 <td>Custom Option Detection Script</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionafter_check">after_check</a></td>
 <td>Execute this script after option detection</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionset_values">set_values</a></td>
 <td>Setting the list of option values ​​</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#optionset_default">set_default</a></td>
 <td>Set Defaults</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionset_showmenu">set_showmenu</a></td>
 <td>Set whether to enable menu display</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionset_category">set_category</a></td>
 <td>Set option categories, only for menu display</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionset_description">set_description</a></td>
 <td>Settings Menu Display Description</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_links">add_links</a></td>
 <td>Add Linked Library Detection</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_linkdirs">add_linkdirs</a></td>
 <td>Add a search directory for link library detection</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_rpathdirs">add_rpathdirs</a></td>
 <td>Add runtime dynamic link library search directory</td>
-<td>&gt;= 2.1.3</td>
+<td>>= 2.1.3</td>
 </tr>
 <tr>
 <td><a href="#optionadd_cincludes">add_cincludes</a></td>
 <td>Add c header file detection</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_cxxincludes">add_cxxincludes</a></td>
 <td>Add c++ header file detection</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_ctypes">add_ctypes</a></td>
 <td>Add c type detection</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_cxxtypes">add_cxxtypes</a></td>
 <td>Add c++ type detection</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_csnippet">add_csnippet</a></td>
 <td>Add c-code snippets detection</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionadd_cxxsnippet">add_cxxsnippet</a></td>
 <td>Add c++ code snippet detection</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetset_warnings">set_warnings</a></td>
 <td>Setting the warning level</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetset_optimize">set_optimize</a></td>
 <td>Setting the optimization level</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetset_languages">set_languages</a></td>
 <td>Setting the Code Language Standard</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_includedirs">add_includedirs</a></td>
 <td>Add Header Search Directory</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_defines">add_defines</a></td>
 <td>Add Macro Definition</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_undefines">add_undefines</a></td>
 <td>Cancel Macro Definition</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_defines_h">add_defines_h</a></td>
 <td>Add macro definitions to header files</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_undefines_h">add_undefines_h</a></td>
 <td>Cancel macro definition to header file</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_cflags">add_cflags</a></td>
 <td>Add c Compile Options</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_cxflags">add_cxflags</a></td>
 <td>Add c/c++ Compile Options</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_cxxflags">add_cxxflags</a></td>
 <td>Add c++ Compile Options</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_mflags">add_mflags</a></td>
 <td>Add objc compile options</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_mxflags">add_mxflags</a></td>
 <td>Add objc/objc++ Compile Options</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_mxxflags">add_mxxflags</a></td>
 <td>Add objc++ Compile Options</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_scflags">add_scflags</a></td>
 <td>Add swift compile options</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_asflags">add_asflags</a></td>
 <td>Add assembly compile options</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_gcflags">add_gcflags</a></td>
 <td>Add go compile options</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_dcflags">add_dcflags</a></td>
 <td>Add dlang compile options</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_rcflags">add_rcflags</a></td>
 <td>Add rust compile option</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_cuflags">add_cuflags</a></td>
 <td>Add cuda compile options</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_culdflags">add_culdflags</a></td>
 <td>Add cuda device-link options</td>
-<td>&gt;= 2.2.7</td>
+<td>>= 2.2.7</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_ldflags">add_ldflags</a></td>
 <td>Add Link Options</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_arflags">add_arflags</a></td>
 <td>Add Static Library Archive Options</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_shflags">add_shflags</a></td>
 <td>Add Dynamic Library Link Options</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_languages">add_languages</a></td>
 <td>Add Language Standards</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_vectorexts">add_vectorexts</a></td>
 <td>Add Vector Extension Instructions</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_frameworks">add_frameworks</a></td>
 <td>Add Linked Framework</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_frameworkdirs">add_frameworkdirs</a></td>
 <td>Add Linked Framework</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 </tbody>
 </table>
@@ -365,14 +365,14 @@ option(&quot;test2&quot;)
 <h4 id="defining-options">Defining options</h4>
 <p>Define and set option switches for custom compilation configuration options, switch settings.</p>
 <p>For example, define an option to enable test:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_default(false)
     set_showmenu(true)
-    add_defines(&quot;TEST&quot;)
+    add_defines("TEST")
 </code></pre>
 <p>Then associate it with the specified target:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;)
-    add_options(&quot;test&quot;)
+<pre><code class="lang-lua">target("demo")
+    add_options("test")
 </code></pre>
 <p>Thus, if an option is defined, if this option is enabled, the macro definition of <code>-DTEST</code> will be automatically added when compiling the target.</p>
 <pre><code class="lang-lua"># Manually enable this option
@@ -385,17 +385,17 @@ $ xmake
 <h3 id="option-add_deps">option:add_deps</h3>
 <h4 id="adding-options-depends">Adding options depends</h4>
 <p>By setting the dependency, you can adjust the detection order of the options, which is generally used when the detection script is called by <a href="#optionon_check">on_check</a>.</p>
-<pre><code class="lang-lua">option(&quot;small&quot;)
+<pre><code class="lang-lua">option("small")
     set_default(true)
     on_check(function (option)
         -- ...
     end)
 
-option(&quot;test&quot;)
-    add_deps(&quot;small&quot;)
+option("test")
+    add_deps("small")
     set_default(true)
     on_check(function (option)
-        if option:dep(&quot;small&quot;):enabled() then
+        if option:dep("small"):enabled() then
             option:enable(false)
         end
     end)
@@ -404,20 +404,20 @@ option(&quot;test&quot;)
 <h3 id="option-before_check">option:before_check</h3>
 <p>Execute this script before option detection</p>
 <p>For example: before testing, find the package by <a href="#detect-find_package">find_package</a>, and add information such as <code>links</code>, <code>includedirs</code> and <code>linkdirs</code> to the option.<br>Then start the option detection, and then automatically link to the target after passing.</p>
-<pre><code class="lang-lua">option(&quot;zlib&quot;)
+<pre><code class="lang-lua">option("zlib")
     before_check(function (option)
-        import(&quot;lib.detect.find_package&quot;)
-        option:add(find_package(&quot;zlib&quot;))
+        import("lib.detect.find_package")
+        option:add(find_package("zlib"))
     end)
 </code></pre>
 <h3 id="option-on_check">option:on_check</h3>
 <h4 id="custom-option-detection-script">Custom Option Detection Script</h4>
 <p>This script overrides the built-in option detection logic.</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    add_deps(&quot;small&quot;)
+<pre><code class="lang-lua">option("test")
+    add_deps("small")
     set_default(true)
     on_check(function (option)
-        if option:dep(&quot;small&quot;):enabled() then
+        if option:dep("small"):enabled() then
             option:enable(false)
         end
     end)
@@ -426,9 +426,9 @@ option(&quot;test&quot;)
 <h3 id="option-after_check">option:after_check</h3>
 <p>Execute this script after option detection</p>
 <p>After the option detection is complete, execute this script for some post-processing, or you can re-disable the option at this time:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    add_deps(&quot;small&quot;)
-    add_links(&quot;pthread&quot;)
+<pre><code class="lang-lua">option("test")
+    add_deps("small")
+    add_links("pthread")
     after_check(function (option)
         option:enable(false)
     end)
@@ -436,23 +436,23 @@ option(&quot;test&quot;)
 <h3 id="option-set_values">option:set_values</h3>
 <h4 id="setting-the-list-of-option-values">Setting the list of option values</h4>
 <p>For the graphical menu configuration of <code>xmake f --menu</code> only, a list of option values ​​is provided for quick selection by the user, for example:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    set_default(&quot;b&quot;)
+<pre><code class="lang-lua">option("test")
+    set_default("b")
     set_showmenu(true)
-    set_values(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)
+    set_values("a", "b", "c")
 </code></pre>
 <p>The effect chart is as follows:</p>
-<p>&lt;img src=&quot;/assets/img/manual/option_set_values.png&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/manual/option_set_values.png" width="60%" /></p>
 <h3 id="option-set_default">option:set_default</h3>
 <h4 id="setting-options-defaults">Setting options defaults</h4>
 <p>When the option value is not modified by the command <code>xmake f --option=[y|n}</code>, the option itself has a default value, which can be set through this interface:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     -- This option is disabled by default
     set_default(false)
 </code></pre>
 <p>The value of the option supports not only the boolean type but also the string type, for example:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    set_default(&quot;value&quot;)
+<pre><code class="lang-lua">option("test")
+    set_default("value")
 </code></pre>
 <table>
 <thead>
@@ -478,13 +478,13 @@ option(&quot;test&quot;)
 <p>If it is an option of the <code>boolean</code> value, it can be judged by <a href="#is_option">is_option</a>, and the option is enabled.</p>
 <p>If it is an option of type <code>string</code>, it can be used directly in built-in variables, for example:</p>
 <pre><code class="lang-lua">-- define a path configuration option, using the temporary directory by default
-option(&quot;rootdir&quot;)
-    set_default(&quot;$(tmpdir)&quot;)
+option("rootdir")
+    set_default("$(tmpdir)")
     set_showmenu(true)
 
-target(&quot;test&quot;)
+target("test")
     -- add source files in the specified options directory
-    add_files(&quot;$(rootdir)/*.c&quot;)
+    add_files("$(rootdir)/*.c")
 </code></pre>
 <p>Among them, <code>$(rootdir)</code> is a custom option built-in variable, which can be dynamically modified by manual configuration:</p>
 <pre><code class="lang-bash">$ xmake f --rootdir=~/projectdir/src
@@ -521,7 +521,7 @@ $ xmake
 <h3 id="option-set_showmenu">option:set_showmenu</h3>
 <h4 id="set-whether-to-enable-menu-display">Set whether to enable menu display</h4>
 <p>If set to <code>true</code>, then this option will appear in <code>xmake f --help</code>, which can also be configured via <code>xmake f --optionname=xxx</code>, otherwise it can only be used inside <code>xmake.lua</code> , the modification cannot be configured manually.</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_showmenu(true)
 </code></pre>
 <p>After setting the menu to enable, execute <code>xmake f --help</code> to see that there is one more item in the help menu:</p>
@@ -533,21 +533,21 @@ $ xmake
 <h4 id="setting-option-categories-only-for-menu-display">Setting option categories, only for menu display</h4>
 <p>This is an optional configuration, only used in the help menu, the classification display options, the same category of options, will be displayed in the same group, so the menu looks more beautiful.</p>
 <p>E.g:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;)
+<pre><code class="lang-lua">option("test1")
     set_showmenu(true)
-    set_category(&quot;test&quot;)
+    set_category("test")
 
-option(&quot;test2&quot;)
+option("test2")
     set_showmenu(true)
-    set_category(&quot;test&quot;)
+    set_category("test")
 
-option(&quot;demo1&quot;)
+option("demo1")
     set_showmenu(true)
-    set_category(&quot;demo&quot;)
+    set_category("demo")
 
-option(&quot;demo2&quot;)
+option("demo2")
     set_showmenu(true)
-    set_category(&quot;demo&quot;)
+    set_category("demo")
 </code></pre>
 <p>The four options here are grouped into two groups: <code>test</code> and <code>demo</code>, and the layout shown is similar to this:</p>
 <pre><code class="lang-bash">Options:
@@ -560,31 +560,31 @@ option(&quot;demo2&quot;)
     --demo2=DEMO2
 </code></pre>
 <p>This interface is just to adjust the display layout, more beautiful, no other use.</p>
-<p>In version 2.1.9, the hierarchical path name <code>set_category(&quot;root/submenu/submenu2&quot;)</code> can be set via category to configure the graphical menu interface of <code>xmake f --menu</code>, for example:</p>
+<p>In version 2.1.9, the hierarchical path name <code>set_category("root/submenu/submenu2")</code> can be set via category to configure the graphical menu interface of <code>xmake f --menu</code>, for example:</p>
 <pre><code class="lang-lua">-- &#39;boolean&#39; option
-option(&quot;test1&quot;)
+option("test1")
     set_default(true)
     set_showmenu(true)
-    set_category(&quot;root menu/test1&quot;)
+    set_category("root menu/test1")
 
--- &#39;choice&#39; option with values: &quot;a&quot;, &quot;b&quot;, &quot;c&quot;
-option(&quot;test2&quot;)
-    set_default(&quot;a&quot;)
-    set_values(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)
+-- &#39;choice&#39; option with values: "a", "b", "c"
+option("test2")
+    set_default("a")
+    set_values("a", "b", "c")
     set_showmenu(true)
-    set_category(&quot;root menu/test2&quot;)
+    set_category("root menu/test2")
 
 -- &#39;string&#39; option
-option(&quot;test3&quot;)
-    set_default(&quot;xx&quot;)
+option("test3")
+    set_default("xx")
     set_showmenu(true)
-    set_category(&quot;root menu/test3/test3&quot;)
+    set_category("root menu/test3/test3")
 
 -- &#39;number&#39; option
-option(&quot;test4&quot;)
+option("test4")
     set_default(6)
     set_showmenu(true)
-    set_category(&quot;root menu/test4&quot;)
+    set_category("root menu/test4")
 </code></pre>
 <p>The menu interface path structure finally displayed in the above configuration:</p>
 <ul>
@@ -600,14 +600,14 @@ option(&quot;test4&quot;)
 </li>
 </ul>
 <p>The effect chart is as follows:</p>
-<p>&lt;img src=&quot;/assets/img/manual/option_set_category.gif&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/manual/option_set_category.gif" width="60%" /></p>
 <h3 id="option-set_description">option:set_description</h3>
 <h4 id="setting-menu-display-description">Setting menu display description</h4>
 <p>When the option menu is displayed, the description on the right is used to help the user know more clearly about the purpose of this option, for example:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_default(false)
     set_showmenu(true)
-    set_description(&quot;Enable or disable test&quot;)
+    set_description("Enable or disable test")
 </code></pre>
 <p>The generated menu contents are as follows:</p>
 <pre><code>Options:
@@ -615,13 +615,13 @@ option(&quot;test4&quot;)
 
     --test=TEST Enable or disable test (default: false)
 </code></pre><p>This interface also supports multi-line display and outputs more detailed description information, such as:</p>
-<pre><code class="lang-lua">option(&quot;mode&quot;)
-    set_default(&quot;debug&quot;)
+<pre><code class="lang-lua">option("mode")
+    set_default("debug")
     set_showmenu(true)
-    set_description(&quot;Set build mode&quot;,
-                    &quot; - debug&quot;,
-                    &quot; - release&quot;,
-                    &quot;-profile&quot;)
+    set_description("Set build mode",
+                    " - debug",
+                    " - release",
+                    "-profile")
 </code></pre>
 <p>The generated menu contents are as follows:</p>
 <pre><code>Options:
@@ -636,32 +636,32 @@ option(&quot;test4&quot;)
 </code></pre>
 <h3 id="option-add_bindings">option:add_bindings</h3>
 <h4 id="add-forward-association-option-sync-enable-and-disable">Add forward association option, sync enable and disable</h4>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>After the 2.1.5 version has been deprecated, please use <a href="#optionadd_deps">add_deps</a>, <a href="#optionon_check">on_check</a>, <a href="#optionafter_check">after_check</a> and other interfaces instead.<br>&lt;/p&gt;
+<p><p class="tip"><br>After the 2.1.5 version has been deprecated, please use <a href="#optionadd_deps">add_deps</a>, <a href="#optionon_check">on_check</a>, <a href="#optionafter_check">after_check</a> and other interfaces instead.<br></p>
 
 </p>
 <p>Bind association options, for example I want to configure a <code>smallest</code> parameter on the command line: <code>xmake f --smallest=y</code></p>
 <p>At this time, it is necessary to disable multiple other option switches at the same time to prohibit compiling multiple modules. This is the requirement, which is equivalent to the linkage between one option and other options.</p>
 <p>This interface is used to set some association options that need to be forward bound, for example:</p>
 <pre><code class="lang-lua">-- Define option switches: --smallest=y|n
-option(&quot;smallest&quot;)
+option("smallest")
 
     -- Add forward binding. If smallest is enabled, all of the following option switches will also be enabled synchronously.
-    add_bindings(&quot;nozip&quot;, &quot;noxml&quot;, &quot;nojson&quot;)
+    add_bindings("nozip", "noxml", "nojson")
 </code></pre>
 <h3 id="option-add_rbindings">option:add_rbindings</h3>
 <h4 id="add-reverse-association-option-sync-enable-and-disable">Add reverse association option, sync enable and disable</h4>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>After the 2.1.5 version has been deprecated, please use <a href="#optionadd_deps">add_deps</a>, <a href="#optionon_check">on_check</a>, <a href="#optionafter_check">after_check</a> and other interfaces instead.<br>&lt;/p&gt;
+<p><p class="tip"><br>After the 2.1.5 version has been deprecated, please use <a href="#optionadd_deps">add_deps</a>, <a href="#optionon_check">on_check</a>, <a href="#optionafter_check">after_check</a> and other interfaces instead.<br></p>
 
 </p>
 <p>Reverse binding association options, the switch state of the associated option is reversed.</p>
 <pre><code class="lang-lua">-- Define option switches: --smallest=y|n
-option(&quot;smallest&quot;)
+option("smallest")
 
     -- Add reverse binding, if smallest is enabled, all modules below are disabled
-    add_rbindings(&quot;xml&quot;, &quot;zip&quot;, &quot;asio&quot;, &quot;regex&quot;, &quot;object&quot;, &quot;thread&quot;, &quot;network&quot;, &quot;charset&quot;, &quot;database&quot;)
-    add_rbindings(&quot;zlib&quot;, &quot;mysql&quot;, &quot;sqlite3&quot;, &quot;openssl&quot;, &quot;polarssl&quot;, &quot;pcre2&quot;, &quot;pcre&quot;, &quot;base&quot;)
+    add_rbindings("xml", "zip", "asio", "regex", "object", "thread", "network", "charset", "database")
+    add_rbindings("zlib", "mysql", "sqlite3", "openssl", "polarssl", "pcre2", "pcre", "base")
 </code></pre>
-<p>&lt;p class=&quot;warn&quot;&gt;<br>It should be noted that the command line configuration is sequential. You can disable all modules by enabling smallest and then add other options to enable them one by one.<br>&lt;/p&gt;
+<p><p class="warn"><br>It should be noted that the command line configuration is sequential. You can disable all modules by enabling smallest and then add other options to enable them one by one.<br></p>
 
 </p>
 <p>E.g:</p>
@@ -671,13 +671,13 @@ $ xmake f --smallest=y --xml=y --zip=y
 <h3 id="option-add_links">option:add_links</h3>
 <h4 id="add-link-library-detection">Add Link Library Detection</h4>
 <p>If the specified link library is passed, this option will be enabled and the associated target will automatically be added to this link, for example:</p>
-<pre><code class="lang-lua">option(&quot;pthread&quot;)
+<pre><code class="lang-lua">option("pthread")
     set_default(false)
-    add_links(&quot;pthread&quot;)
-    add_linkdirs(&quot;/usr/local/lib&quot;)
+    add_links("pthread")
+    add_linkdirs("/usr/local/lib")
 
-target(&quot;test&quot;)
-    add_options(&quot;pthread&quot;)
+target("test")
+    add_options("pthread")
 </code></pre>
 <p>If the test passes, the <code>test</code> target will be automatically added when it is compiled: <code>-L/usr/local/lib -lpthread</code> compile option</p>
 <h3 id="option-add_linkdirs">option:add_linkdirs</h3>
@@ -689,13 +689,13 @@ target(&quot;test&quot;)
 <h3 id="option-add_cincludes">option:add_cincludes</h3>
 <h4 id="add-c-header-file-detection">Add c header file detection</h4>
 <p>This option will be enabled if the c header file is passed, for example:</p>
-<pre><code class="lang-lua">option(&quot;pthread&quot;)
+<pre><code class="lang-lua">option("pthread")
     set_default(false)
-    add_cincludes(&quot;pthread.h&quot;)
-    add_defines(&quot;ENABLE_PTHREAD&quot;)
+    add_cincludes("pthread.h")
+    add_defines("ENABLE_PTHREAD")
 
-target(&quot;test&quot;)
-    add_options(&quot;pthread&quot;)
+target("test")
+    add_options("pthread")
 </code></pre>
 <p>This option checks if there is a <code>pthread.h</code> header file. If the test passes, then the <code>test</code> target program will add the macro definition of <code>ENABLE_PTHREAD</code>.</p>
 <p>If you want more flexible detection, you can do this in <a href="#optionon_check">option.on_check</a> via <a href="#detect-has_cincludes">lib.detect.has_cincludes</a>.</p>
@@ -705,13 +705,13 @@ target(&quot;test&quot;)
 <h3 id="option-add_ctypes">option:add_ctypes</h3>
 <h4 id="add-c-type-detection">Add c type detection</h4>
 <p>This option will be enabled if the c type is passed, for example:</p>
-<pre><code class="lang-lua">option(&quot;wchar&quot;)
+<pre><code class="lang-lua">option("wchar")
     set_default(false)
-    add_cincludes(&quot;wchar_t&quot;)
-    add_defines(&quot;HAVE_WCHAR&quot;)
+    add_cincludes("wchar_t")
+    add_defines("HAVE_WCHAR")
 
-target(&quot;test&quot;)
-    add_options(&quot;wchar&quot;)
+target("test")
+    add_options("wchar")
 </code></pre>
 <p>This option checks if there is a type of <code>wchar_t</code>. If the test passes, then the <code>test</code> target program will add the macro definition of <code>HAVE_WCHAR</code>.</p>
 <p>If you want more flexible detection, you can do this in <a href="#optionon_check">option.on_check</a> via <a href="#detect-has_ctypes">lib.detect.has_ctypes</a>.</p>
@@ -724,8 +724,8 @@ target(&quot;test&quot;)
 <h3 id="option-add_cxxsnippet">option:add_cxxsnippet</h3>
 <h4 id="adding-c-code-snippet-detection">Adding c++ code snippet detection</h4>
 <p>This interface can be used to implement more custom detection of some compiler feature detection, especially the detection support of various features of C++, such as:</p>
-<pre><code class="lang-lua">option(&quot;constexpr&quot;)
-    add_cxxsnippet(&quot;constexpr&quot;, &quot;constexpr int f(int x) { int sum=0; for (int i=0; i&lt;=x; ++i) sum += i; return sum; } constexpr int x = f (5); static_assert(x == 15);&quot;)
+<pre><code class="lang-lua">option("constexpr")
+    add_cxxsnippet("constexpr", "constexpr int f(int x) { int sum=0; for (int i=0; i<=x; ++i) sum += i; return sum; } constexpr int x = f (5); static_assert(x == 15);")
 </code></pre>
 <p>The first parameter sets the name of the code snippet as a label, and is displayed when the output information is detected.</p>
 <p>The above code implements the detection of the constexpr feature of C++. If the test passes, the constexpr option is enabled. Of course, this is just an example.</p>

+ 216 - 216
mirror/manual/custom_rule.html

@@ -93,29 +93,29 @@
     <p>After the 2.2.1 release, xmake not only natively supports the construction of multi-language files, but also allows users to implement complex unknown file builds by custom building rules.</p>
 <p>We can extend the build support for other files by pre-setting the file suffixes supported by the rules:</p>
 <pre><code class="lang-lua">-- Define a build rule for a markdown file
-rule(&quot;markdown&quot;)
-    set_extensions(&quot;.md&quot;, &quot;.markdown&quot;)
+rule("markdown")
+    set_extensions(".md", ".markdown")
     on_build_file(function (target, sourcefile)
-        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. &quot;.html&quot;))
+        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
     end)
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
+target("test")
+    set_kind("binary")
 
     -- Make the test target support the construction rules of the markdown file
-    add_rules(&quot;markdown&quot;)
+    add_rules("markdown")
 
     -- Adding a markdown file to build
-    add_files(&quot;src/*.md&quot;)
-    add_files(&quot;src/*.markdown&quot;)
+    add_files("src/*.md")
+    add_files("src/*.markdown")
 </code></pre>
 <p>We can also specify some other scattered files to be processed as markdown rules:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
     -- ...
-    add_files(&quot;src/test/*.md.in&quot;, {rule = &quot;markdown&quot;})
+    add_files("src/test/*.md.in", {rule = "markdown"})
 </code></pre>
 <p>A target can be superimposed to apply multiple rules to more customize its own build behavior, and even support different build environments.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>Rules specified by <code>add_files(&quot;*.md&quot;, {rule = &quot;markdown&quot;})</code>, with a higher priority than the rule set by <code>add_rules(&quot;markdown&quot;)</code>.<br>&lt;/p&gt;
+<p><p class="tip"><br>Rules specified by <code>add_files("*.md", {rule = "markdown"})</code>, with a higher priority than the rule set by <code>add_rules("markdown")</code>.<br></p>
 
 </p>
 <table>
@@ -130,157 +130,157 @@ target(&quot;test&quot;)
 <tr>
 <td><a href="#rule">rule</a></td>
 <td>Defining Rules</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleadd_imports">add_imports</a></td>
 <td>Pre-importing extension modules for all custom scripts</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleset_extensions">set_extensions</a></td>
 <td>Set the file extension type supported by the rule</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_load">on_load</a></td>
 <td>Custom Load Script</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleon_link">on_link</a></td>
 <td>Custom Link Script</td>
-<td>&gt;= 2.2.7</td>
+<td>>= 2.2.7</td>
 </tr>
 <tr>
 <td><a href="#ruleon_build">on_build</a></td>
 <td>Custom Compilation Script</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_clean">on_clean</a></td>
 <td>Custom Cleanup Script</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_package">on_package</a></td>
 <td>Custom Package Script</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_install">on_install</a></td>
 <td>Custom Installation Script</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_uninstall">on_uninstall</a></td>
 <td>Custom Uninstall Script</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_build_file">on_build_file</a></td>
 <td>Custom the build script to implement single file build</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleon_build_files">on_build_files</a></td>
 <td>Custom Compilation Scripts for Multi-File Construction</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_load">before_load</a></td>
 <td>Custom pre-load script</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_link">before_link</a></td>
 <td>Custom pre-link script</td>
-<td>&gt;= 2.2.7</td>
+<td>>= 2.2.7</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_build">before_build</a></td>
 <td>Custom pre-compilation script</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_clean">before_clean</a></td>
 <td>Custom the script before cleanup</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_package">before_package</a></td>
 <td>Custom the script before packaging</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_install">before_install</a></td>
 <td>Custom Pre-Installation Scripts</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_uninstall">before_uninstall</a></td>
 <td>Custom the script before uninstalling</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_build_file">before_build_file</a></td>
 <td>Custom pre-compilation scripts to implement single file builds</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_build_files">before_build_files</a></td>
 <td>Custom pre-compilation scripts for multi-file build</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_load">after_load</a></td>
 <td>Custom script after loading</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_link">after_link</a></td>
 <td>Custom script after linking</td>
-<td>&gt;= 2.2.7</td>
+<td>>= 2.2.7</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_build">after_build</a></td>
 <td>Custom script after compilation</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_clean">after_clean</a></td>
 <td>Custom script after cleaning</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_package">after_package</a></td>
 <td>Custom script after packaging</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_install">after_install</a></td>
 <td>Custom script after installing</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_uninstall">after_uninstall</a></td>
 <td>Custom script after uninstalling</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_build_file">after_build_file</a></td>
 <td>Custom script after compiling the single file</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_build_files">after_build_files</a></td>
 <td>Custom script after compiling the multiple file</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rule_end">rule_end</a></td>
 <td>End Definition Rule</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 </tbody>
 </table>
@@ -298,142 +298,142 @@ target(&quot;test&quot;)
 <tr>
 <td><a href="#mode-debug">mode.debug</a></td>
 <td>Debug Mode Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-release">mode.release</a></td>
 <td>Release Mode Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-releasedbg">mode.releasedbg</a></td>
 <td>Release Mode Compilation Rule (With Debug Symbols)</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#mode-minsizerel">mode.minsizerel</a></td>
 <td>Release Mode Compilation Rule (With Minimum Size)</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#mode-check">mode.check</a></td>
 <td>Detection Mode Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-profile">mode.profile</a></td>
 <td>Performance Analysis Mode Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-coverage">mode.coverage</a></td>
 <td>Coverage Analysis Compilation Mode Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-valgrind">mode.valgrind</a></td>
 <td>Valgrind Rule</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#mode-asan">mode.asan</a></td>
 <td>AddressSanitizer Rule</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#mode-tsan">mode.tsan</a></td>
 <td>ThreadSanitizer Rule</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#mode-lsan">mode.lsan</a></td>
 <td>LeakSanitizer Rule</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#mode-ubsan">mode.ubsan</a></td>
 <td>UndefinedBehaviorSanitizer Rule</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#qt-static">qt.static</a></td>
 <td>Qt Static Library Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#qt-shared">qt.shared</a></td>
 <td>Qt Dynamic Library Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#qt-console">qt.console</a></td>
 <td>Qt Console Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#qt-quickapp">qt.quickapp</a></td>
 <td>Qt QuickApp Compilation Rule</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 <tr>
 <td><a href="#qt-quickapp_static">qt.quickapp_static</a></td>
 <td>Qt QuickApp Compilation Rule (static link)</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 <tr>
 <td><a href="#qt-widgetapp">qt.widgetapp</a></td>
 <td>Qt WidgetApp Compilation Rule</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 <tr>
 <td><a href="#qt-widgetapp_static">qt.widgetapp_static</a></td>
 <td>Qt WidgetApp Compilation Rule(static link)</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 <tr>
 <td><a href="#xcode-bundle">xcode.bundle</a></td>
 <td>Xcode Bundle Compilation Rule</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#xcode-framework">xcode.framework</a></td>
 <td>Xcode Framework Compilation Rule</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#xcode-application">xcode.application</a></td>
 <td>Xcode iOS/MacOS App Compilation Rule</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#wdk-umdf-driver">wdk.umdf.driver</a></td>
 <td>WDK Environment umdf Driver Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-umdf-binary">wdk.umdf.binary</a></td>
 <td>WDK Environment umdf Driver Application Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-kmdf-driver">wdk.kmdf.driver</a></td>
 <td>WDK Environment kmdf Driver Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-kmdf-binary">wdk.kmdf.binary</a></td>
 <td>WDK Environment kmdf Driver Application Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-wdm-driver">wdk.wdm.driver</a></td>
 <td>WDK Environment wdm Driver Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-wdm-binary">wdk.wdm.binary</a></td>
 <td>WDK Environment wdm Driver Application Compilation Rule</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 </tbody>
 </table>
@@ -442,189 +442,189 @@ target(&quot;test&quot;)
 </code></pre>
 <h4 id="mode-debug">mode.debug</h4>
 <p>Add the configuration rules for the debug compilation mode for the current project xmake.lua, for example:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.debug&quot;)
+<pre><code class="lang-lua">add_rules("mode.debug")
 </code></pre>
 <p>Equivalent to:</p>
-<pre><code class="lang-lua">if is_mode(&quot;debug&quot;) then
-    set_symbols(&quot;debug&quot;)
-    set_optimize(&quot;none&quot;)
+<pre><code class="lang-lua">if is_mode("debug") then
+    set_symbols("debug")
+    set_optimize("none")
 end
 </code></pre>
 <p>We can switch to this compilation mode by <code>xmake f -m debug</code>.</p>
 <h4 id="mode-release">mode.release</h4>
 <p>Add the configuration rules for the release compilation mode for the current project xmake.lua, for example:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.release&quot;)
+<pre><code class="lang-lua">add_rules("mode.release")
 </code></pre>
 <p>Equivalent to:</p>
-<pre><code class="lang-lua">if is_mode(&quot;release&quot;) then
-    set_symbols(&quot;hidden&quot;)
-    set_optimize(&quot;fastest&quot;)
-    set_strip(&quot;all&quot;)
+<pre><code class="lang-lua">if is_mode("release") then
+    set_symbols("hidden")
+    set_optimize("fastest")
+    set_strip("all")
 end
 </code></pre>
 <p>We can switch to this compilation mode by <code>xmake f -m release</code>.</p>
 <h4 id="mode-releasedbg">mode.releasedbg</h4>
 <p>Add the configuration rules for the releasedbg compilation mode for the current project xmake.lua, for example:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.releasedbg&quot;)
+<pre><code class="lang-lua">add_rules("mode.releasedbg")
 </code></pre>
-<p>!&gt; Compared with the release mode, this mode will also enable additional debugging symbols, which is usually very useful.</p>
+<p>!> Compared with the release mode, this mode will also enable additional debugging symbols, which is usually very useful.</p>
 <p>Equivalent to:</p>
-<pre><code class="lang-lua">if is_mode(&quot;releasedbg&quot;) then
-    set_symbols(&quot;debug&quot;)
-    set_optimize(&quot;fastest&quot;)
-    set_strip(&quot;all&quot;)
+<pre><code class="lang-lua">if is_mode("releasedbg") then
+    set_symbols("debug")
+    set_optimize("fastest")
+    set_strip("all")
 end
 </code></pre>
 <p>We can switch to this compilation mode by <code>xmake f -m releasedbg</code>.</p>
 <h4 id="mode-minsizerel">mode.minsizerel</h4>
 <p>Add the configuration rules for the minsizerel compilation mode for the current project xmake.lua, for example:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.minsizerel&quot;)
+<pre><code class="lang-lua">add_rules("mode.minsizerel")
 </code></pre>
-<p>!&gt; Compared with the release mode, this mode is more inclined to the minimum code compilation optimization, rather than speed priority.</p>
+<p>!> Compared with the release mode, this mode is more inclined to the minimum code compilation optimization, rather than speed priority.</p>
 <p>相当于:</p>
-<pre><code class="lang-lua">if is_mode(&quot;minsizerel&quot;) then
-    set_symbols(&quot;hidden&quot;)
-    set_optimize(&quot;smallest&quot;)
-    set_strip(&quot;all&quot;)
+<pre><code class="lang-lua">if is_mode("minsizerel") then
+    set_symbols("hidden")
+    set_optimize("smallest")
+    set_strip("all")
 end
 </code></pre>
 <p>We can switch to this compilation mode by <code>xmake f -m minsizerel</code>.</p>
 <h4 id="mode-check">mode.check</h4>
 <p>Add the check compilation mode configuration rules for the current project xmake.lua, generally used for memory detection, for example:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.check&quot;)
+<pre><code class="lang-lua">add_rules("mode.check")
 </code></pre>
 <p>Equivalent to:</p>
-<pre><code class="lang-lua">if is_mode(&quot;check&quot;) then
-    set_symbols(&quot;debug&quot;)
-    set_optimize(&quot;none&quot;)
-    add_cxflags(&quot;-fsanitize=address&quot;, &quot;-ftrapv&quot;)
-    add_mxflags(&quot;-fsanitize=address&quot;, &quot;-ftrapv&quot;)
-    add_ldflags(&quot;-fsanitize=address&quot;)
+<pre><code class="lang-lua">if is_mode("check") then
+    set_symbols("debug")
+    set_optimize("none")
+    add_cxflags("-fsanitize=address", "-ftrapv")
+    add_mxflags("-fsanitize=address", "-ftrapv")
+    add_ldflags("-fsanitize=address")
 end
 </code></pre>
 <p>We can switch to this compilation mode by <code>xmake f -m check</code>.</p>
 <h4 id="mode-profile">mode.profile</h4>
 <p>Add configuration rules for the profile compilation mode for the current project xmake.lua, which is generally used for performance analysis, for example:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.profile&quot;)
+<pre><code class="lang-lua">add_rules("mode.profile")
 </code></pre>
 <p>Equivalent to:</p>
-<pre><code class="lang-lua">if is_mode(&quot;profile&quot;) then
-    set_symbols(&quot;debug&quot;)
-    add_cxflags(&quot;-pg&quot;)
-    add_ldflags(&quot;-pg&quot;)
+<pre><code class="lang-lua">if is_mode("profile") then
+    set_symbols("debug")
+    add_cxflags("-pg")
+    add_ldflags("-pg")
 end
 </code></pre>
 <p>We can switch to this compilation mode by <code>xmake f -m profile</code>.</p>
 <h4 id="mode-coverage">mode.coverage</h4>
 <p>Add the configuration rules for the coverage compilation mode for the current project xmake.lua, which is generally used for coverage analysis, for example:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.coverage&quot;)
+<pre><code class="lang-lua">add_rules("mode.coverage")
 </code></pre>
 <p>Equivalent to:</p>
-<pre><code class="lang-lua">if is_mode(&quot;coverage&quot;) then
-    add_cxflags(&quot;--coverage&quot;)
-    add_mxflags(&quot;--coverage&quot;)
-    add_ldflags(&quot;--coverage&quot;)
+<pre><code class="lang-lua">if is_mode("coverage") then
+    add_cxflags("--coverage")
+    add_mxflags("--coverage")
+    add_ldflags("--coverage")
 end
 </code></pre>
 <p>We can switch to this compilation mode by <code>xmake f -m coverage</code>.</p>
 <h4 id="mode-valgrind">mode.valgrind</h4>
 <p>This mode provides valgrind memory analysis and detection support.</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.valgrind&quot;)
+<pre><code class="lang-lua">add_rules("mode.valgrind")
 </code></pre>
 <p>We can switch to this compilation mode by: <code>xmake f -m valgrind</code>.</p>
 <h4 id="mode-asan">mode.asan</h4>
 <p>This mode provides AddressSanitizer memory analysis and detection support.</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.asan&quot;)
+<pre><code class="lang-lua">add_rules("mode.asan")
 </code></pre>
 <p>We can switch to this compilation mode by: <code>xmake f -m asan</code>.</p>
 <h4 id="mode-tsan">mode.tsan</h4>
 <p>This mode provides ThreadSanitizer memory analysis and detection support.</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.tsan&quot;)
+<pre><code class="lang-lua">add_rules("mode.tsan")
 </code></pre>
 <p>We can switch to this compilation mode by: <code>xmake f -m tsan</code>.</p>
 <h4 id="mode-lsan">mode.lsan</h4>
 <p>This mode provides LeakSanitizer memory analysis and detection support.</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.lsan&quot;)
+<pre><code class="lang-lua">add_rules("mode.lsan")
 </code></pre>
 <p>We can switch to this compilation mode by: <code>xmake f -m lsan</code>.</p>
 <h4 id="mode-ubsan">mode.ubsan</h4>
 <p>This mode provides UndefinedBehaviorSanitizer memory analysis and detection support.</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.ubsan&quot;)
+<pre><code class="lang-lua">add_rules("mode.ubsan")
 </code></pre>
 <p>We can switch to this compilation mode by: <code>xmake f -m ubsan</code>.</p>
 <h4 id="qt-static">qt.static</h4>
 <p>A static library program used to compile and generate Qt environments:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.static&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.static")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h4 id="qt-shared">qt.shared</h4>
 <p>Dynamic library program for compiling and generating Qt environment:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.shared&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.shared")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h4 id="qt-console">qt.console</h4>
 <p>A console program for compiling and generating a Qt environment:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.console&quot;)
-    add_files(&quot;src/*.cpp&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.console")
+    add_files("src/*.cpp")
 </code></pre>
 <h4 id="qt-quickapp">qt.quickapp</h4>
 <p>Quick(qml) ui application for compiling and generating Qt environment.</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.quickapp&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/qml.qrc&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.quickapp")
+    add_files("src/*.cpp")
+    add_files("src/qml.qrc")
 </code></pre>
 <h4 id="qt-quickapp_static">qt.quickapp_static</h4>
 <p>Quick(qml) ui application (statically linked version) for compiling and generating Qt environment.</p>
-<p>!&gt; Need to switch to static library version Qt SDK</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.quickapp_static&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/qml.qrc&quot;)
+<p>!> Need to switch to static library version Qt SDK</p>
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.quickapp_static")
+    add_files("src/*.cpp")
+    add_files("src/qml.qrc")
 </code></pre>
 <h4 id="qt-widgetapp">qt.widgetapp</h4>
 <p>Used to compile Qt Widgets (ui/moc) applications</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.widgetapp&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;) -- add meta header files with Q_OBJECT
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.widgetapp")
+    add_files("src/*.cpp")
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h") -- add meta header files with Q_OBJECT
 </code></pre>
 <h4 id="qt-widgetapp_static">qt.widgetapp_static</h4>
 <p>Used to compile Qt Widgets (ui/moc) applications (static library version)</p>
-<p>!&gt; Need to switch to static library version Qt SDK</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.widgetapp_static&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;) -- add meta header files with Q_OBJECT
+<p>!> Need to switch to static library version Qt SDK</p>
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.widgetapp_static")
+    add_files("src/*.cpp")
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h") -- add meta header files with Q_OBJECT
 </code></pre>
 <p>For more descriptions of Qt, see: <a href="https://github.com/xmake-io/xmake/issues/160">#160</a></p>
 <h4 id="xcode-bundle">xcode.bundle</h4>
 <p>Used to compile and generate ios/macos bundle program</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-     add_rules(&quot;xcode.bundle&quot;)
-     add_files(&quot;src/*.m&quot;)
-     add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+     add_rules("xcode.bundle")
+     add_files("src/*.m")
+     add_files("src/Info.plist")
 </code></pre>
 <h4 id="xcode-framework">xcode.framework</h4>
 <p>Used to compile and generate ios/macos framework program</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-     add_rules(&quot;xcode.framework&quot;)
-     add_files(&quot;src/*.m&quot;)
-     add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+     add_rules("xcode.framework")
+     add_files("src/*.m")
+     add_files("src/Info.plist")
 </code></pre>
 <h4 id="xcode-application">xcode.application</h4>
 <p>Used to compile and generate ios/macos applications</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-     add_rules(&quot;xcode.application&quot;)
-     add_files(&quot;src/*.m&quot;, &quot;src/**.storyboard&quot;, &quot;src/*.xcassets&quot;)
-     add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+     add_rules("xcode.application")
+     add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
+     add_files("src/Info.plist")
 </code></pre>
 <h4 id="wdk-env-kmdf">wdk.env.kmdf</h4>
 <p>Application of the compilation environment setting of kmdf under WDK, need to cooperate with: <code>wdk.[driver|binary|static|shared]</code> and other rules to use.</p>
@@ -636,99 +636,99 @@ end
 <p>Compile and generate drivers based on the WDK environment under Windows. Currently, only the WDK10 environment is supported.</p>
 <p>Note: need to cooperate: <code>wdk.env.[umdf|kmdf|wdm]</code>Environmental rules are used.</p>
 <pre><code class="lang-lua">-- add target
-target(&quot;echo&quot;)
+target("echo")
 
     -- add rules
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.kmdf&quot;)
+    add_rules("wdk.driver", "wdk.env.kmdf")
 
     -- add files
-    add_files(&quot;driver/*.c&quot;)
-    add_files(&quot;driver/*.inx&quot;)
+    add_files("driver/*.c")
+    add_files("driver/*.inx")
 
     -- add includedirs
-    add_includedirs(&quot;exe&quot;)
+    add_includedirs("exe")
 </code></pre>
 <h4 id="wdk-binary">wdk.binary</h4>
 <p>Compile and generate executable programs based on WDK environment under Windows. Currently, only WDK10 environment is supported.</p>
 <p>Note: It is necessary to cooperate with: environment rules such as <code>wdk.env.[umdf|kmdf|wdm]</code>.</p>
 <pre><code class="lang-lua">-- add target
-target(&quot;app&quot;)
+target("app")
 
     -- add rules
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.umdf&quot;)
+    add_rules("wdk.binary", "wdk.env.umdf")
 
     -- add files
-    add_files(&quot;exe/*.cpp&quot;)
+    add_files("exe/*.cpp")
 </code></pre>
 <h4 id="wdk-static">wdk.static</h4>
 <p>Compile and generate static library programs based on WDK environment under Windows. Currently, only WDK10 environment is supported.</p>
 <p>Note: It is necessary to cooperate with: environment rules such as <code>wdk.env.[umdf|kmdf|wdm]</code>.</p>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
+<pre><code class="lang-lua">target("nonpnp")
 
     -- add rules
-    add_rules(&quot;wdk.static&quot;, &quot;wdk.env.kmdf&quot;)
+    add_rules("wdk.static", "wdk.env.kmdf")
 
     -- add flags for rule: wdk.tracewpp
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
 
     -- add files
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;})
+    add_files("driver/*.c", {rule = "wdk.tracewpp"})
 </code></pre>
 <h4 id="wdk-shared">wdk.shared</h4>
 <p>Compile and generate dynamic library programs based on WDK environment under Windows. Currently, only WDK10 environment is supported.</p>
 <p>Note: It is necessary to cooperate with: environment rules such as <code>wdk.env.[umdf|kmdf|wdm]</code>.</p>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
+<pre><code class="lang-lua">target("nonpnp")
 
     -- add rules
-    add_rules(&quot;wdk.shared&quot;, &quot;wdk.env.wdm&quot;)
+    add_rules("wdk.shared", "wdk.env.wdm")
 
     -- add flags for rule: wdk.tracewpp
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
 
     -- add files
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;})
+    add_files("driver/*.c", {rule = "wdk.tracewpp"})
 </code></pre>
 <h4 id="wdk-tracewpp">wdk.tracewpp</h4>
 <p>Used to enable tracewpp to preprocess source files:</p>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
+<pre><code class="lang-lua">target("nonpnp")
 
     -- add rules
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.kmdf&quot;)
+    add_rules("wdk.driver", "wdk.env.kmdf")
 
     -- add flags for rule: wdk.tracewpp
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
 
     -- add files
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;})
-    add_files(&quot;driver/*.rc&quot;)
+    add_files("driver/*.c", {rule = "wdk.tracewpp"})
+    add_files("driver/*.rc")
 </code></pre>
 <p>For more information on WDK rules, see: <a href="https://github.com/xmake-io/xmake/issues/159">#159</a></p>
 <h4 id="win-sdk-application">win.sdk.application</h4>
 <p>Compile and generate the winsdk application.</p>
 <pre><code class="lang-lua">-- add rules
-add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)
+add_rules("mode.debug", "mode.release")
 
 -- define target
-target(&quot;usbview&quot;)
+target("usbview")
 
     -- windows application
-    add_rules(&quot;win.sdk.application&quot;)
+    add_rules("win.sdk.application")
 
     -- add files
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;)
-    add_files(&quot;xmlhelper.cpp&quot;, {rule = &quot;win.sdk.dotnet&quot;})
+    add_files("*.c", "*.rc")
+    add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
 </code></pre>
 <h4 id="wdk-sdk-dotnet">wdk.sdk.dotnet</h4>
 <p>Used to specify certain c++ source files to be compiled as c++.net.</p>
-<pre><code class="lang-lua">add_files(&quot;xmlhelper.cpp&quot;, {rule = &quot;win.sdk.dotnet&quot;})
+<pre><code class="lang-lua">add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
 </code></pre>
 <p>For more information on WDK rules, see: <a href="https://github.com/xmake-io/xmake/issues/159">#159</a></p>
 <h3 id="rule">rule</h3>
 <h4 id="defining-rules">Defining rules</h4>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
-    set_extensions(&quot;.md&quot;, &quot;.markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
+    set_extensions(".md", ".markdown")
     on_build_file(function (target, sourcefile, opt)
-        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. &quot;.html&quot;))
+        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
     end)
 </code></pre>
 <h3 id="rule-add_imports">rule:add_imports</h3>
@@ -738,48 +738,48 @@ target(&quot;usbview&quot;)
 <h4 id="setting-the-file-extension-type-supported-by-the-rule">Setting the file extension type supported by the rule</h4>
 <p>Apply rules to files with these suffixes by setting the supported extension file types, for example:</p>
 <pre><code class="lang-lua">-- Define a build rule for a markdown file
-rule(&quot;markdown&quot;)
-    set_extensions(&quot;.md&quot;, &quot;.markdown&quot;)
+rule("markdown")
+    set_extensions(".md", ".markdown")
     on_build_file(function (target, sourcefile, opt)
-        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. &quot;.html&quot;))
+        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
     end)
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
+target("test")
+    set_kind("binary")
 
     -- Make the test target support the construction rules of the markdown file
-    add_rules(&quot;markdown&quot;)
+    add_rules("markdown")
 
     -- Adding a markdown file to build
-    add_files(&quot;src/*.md&quot;)
-    add_files(&quot;src/*.markdown&quot;)
+    add_files("src/*.md")
+    add_files("src/*.markdown")
 </code></pre>
 <h3 id="rule-on_load">rule:on_load</h3>
 <h4 id="custom-load-script">Custom load script</h4>
 <p>The load script used to implement the custom rules will be executed when the target is loaded. You can customize some target configurations in it, for example:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     on_load(function (target)
-        target:add(&quot;defines&quot;, &quot;-DTEST&quot;)
+        target:add("defines", "-DTEST")
     end)
 </code></pre>
 <h3 id="rule-on_link">rule:on_link</h3>
 <h4 id="custom-link-script">Custom link script</h4>
 <p>The link script used to implement the custom rules overrides the default link behavior of the applied target, for example:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     on_link(function (target)
     end)
 </code></pre>
 <h3 id="rule-on_build">rule:on_build</h3>
 <h4 id="custom-compilation-script">Custom compilation script</h4>
 <p>The build script used to implement the custom rules overrides the default build behavior of the target being applied, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_build(function (target)
     end)
 </code></pre>
 <h3 id="rule-on_clean">rule:on_clean</h3>
 <h4 id="custom-cleanup-script">Custom cleanup script</h4>
 <p>The cleanup script used to implement the custom rules will override the default cleanup behavior of the applied target, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_clean(function (target)
         -- remove sourcefile.html
     end)
@@ -787,7 +787,7 @@ target(&quot;test&quot;)
 <h3 id="rule-on_package">rule:on_package</h3>
 <h4 id="custom-packaging-script">Custom packaging script</h4>
 <p>A packaging script for implementing custom rules that overrides the default packaging behavior of the target being applied, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_package(function (target)
         -- package sourcefile.html
     end)
@@ -795,31 +795,31 @@ target(&quot;test&quot;)
 <h3 id="rule-on_install">rule:on_install</h3>
 <h4 id="custom-installation-script">Custom installation script</h4>
 <p>An installation script for implementing custom rules that overrides the default installation behavior of the target being applied, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_install(function (target)
     end)
 </code></pre>
 <h3 id="rule-on_uninstall">rule:on_uninstall</h3>
 <h4 id="custom-uninstall-script">Custom Uninstall Script</h4>
 <p>An uninstall script for implementing custom rules that overrides the default uninstall behavior of the target being applied, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_uninstall(function (target)
     end)
 </code></pre>
 <h3 id="rule-on_build_file">rule:on_build_file</h3>
 <h4 id="customizing-the-build-script-to-process-one-source-file-at-a-time">Customizing the build script to process one source file at a time</h4>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_build_file(function (target, sourcefile, opt)
-        print(&quot;%%%d: %s&quot;, opt.progress, sourcefile)
+        print("%%%d: %s", opt.progress, sourcefile)
     end)
 </code></pre>
 <p>The third parameter opt is an optional parameter, which is used to obtain some information state during the compilation process. For example, opt.progress is the compilation progress of the current period.</p>
 <h3 id="rule-on_build_files">rule:on_build_files</h3>
 <h4 id="customizing-the-build-script-to-process-multiple-source-files-at-once">Customizing the build script to process multiple source files at once</h4>
-<p>Most of the custom build rules, each time processing a single file, output a target file, for example: a.c =&gt; a.o</p>
-<p>However, in some cases, we need to enter multiple source files together to build an object file, for example: a.c b.c d.c =&gt; x.o</p>
+<p>Most of the custom build rules, each time processing a single file, output a target file, for example: a.c => a.o</p>
+<p>However, in some cases, we need to enter multiple source files together to build an object file, for example: a.c b.c d.c => x.o</p>
 <p>For this situation, we can achieve this by customizing this script:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_build_files(function (target, sourcebatch, opt)
         -- build some source files
         for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
@@ -830,50 +830,50 @@ target(&quot;test&quot;)
 <h3 id="rule-before_load">rule:before_load</h3>
 <h4 id="custom-pre-load-script">Custom pre-load script</h4>
 <p>Used to implement the execution script before the custom target is loaded, for example:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     before_load(function (target)
-        target:add(&quot;defines&quot;, &quot;-DTEST&quot;)
+        target:add("defines", "-DTEST")
     end)
 </code></pre>
 <h3 id="rule-before_link">rule:before_link</h3>
 <h4 id="custom-pre-link-script">Custom pre-link script</h4>
 <p>Execution scripts used to implement custom target links, for example:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     before_link(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_build">rule:before_build</h3>
 <h4 id="custom-pre-compilation-script">Custom pre-compilation script</h4>
 <p>Used to implement the execution script before the custom target is built, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_build(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_clean">rule:before_clean</h3>
 <h4 id="custom-pre-cleanup-script">Custom pre-cleanup script</h4>
 <p>Used to implement the execution script before the custom target cleanup, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_clean(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_package">rule:before_package</h3>
 <h4 id="custom-the-pre-package-script">Custom the pre-package script</h4>
 <p>Used to implement the execution script before the custom target is packaged, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_package(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_install">rule:before_install</h3>
 <h4 id="custom-pre-installation-script">Custom pre-installation script</h4>
 <p>Used to implement the execution script before the custom target installation, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_install(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_uninstall">rule:before_uninstall</h3>
 <h4 id="custom-pre-uninstall-script">Custom pre-uninstall script</h4>
 <p>Used to implement the execution script before the custom target is uninstalled, for example:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_uninstall(function (target)
     end)
 </code></pre>
@@ -913,7 +913,7 @@ target(&quot;test&quot;)
 <h3 id="rule_end">rule_end</h3>
 <h4 id="end-definition-rules">End definition rules</h4>
 <p>This is optional. If you want to manually end the rule definition, you can call it:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     -- ..
 rule_end()
 </code></pre>

+ 97 - 97
mirror/manual/custom_toolchain.html

@@ -92,58 +92,58 @@
 </style>
     <p>After version 2.3.4, xmake has supported custom toolchain in user&#39;s project xmake.lua, for example:</p>
 <pre><code class="lang-lua">-- define toolchain
-toolchain(&quot;myclang&quot;)
+toolchain("myclang")
 
     -- mark as standalone toolchain
-    set_kind(&quot;standalone&quot;)
+    set_kind("standalone")
 
     -- set toolset
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;ld&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;sh&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;ar&quot;, &quot;ar&quot;)
-    set_toolset(&quot;ex&quot;, &quot;ar&quot;)
-    set_toolset(&quot;strip&quot;, &quot;strip&quot;)
-    set_toolset(&quot;mm&quot;, &quot;clang&quot;)
-    set_toolset(&quot;mxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;as&quot;, &quot;clang&quot;)
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
-    add_defines(&quot;MYCLANG&quot;)
+    add_defines("MYCLANG")
 
     -- check toolchain
     on_check(function (toolchain)
-        return import(&quot;lib.detect.find_tool&quot;)(&quot;clang&quot;)
+        return import("lib.detect.find_tool")("clang")
     end)
 
     -- on load
     on_load(function (toolchain)
 
         -- get march
-        local march = is_arch(&quot;x86_64&quot;, &quot;x64&quot;) and &quot;-m64&quot; or &quot;-m32&quot;
+        local march = is_arch("x86_64", "x64") and "-m64" or "-m32"
 
         -- init flags for c/c++
-        toolchain:add(&quot;cxflags&quot;, march)
-        toolchain:add(&quot;ldflags&quot;, march)
-        toolchain:add(&quot;shflags&quot;, march)
-        if not is_plat(&quot;windows&quot;) and os.isdir(&quot;/usr&quot;) then
-            for _, includedir in ipairs({&quot;/usr/local/include&quot;, &quot;/usr/include&quot;}) do
+        toolchain:add("cxflags", march)
+        toolchain:add("ldflags", march)
+        toolchain:add("shflags", march)
+        if not is_plat("windows") and os.isdir("/usr") then
+            for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do
                 if os.isdir(includedir) then
-                    toolchain:add(&quot;includedirs&quot;, includedir)
+                    toolchain:add("includedirs", includedir)
                 end
             end
-            for _, linkdir in ipairs({&quot;/usr/local/lib&quot;, &quot;/usr/lib&quot;}) do
+            for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do
                 if os.isdir(linkdir) then
-                    toolchain:add(&quot;linkdirs&quot;, linkdir)
+                    toolchain:add("linkdirs", linkdir)
                 end
             end
         end
 
         -- init flags for objc/c++  (with ldflags and shflags)
-        toolchain:add(&quot;mxflags&quot;, march)
+        toolchain:add("mxflags", march)
 
         -- init flags for asm
-        toolchain:add(&quot;asflags&quot;, march)
+        toolchain:add("asflags", march)
     end)
 </code></pre>
 <p>Then use the following command to cut to the toolchain you defined:</p>
@@ -166,161 +166,161 @@ toolchain(&quot;myclang&quot;)
 <tr>
 <td><a href="#toolchain">toolchain</a></td>
 <td>Define Toolchain</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainset_kind">set_kind</a></td>
 <td>Set toolchain type</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainset_toolset">set_toolset</a></td>
 <td>Set toolset</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainset_sdkdir">set_sdkdir</a></td>
 <td>Set toolchain sdk directory path</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainset_bindir">set_bindir</a></td>
 <td>Set toolchain bin directory path</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainon_check">on_check</a></td>
 <td>Check toolchain</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainonon_load">on_load</a></td>
 <td>Load Toolchain</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchain_end">toolchain_end</a></td>
 <td>End defining toolchain</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_includedirs">add_includedirs</a></td>
 <td>Add header file search directory</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_defines">add_defines</a></td>
 <td>Add Macro Definition</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_undefines">add_undefines</a></td>
 <td>Cancel macro definition</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_cflags">add_cflags</a></td>
 <td>Add c compilation option</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_cxflags">add_cxflags</a></td>
 <td>Add c/c++ compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_cxxflags">add_cxxflags</a></td>
 <td>Add c++ compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_mflags">add_mflags</a></td>
 <td>Add objc compilation option</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_mxflags">add_mxflags</a></td>
 <td>Add objc/objc++ compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_mxxflags">add_mxxflags</a></td>
 <td>Add objc++ compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_scflags">add_scflags</a></td>
 <td>Add swift compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_asflags">add_asflags</a></td>
 <td>Add assembly compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_gcflags">add_gcflags</a></td>
 <td>Add go compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_dcflags">add_dcflags</a></td>
 <td>Add dlang compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_rcflags">add_rcflags</a></td>
 <td>Add rust compilation option</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_cuflags">add_cuflags</a></td>
 <td>Add cuda compilation options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_culdflags">add_culdflags</a></td>
 <td>Add cuda device link option</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_ldflags">add_ldflags</a></td>
 <td>Add link options</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_arflags">add_arflags</a></td>
 <td>Add static library archive option</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_shflags">add_shflags</a></td>
 <td>Add dynamic library link option</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_languages">add_languages</a></td>
 <td>Add language standards</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_frameworks">add_frameworks</a></td>
 <td>Add Link Frame</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/manual/project_target?id=targetadd_frameworkdirs">add_frameworkdirs</a></td>
 <td>Add Link Framework</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 </tbody>
 </table>
 <h3 id="toolchain">toolchain</h3>
 <h4 id="define-toolchain">Define toolchain</h4>
 <p>It can be defined in the user project xmake.lua, or it can be independently defined by a separate xmake.lua to specifically define various toolchains</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
 toolchain_end()
 </code></pre>
 <h3 id="toolchain-set_kind">toolchain:set_kind</h3>
@@ -328,92 +328,92 @@ toolchain_end()
 <p>Currently only supports the setting of <code>standalone</code> type, which means that the current toolchain is an independent and complete toolchain, including a complete set of tool set configurations such as cc/cxx/ld/sh/ar and other compilers, archivers, and linkers.</p>
 <p>Usually used when a target is set with multiple toolchains at the same time, but only one independent toolchain can be effective at the same time. This configuration can ensure that the toolchains in effect are mutually exclusive. For example, the gcc/clang toolchain will not be simultaneously. Take effect.</p>
 <p>However, local toolchains such as yasm/nasm belong to the extension of additional local toolchains, and there is no need to set up standalone because two toolchains of clang/yasm may exist at the same time.</p>
-<p>!&gt; Just remember that the toolchain with a complete compilation environment is set to standalone</p>
+<p>!> Just remember that the toolchain with a complete compilation environment is set to standalone</p>
 <h3 id="toolchain-set_toolset">toolchain:set_toolset</h3>
 <h4 id="set-tool-set">Set Tool Set</h4>
 <p>Used to set the name and path of each individual tool, for example:</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;ld&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;sh&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;ar&quot;, &quot;ar&quot;)
-    set_toolset(&quot;ex&quot;, &quot;ar&quot;)
-    set_toolset(&quot;strip&quot;, &quot;strip&quot;)
-    set_toolset(&quot;mm&quot;, &quot;clang&quot;)
-    set_toolset(&quot;mxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;as&quot;, &quot;clang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 </code></pre>
 <p>For details about this interface, you can see: <a href="/manual/project_target?id=targetset_toolset">target.set_toolset</a></p>
 <h3 id="toolchain-set_sdkdir">toolchain:set_sdkdir</h3>
 <h4 id="set-toolchain-sdk-directory-path">Set toolchain sdk directory path</h4>
 <p>Usually we can configure the sdk directory through <code>xmake f --toolchain=myclang --sdk=xxx</code>, but each time the configuration is more cumbersome, we can also pre-configure to xmake.lua through this interface to facilitate quick switching.</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
-    set_sdkdir(&quot;/tmp/sdkdir&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
+    set_sdkdir("/tmp/sdkdir")
+    set_toolset("cc", "clang")
 </code></pre>
 <h3 id="toolchain-set_bindir">toolchain:set_bindir</h3>
 <h4 id="set-toolchain-bin-directory-path">Set toolchain bin directory path</h4>
 <p>Normally, we can configure the SDK directory through <code>xmake f --toolchain=myclang --bin=xxx</code>, but each time the configuration is more cumbersome, we can also pre-configure to xmake.lua through this interface, which is convenient for quick switching.</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
-    set_bindir(&quot;/tmp/sdkdir/bin&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
+    set_bindir("/tmp/sdkdir/bin")
+    set_toolset("cc", "clang")
 </code></pre>
 <h3 id="toolchain-on_check">toolchain:on_check</h3>
 <h4 id="detection-toolchain">Detection toolchain</h4>
 <p>It is used to detect whether the sdk or program where the specified toolchain exists exists on the current system. It is usually used in the case of multiple standalone toolchains to automatically detect and select an effective toolchain.</p>
 <p>For scenes specified manually by <code>xmake f --toolchain=myclang</code>, this detection configuration is not necessary and can be omitted.</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
     on_check(function (toolchain)
-        return import(&quot;lib.detect.find_tool&quot;)(&quot;clang&quot;)
+        return import("lib.detect.find_tool")("clang")
     end)
 </code></pre>
 <h3 id="toolchain-on_load">toolchain:on_load</h3>
 <h4 id="loading-toolchain">Loading toolchain</h4>
 <p>For some complex scenarios, we can dynamically and flexibly set various toolchain configurations in on_load, which is more flexible and powerful than setting in the description field:</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
     on_load(function (toolchain)
 
         - set toolset
-        toolchain:set(&quot;toolset&quot;, &quot;cc&quot;, &quot;clang&quot;)
-        toolchain:set(&quot;toolset&quot;, &quot;ld&quot;, &quot;clang++&quot;)
+        toolchain:set("toolset", "cc", "clang")
+        toolchain:set("toolset", "ld", "clang++")
         - ..
 
         - get march
-        local march = is_arch(&quot;x86_64&quot;, &quot;x64&quot;) and &quot;-m64&quot; or &quot;-m32&quot;
+        local march = is_arch("x86_64", "x64") and "-m64" or "-m32"
 
         - init flags for c/c++
-        toolchain:add(&quot;cxflags&quot;, march)
-        toolchain:add(&quot;ldflags&quot;, march)
-        toolchain:add(&quot;shflags&quot;, march)
-        if not is_plat(&quot;windows&quot;) and os.isdir(&quot;/usr&quot;) then
-            for _, includedir in ipairs({&quot;/usr/local/include&quot;, &quot;/usr/include&quot;}) do
+        toolchain:add("cxflags", march)
+        toolchain:add("ldflags", march)
+        toolchain:add("shflags", march)
+        if not is_plat("windows") and os.isdir("/usr") then
+            for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do
                 if os.isdir(includedir) then
-                    toolchain:add(&quot;includedirs&quot;, includedir)
+                    toolchain:add("includedirs", includedir)
                 end
             end
-            for _, linkdir in ipairs({&quot;/usr/local/lib&quot;, &quot;/usr/lib&quot;}) do
+            for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do
                 if os.isdir(linkdir) then
-                    toolchain:add(&quot;linkdirs&quot;, linkdir)
+                    toolchain:add("linkdirs", linkdir)
                 end
             end
         end
 
         - init flags for objc/c++ (with ldflags and shflags)
-        toolchain:add(&quot;mxflags&quot;, march)
+        toolchain:add("mxflags", march)
 
         - init flags for asm
-        toolchain:add(&quot;asflags&quot;, march)
+        toolchain:add("asflags", march)
     end)
 </code></pre>
 <h3 id="toolchain_end">toolchain_end</h3>
 <h4 id="end-definition-toolchain">End definition toolchain</h4>
 <p>This is optional, if you want to manually end the definition of toolchain, you can call it:</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
     - ..
 toolchain_end()
 </code></pre>

File diff suppressed because it is too large
+ 179 - 179
mirror/manual/extension_modules.html


+ 113 - 113
mirror/manual/global_interfaces.html

@@ -103,72 +103,72 @@
 <tr>
 <td><a href="#includes">includes</a></td>
 <td>Add sub-project files and directories</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#set_modes">set_modes</a></td>
 <td>Set project compilation modes</td>
-<td>&gt;= 2.1.2</td>
+<td>>= 2.1.2</td>
 </tr>
 <tr>
 <td><a href="#set_project">set_project</a></td>
 <td>Set project name</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#set_version">set_version</a></td>
 <td>Set project version</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#set_xmakever">set_xmakever</a></td>
 <td>Set minimal xmake version</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="#add_subdirs">add_subdirs</a></td>
 <td>Add sub-project directories</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#add_subfiles">add_subfiles</a></td>
 <td>Add sub-project files</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#add_moduledirs">add_moduledirs</a></td>
 <td>Add module directories</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#add_plugindirs">add_plugindirs</a></td>
 <td>Add plugin directories</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#add_packagedirs">add_packagedirs</a></td>
 <td>Add package directories</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#get_config">get_config</a></td>
 <td>Get the configuration value</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#set_config">set_config</a></td>
 <td>Set the default configuration value</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#add_requires">add_requires</a></td>
 <td>Add required package dependencies</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#add_repositories">add_repositories</a></td>
 <td>Add 3rd package repositories</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 </tbody>
 </table>
@@ -179,27 +179,27 @@
 <p>For a more complete description of this, see: <a href="https://github.com/xmake-io/xmake/issues/342">https://github.com/xmake-io/xmake/issues/342</a></p>
 <p>Examples:</p>
 <p>Check links, ctype, includes and features and write macro definitions to the config.h file.</p>
-<pre><code class="lang-lua">includes(&quot;check_links.lua&quot;)
-includes(&quot;check_ctypes.lua&quot;)
-includes(&quot;check_cfuncs.lua&quot;)
-includes(&quot;check_features.lua&quot;)
-includes(&quot;check_csnippets.lua&quot;)
-includes(&quot;check_cincludes.lua&quot;)
+<pre><code class="lang-lua">includes("check_links.lua")
+includes("check_ctypes.lua")
+includes("check_cfuncs.lua")
+includes("check_features.lua")
+includes("check_csnippets.lua")
+includes("check_cincludes.lua")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.c&quot;)
-    add_configfiles(&quot;config.h.in&quot;)
+target("test")
+    set_kind("binary")
+    add_files("*.c")
+    add_configfiles("config.h.in")
 
-    configvar_check_ctypes(&quot;HAS_WCHAR&quot;, &quot;wchar_t&quot;)
-    configvar_check_cincludes(&quot;HAS_STRING_H&quot;, &quot;string.h&quot;)
-    configvar_check_cincludes(&quot;HAS_STRING_AND_STDIO_H&quot;, {&quot;string.h&quot;, &quot;stdio.h&quot;})
-    configvar_check_ctypes(&quot;HAS_WCHAR_AND_FLOAT&quot;, {&quot;wchar_t&quot;, &quot;float&quot;})
-    configvar_check_links(&quot;HAS_PTHREAD&quot;, {&quot;pthread&quot;, &quot;m&quot;, &quot;dl&quot;})
-    configvar_check_csnippets(&quot;HAS_STATIC_ASSERT&quot;, &quot;_Static_assert(1, \&quot;\&quot;);&quot;)
-    configvar_check_cfuncs(&quot;HAS_SETJMP&quot;, &quot;setjmp&quot;, {includes = {&quot;signal.h&quot;, &quot;setjmp.h&quot;}})
-    configvar_check_features(&quot;HAS_CONSTEXPR&quot;, &quot;cxx_constexpr&quot;)
-    configvar_check_features(&quot;HAS_CONSEXPR_AND_STATIC_ASSERT&quot;, {&quot;cxx_constexpr&quot;, &quot;c_static_assert&quot;}, {languages = &quot;c++11&quot;})
+    configvar_check_ctypes("HAS_WCHAR", "wchar_t")
+    configvar_check_cincludes("HAS_STRING_H", "string.h")
+    configvar_check_cincludes("HAS_STRING_AND_STDIO_H", {"string.h", "stdio.h"})
+    configvar_check_ctypes("HAS_WCHAR_AND_FLOAT", {"wchar_t", "float"})
+    configvar_check_links("HAS_PTHREAD", {"pthread", "m", "dl"})
+    configvar_check_csnippets("HAS_STATIC_ASSERT", "_Static_assert(1, \"\");")
+    configvar_check_cfuncs("HAS_SETJMP", "setjmp", {includes = {"signal.h", "setjmp.h"}})
+    configvar_check_features("HAS_CONSTEXPR", "cxx_constexpr")
+    configvar_check_features("HAS_CONSEXPR_AND_STATIC_ASSERT", {"cxx_constexpr", "c_static_assert"}, {languages = "c++11"})
 </code></pre>
 <p>config.h.in</p>
 <pre><code class="lang-c">${define HAS_STRING_H}
@@ -226,44 +226,44 @@ ${define HAS_CONSEXPR_AND_STATIC_ASSERT}
 <h3 id="set_modes">set_modes</h3>
 <h4 id="set-project-compilation-modes">Set project compilation modes</h4>
 <p>This is an optional api, just to make it easy for plugins to get mode configuration information.</p>
-<pre><code class="lang-lua">set_modes(&quot;debug&quot;, &quot;release&quot;)
+<pre><code class="lang-lua">set_modes("debug", "release")
 </code></pre>
 <p>If you set this configuration, you need not set them manually when generating vs201x project.</p>
 <pre><code class="lang-bash">$ xmake project -k vs2017
 </code></pre>
 <p>Otherwise, you need to run:</p>
-<pre><code class="lang-bash">$ xmake project -k vs2017 -m &quot;debug,release&quot;
+<pre><code class="lang-bash">$ xmake project -k vs2017 -m "debug,release"
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>If you do not set this configuration, <a href="#is_mode">is_mode</a> can also be used normally.<br>&lt;/p&gt;
+<p><p class="tip"><br>If you do not set this configuration, <a href="#is_mode">is_mode</a> can also be used normally.<br></p>
 
 </p>
 <h3 id="set_project">set_project</h3>
 <h4 id="set-project-name">Set project name</h4>
 <p>Set the whole project name, we can set it at the beginning of <code>xmake.lua</code>.</p>
 <pre><code class="lang-lua">-- set project name
-set_project(&quot;tbox&quot;)
+set_project("tbox")
 
 -- set project version
-set_version(&quot;1.5.1&quot;)
+set_version("1.5.1")
 </code></pre>
 <h3 id="set_version">set_version</h3>
 <h4 id="set-project-version">Set project version</h4>
 <p>Set the whole project version, we can set it at the beginning of <code>xmake.lua</code>.</p>
-<pre><code class="lang-lua">set_version(&quot;1.5.1&quot;)
+<pre><code class="lang-lua">set_version("1.5.1")
 </code></pre>
 <p>We can set build version in v2.1.7 version:</p>
-<pre><code class="lang-lua">set_version(&quot;1.5.1&quot;, {build = &quot;%Y%m%d%H%M&quot;})
+<pre><code class="lang-lua">set_version("1.5.1", {build = "%Y%m%d%H%M"})
 </code></pre>
 <p>We can also add version to the config header files, @see <a href="/manual/project_target?id=add-template-configuration-files">add_configfiles</a></p>
 <h3 id="set_xmakever">set_xmakever</h3>
 <h4 id="set-minimal-xmake-version">Set minimal xmake version</h4>
 <p>If the current xmake version less than the required version, it will prompt an error.</p>
 <pre><code class="lang-lua">-- the current xmake version must be larger than 2.1.0
-set_xmakever(&quot;2.1.0&quot;)
+set_xmakever("2.1.0")
 </code></pre>
 <h3 id="add_subdirs">add_subdirs</h3>
 <h4 id="add-sub-project-directories">Add sub-project directories</h4>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>For xmake 2.x and above, try to use the <a href="#includes">includes</a> interface, which is a generic version of add_subdirs and add_subfiles, and supports some built-in extensions.<br>&lt;/p&gt;
+<p><p class="tip"><br>For xmake 2.x and above, try to use the <a href="#includes">includes</a> interface, which is a generic version of add_subdirs and add_subfiles, and supports some built-in extensions.<br></p>
 
 </p>
 <p>This interface will add sub-project directories to the current <code>xmake.lua</code>, it will load the <code>xmake.lua</code> file of the sub-directories.</p>
@@ -277,9 +277,9 @@ set_xmakever(&quot;2.1.0&quot;)
 └── xmake.lua
 `
 </code></pre><p>We can add sub-project <code>tbox</code> and <code>demo</code> directories to the root <code>xmake.lua</code>.</p>
-<pre><code class="lang-lua">add_subdirs(&quot;src/tbox&quot;)
-if is_option(&quot;demo&quot;) then
-    add_subdirs(&quot;src/demo&quot;)
+<pre><code class="lang-lua">add_subdirs("src/tbox")
+if is_option("demo") then
+    add_subdirs("src/demo")
 end
 </code></pre>
 <p>By default, xmake will compile all targets. If you only want to compile a specific target, you can do:</p>
@@ -288,24 +288,24 @@ $ xmake build tbox
 </code></pre>
 <h3 id="add_subfiles">add_subfiles</h3>
 <h4 id="add-sub-project-files">Add sub-project files</h4>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>For xmake 2.x and above, try to use the <a href="#includes">includes</a> interface, which is a generic version of add_subdirs and add_subfiles, and supports some built-in extensions.<br>&lt;/p&gt;
+<p><p class="tip"><br>For xmake 2.x and above, try to use the <a href="#includes">includes</a> interface, which is a generic version of add_subdirs and add_subfiles, and supports some built-in extensions.<br></p>
 
 </p>
 <p><code>add_subfiles</code> is similar to <a href="#add_subdirs">add_subdirs</a>.</p>
 <p>The only difference is that this interface specifies the path to the &#39;xmake.lua&#39; file directly, rather than a directory.</p>
 <p>for example:</p>
-<pre><code class="lang-lua">add_subfiles(&quot;src/tbox/xmake.lua&quot;)
+<pre><code class="lang-lua">add_subfiles("src/tbox/xmake.lua")
 </code></pre>
 <h3 id="add_moduledirs">add_moduledirs</h3>
 <h4 id="add-module-directories">Add module directories</h4>
 <p>The builtin modules are placed in the &#39;xmake/modules&#39; directory, but for user-defined modules for a specific project, you can configure additional module directories in the &#39;xmake.lua` file.</p>
-<pre><code class="lang-lua">add_moduledirs(&quot;$(projectdir)/modules&quot;)
+<pre><code class="lang-lua">add_moduledirs("$(projectdir)/modules")
 </code></pre>
 <p>xmake will load the given module in the given directory when calling <code>import</code>.</p>
 <h3 id="add_plugindirs">add_plugindirs</h3>
 <h4 id="add-plugin-directories">Add plugin directories</h4>
 <p>The builtin plugins are placed in the &#39;xmake/plugins&#39; directory, but for user-defined plugins for a specific project, you can configure additional plugin directories in the &#39;xmake.lua` file.</p>
-<pre><code class="lang-lua">add_plugindirs(&quot;$(projectdir)/plugins&quot;)
+<pre><code class="lang-lua">add_plugindirs("$(projectdir)/plugins")
 </code></pre>
 <p>xmake will load all plugins in the given directory.</p>
 <h3 id="add_packagedirs">add_packagedirs</h3>
@@ -320,11 +320,11 @@ $ xmake build tbox
 - pcre.pkg
 - ...
 </code></pre><p>If you want the current project to load these packages, first specify the package directory path, for example:</p>
-<pre><code class="lang-lua">add_packagedirs(&quot;pkg&quot;)
+<pre><code class="lang-lua">add_packagedirs("pkg")
 </code></pre>
 <p>Then, please add these packages to the given target by <a href="#add_packages">add_packages</a>:</p>
-<pre><code class="lang-lua">target(&quot;tbox&quot;)
-    add_packages(&quot;zlib&quot;, &quot;polarssl&quot;, &quot;pcre&quot;, &quot;mysql&quot;)
+<pre><code class="lang-lua">target("tbox")
+    add_packages("zlib", "polarssl", "pcre", "mysql")
 </code></pre>
 <p>xmake will check these packages automatically and link with them if they exist, and we can disable them manually.</p>
 <pre><code class="lang-bash">$ xmake f --openssl=n
@@ -332,104 +332,104 @@ $ xmake build tbox
 <h3 id="get_config">get_config</h3>
 <h4 id="get-the-configuration-value">Get the configuration value</h4>
 <p>This interface is introduced from version 2.2.2 to get the configuration value from the given name.</p>
-<pre><code class="lang-lua">if get_config(&quot;myconfig&quot;) == &quot;xxx&quot; then
-    add_defines(&quot;HELLO&quot;)
+<pre><code class="lang-lua">if get_config("myconfig") == "xxx" then
+    add_defines("HELLO")
 end
 </code></pre>
 <h3 id="set_config">set_config</h3>
 <h4 id="set-the-default-configuration-value">Set the default configuration value</h4>
 <p>This interface is introduced from version 2.2.2 to set the default configuration value in xmake.lua.</p>
 <p>Many previous configurations, including the build toolchain, build directory, etc.<br>We can only be configured by <code>$xmake f --name=value</code>. If we want to write a default value in xmake.lua, we can use the following method:</p>
-<pre><code class="lang-lua">set_config(&quot;name&quot;, &quot;value&quot;)
-set_config(&quot;buildir&quot;, &quot;other/buildir&quot;)
-set_config(&quot;cc&quot;, &quot;gcc&quot;)
-set_config(&quot;ld&quot;, &quot;g++&quot;)
+<pre><code class="lang-lua">set_config("name", "value")
+set_config("buildir", "other/buildir")
+set_config("cc", "gcc")
+set_config("ld", "g++")
 </code></pre>
 <p>However, we can still modify the default configuration in xmake.lua by <code>$xmake f --name=value</code>.</p>
 <h3 id="add_requires">add_requires</h3>
 <h4 id="add-package-dependencies">Add package dependencies</h4>
-<p>Xmake&#39;s dependency package management fully supports semantic version selection, for example: &quot;~1.6.1&quot;. For a detailed description of semantic versioning, see: <a href="https://semver.org/">https://semver.org/</a></p>
+<p>Xmake&#39;s dependency package management fully supports semantic version selection, for example: "~1.6.1". For a detailed description of semantic versioning, see: <a href="https://semver.org/">https://semver.org/</a></p>
 <p>Some examples:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;pcre 1.3.x&quot;, &quot;libpng ^1.18&quot;)
-add_requires(&quot;libpng ~1.16&quot;, &quot;zlib 1.1.2 || &gt;=1.2.11 &lt;1.3.0&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "pcre 1.3.x", "libpng ^1.18")
+add_requires("libpng ~1.16", "zlib 1.1.2 || >=1.2.11 <1.3.0")
 </code></pre>
 <p>The semantic version parser currently used by xmake is the <a href="https://github.com/uael/sv">sv</a> library contributed by <a href="https://github.com/uael">uael</a>, which also has a description of the version. For detailed instructions, please refer to the following: <a href="https://github.com/uael/sv#versions">Version Description</a></p>
 <p>Of course, if we have no special requirements for the version of the dependency package, we can omit the version:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox", "libpng", "zlib")
 </code></pre>
 <p>This will use the latest known version of the package, or the source code compiled from the master branch. If the current package has a git repository address we can also specify a specific branch version:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox master&quot;)
-add_requires(&quot;tbox dev&quot;)
+<pre><code class="lang-lua">add_requires("tbox master")
+add_requires("tbox dev")
 </code></pre>
 <p>If the specified dependency package is not supported by the current platform, or if the compilation and installation fails, then xmake will exit with an error, which is reasonable for some projects that must rely on certain packages to work.<br>However, if some packages are optional dependencies, they can be set to optional packages even if they are not compiled properly.</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {optional = true})
+<pre><code class="lang-lua">add_requires("tbox", {optional = true})
 </code></pre>
 <p>With the default settings, xmake will first check to see if the system library exists (if no version is required). If the user does not want to use the system library and the library is provided by a third-party package manager, then you can set:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {system = false})
+<pre><code class="lang-lua">add_requires("tbox", {system = false})
 </code></pre>
 <p>If we want to debug the dependencies at the same time, we can set them to use the debug version of the package (provided that this package supports debug compilation):</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {debug = true})
+<pre><code class="lang-lua">add_requires("tbox", {debug = true})
 </code></pre>
 <p>If the current package does not support debug compilation, you can submit the modified compilation rules in the repository to support the debug, for example:</p>
-<pre><code class="lang-lua">package(&quot;openssl&quot;)
-    on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
-        os.vrun(&quot;./config %s --prefix=\&quot;%s\&quot;&quot;, package:debug() and &quot;--debug&quot; or &quot;&quot;, package:installdir())
-        os.vrun(&quot;make -j4&quot;)
-        os.vrun(&quot;make install&quot;)
+<pre><code class="lang-lua">package("openssl")
+    on_install("linux", "macosx", function (package)
+        os.vrun("./config %s --prefix=\"%s\"", package:debug() and "--debug" or "", package:installdir())
+        os.vrun("make -j4")
+        os.vrun("make install")
     end)
 </code></pre>
 <p>Some packages have various compile options at compile time, and we can pass them in. Of course, the package itself supports:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {config = {small=true}})
+<pre><code class="lang-lua">add_requires("tbox", {config = {small=true}})
 </code></pre>
 <p>Pass <code>--small=true</code> to the tbox package so that compiling the installed tbox package is enabled.<br>After v2.2.3, you can control whether you need to add a dependency package in your own definition configuration option parameter by <a href="#option">option</a> and <a href="#has_config">has_config</a>:</p>
-<pre><code class="lang-lua">option(&quot;luajit&quot;)
+<pre><code class="lang-lua">option("luajit")
     set_default(false)
     set_showmenu(true)
-    set_category(&quot;option&quot;)
-    set_description(&quot;Enable the luajit runtime engine.&quot;)
+    set_category("option")
+    set_description("Enable the luajit runtime engine.")
 option_end()
 
-if has_config(&quot;luajit&quot;) then
-    add_requires(&quot;luajit&quot;)
+if has_config("luajit") then
+    add_requires("luajit")
 else
-    add_requires(&quot;lua&quot;)
+    add_requires("lua")
 end
 </code></pre>
 <p>We can switch dependencies by <code>$xmake f --luajit=y</code>.</p>
 <p>And we also added the group parameter to group the dependencies, all the dependencies under the same group, only one can be enabled, the order of the dependencies is the same as the order in which they were added by <code>add_requires</code>:</p>
-<pre><code class="lang-lua">add_requires(&quot;openssl&quot;, {group = &quot;ssl&quot;, optional = true})
-add_requires(&quot;mbedtls&quot;, {group = &quot;ssl&quot;, optional = true})
+<pre><code class="lang-lua">add_requires("openssl", {group = "ssl", optional = true})
+add_requires("mbedtls", {group = "ssl", optional = true})
 
-target(&quot;test&quot;)
-    add_packages(&quot;openssl&quot;, &quot;mbedtls&quot;)
+target("test")
+    add_packages("openssl", "mbedtls")
 </code></pre>
 <p>After version 2.2.5, xmake supports third-party package managers, such as: conan, brew, vcpkg, etc.</p>
 <p>Add a homebrew dependency package:</p>
-<pre><code class="lang-lua">add_requires(&quot;brew::zlib&quot;, {alias = &quot;zlib&quot;}})
-add_requires(&quot;brew::pcre2/libpcre2-8&quot;, {alias = &quot;pcre2&quot;}})
+<pre><code class="lang-lua">add_requires("brew::zlib", {alias = "zlib"}})
+add_requires("brew::pcre2/libpcre2-8", {alias = "pcre2"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;pcre2&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("pcre2", "zlib")
 </code></pre>
 <p>Add a dependency package for vcpkg:</p>
-<pre><code class="lang-lua">add_requires(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+<pre><code class="lang-lua">add_requires("vcpkg::zlib", "vcpkg::pcre2")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("vcpkg::zlib", "vcpkg::pcre2")
 </code></pre>
 <p>Add a conan dependency package:</p>
-<pre><code class="lang-lua">add_requires(&quot;CONAN::zlib/1.2.11@conan/stable&quot;, {alias = &quot;zlib&quot;, debug = true})
-add_requires(&quot;CONAN::OpenSSL/1.0.2n@conan/stable&quot;, {alias = &quot;openssl&quot;,
-    configs = {options = &quot;OpenSSL:shared=True&quot;}})
+<pre><code class="lang-lua">add_requires("CONAN::zlib/1.2.11@conan/stable", {alias = "zlib", debug = true})
+add_requires("CONAN::OpenSSL/1.0.2n@conan/stable", {alias = "openssl",
+    configs = {options = "OpenSSL:shared=True"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("openssl", "zlib")
 </code></pre>
 <p>After executing xmake to compile:</p>
 <pre><code class="lang-console">ruki:test_package ruki$ xmake
@@ -437,12 +437,12 @@ checking for the architecture ... x86_64
 checking for the Xcode directory ... /Applications/Xcode.app
 checking for the SDK version of Xcode ... 10.14
 note: try installing these packages (pass -y to skip confirm)?
-  -&gt; CONAN::zlib/1.2.11@conan/stable  (debug)
-  -&gt; CONAN::OpenSSL/1.0.2n@conan/stable
+  -> CONAN::zlib/1.2.11@conan/stable  (debug)
+  -> CONAN::OpenSSL/1.0.2n@conan/stable
 please input: y (y/n)
 
-  =&gt; installing CONAN::zlib/1.2.11@conan/stable .. ok
-  =&gt; installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
+  => installing CONAN::zlib/1.2.11@conan/stable .. ok
+  => installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
 
 [  0%]: ccache compiling.release src/main.c
 [100%]: linking.release test
@@ -451,20 +451,20 @@ please input: y (y/n)
 <p>Add a clib dependency package:</p>
 <p>Clib is a source-based dependency package manager. The dependent package is downloaded directly to the corresponding library source code, integrated into the project to compile, rather than binary library dependencies.</p>
 <p>It is also very convenient to integrate in xmake. The only thing to note is that you need to add the source code of the corresponding library to xmake.lua, for example:</p>
-<pre><code class="lang-lua">add_requires(&quot;clib::clibs/[email protected]&quot;, {alias = &quot;bytes&quot;})
+<pre><code class="lang-lua">add_requires("clib::clibs/[email protected]", {alias = "bytes"})
 
-target(&quot;xmake-test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;clib/bytes/*.c&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;bytes&quot;)
+target("xmake-test")
+    set_kind("binary")
+    add_files("clib/bytes/*.c")
+    add_files("src/*.c")
+    add_packages("bytes")
 </code></pre>
 <h3 id="add_repositories">add_repositories</h3>
 <h4 id="add-3rd-package-repositories">Add 3rd package repositories</h4>
 <p>If the required package is not in the official repository <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a>, we can submit the contribution code to the repository for support.<br>But if some packages are only for personal or private projects, we can create a private repository repo. The repository organization structure can be found at: <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a></p>
 <p>For example, now we have a private repository repo:<a href="mailto:`[email protected]">`[email protected]</a>:myrepo/xmake-repo.git`</p>
 <p>We can add through this interface:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo [email protected]:myrepo/xmake-repo.git")
 </code></pre>
 <p>If we just want to add one or two private packages, this time to build a git repository is too big, we can directly put the package repository into the project, for example:</p>
 <pre><code>projectdir
@@ -476,7 +476,7 @@ target(&quot;xmake-test&quot;)
     - main.c
   - xmake.lua
 </code></pre><p>The above myrepo directory is your own private package repository, built into your own project, and then add this repository location in xmake.lua:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo myrepo&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo myrepo")
 </code></pre>
 <p>This can be referred to <a href="https://github.com/tboox/benchbox">benchbox</a> project, which has a built-in private repository.</p>
 </article>

+ 18 - 18
mirror/manual/package_dependencies.html

@@ -93,36 +93,36 @@
     <p>The repository depends on the package definition description, the <code>package()</code> related interface definition, etc. There will be time to elaborate, so stay tuned. .</p>
 <p>Please refer to the existing package description in the official repository: <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a></p>
 <p>Here is a more representative example for reference:</p>
-<pre><code class="lang-lua">package(&quot;libxml2&quot;)
+<pre><code class="lang-lua">package("libxml2")
 
-    set_homepage(&quot;http://xmlsoft.org/&quot;)
-    set_description(&quot;The XML C parser and toolkit of Gnome.&quot;)
+    set_homepage("http://xmlsoft.org/")
+    set_description("The XML C parser and toolkit of Gnome.")
 
-    set_urls(&quot;https://github.com/GNOME/libxml2/archive/$(version).zip&quot;, {excludes = {&quot;*/result/*&quot;, &quot;*/test/*&quot;}})
+    set_urls("https://github.com/GNOME/libxml2/archive/$(version).zip", {excludes = {"*/result/*", "*/test/*"}})
 
-    add_versions(&quot;v2.9.8&quot;, &quot;c87793e45e66a7aa19200f861873f75195065de786a21c1b469bdb7bfc1230fb&quot;)
-    add_versions(&quot;v2.9.7&quot;, &quot;31dd4c0e10fa625b47e27fd6a5295d246c883f214da947b9a4a9e13733905ed9&quot;)
+    add_versions("v2.9.8", "c87793e45e66a7aa19200f861873f75195065de786a21c1b469bdb7bfc1230fb")
+    add_versions("v2.9.7", "31dd4c0e10fa625b47e27fd6a5295d246c883f214da947b9a4a9e13733905ed9")
 
-    if is_plat(&quot;macosx&quot;, &quot;linux&quot;) then
-        add_deps(&quot;autoconf&quot;, &quot;automake&quot;, &quot;libtool&quot;, &quot;pkg-config&quot;)
+    if is_plat("macosx", "linux") then
+        add_deps("autoconf", "automake", "libtool", "pkg-config")
     end
 
     on_load(function (package)
-        package:addvar(&quot;includedirs&quot;, &quot;include/libxml2&quot;)
-        package:addvar(&quot;links&quot;, &quot;xml2&quot;)
+        package:addvar("includedirs", "include/libxml2")
+        package:addvar("links", "xml2")
     end)
 
-    if is_plat(&quot;windows&quot;) and winos.version():gt(&quot;winxp&quot;) then
-        on_install(&quot;windows&quot;, function (package)
-            os.cd(&quot;win32&quot;)
-            os.vrun(&quot;cscript configure.js iso8859x=yes iconv=no compiler=msvc cruntime=/MT debug=%s prefix=\&quot;%s\&quot;&quot;, package:debug() and &quot;yes&quot; or &quot;no&quot;, Package:installdir())
-            os.vrun(&quot;nmake /f Makefile.msvc&quot;)
-            os.vrun(&quot;nmake /f Makefile.msvc install&quot;)
+    if is_plat("windows") and winos.version():gt("winxp") then
+        on_install("windows", function (package)
+            os.cd("win32")
+            os.vrun("cscript configure.js iso8859x=yes iconv=no compiler=msvc cruntime=/MT debug=%s prefix=\"%s\"", package:debug() and "yes" or "no", Package:installdir())
+            os.vrun("nmake /f Makefile.msvc")
+            os.vrun("nmake /f Makefile.msvc install")
         end)
     end
 
-    on_install(&quot;macosx&quot;, &quot;linux&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).install(package, {&quot;--disable-dependency-tracking&quot;, &quot;--without-python&quot;, &quot;--without-lzma&quot;})
+    on_install("macosx", "linux", function (package)
+        import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--without-python", "--without-lzma"})
     end)
 </code></pre>
 </article>

+ 46 - 46
mirror/manual/plugin_task.html

@@ -104,27 +104,27 @@
 <tr>
 <td><a href="#task">task</a></td>
 <td>Define plugins or tasks</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#task_end">task_end</a></td>
 <td>End defining plugins or tasks</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="#taskset_menu">set_menu</a></td>
 <td>Set Task Menu</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#taskset_category">set_category</a></td>
 <td>Set Task Category</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#taskon_run">on_run</a></td>
 <td>Set Task Run Script</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 </tbody>
 </table>
@@ -132,24 +132,24 @@
 <h4 id="defining-plugins-or-tasks">Defining plugins or tasks</h4>
 <p>The <code>task</code> field is used to describe a custom task implementation, in the same level as <a href="#target">target</a> and <a href="#option">option</a>.</p>
 <p>For example, here is a simple task defined:</p>
-<pre><code class="lang-lua">task(&quot;hello&quot;)
+<pre><code class="lang-lua">task("hello")
 
     -- Set the run script
     on_run(function ()
-        print(&quot;hello xmake!&quot;)
+        print("hello xmake!")
     end)
 </code></pre>
 <p>This task only needs to print <code>hello xmake!</code>, how do you run it?</p>
 <p>Since the <a href="#taskset_menu">set_menu</a> setting menu is not used here, this task can only be called inside the custom script of <code>xmake.lua</code> or other tasks, for example:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
 
     after_build(function (target)
 
         -- Import task module
-        import(&quot;core.project.task&quot;)
+        import("core.project.task")
 
         -- Run the hello task
-        task.run(&quot;hello&quot;)
+        task.run("hello")
     end)
 </code></pre>
 <p>Run the <code>hello</code> task after building the <code>test</code> target.</p>
@@ -159,60 +159,60 @@
 <h3 id="task-set_menu">task:set_menu</h3>
 <h4 id="setting-the-task-menu">Setting the task menu</h4>
 <p>By setting a menu, this task can be opened to the user to manually call through the command line. The menu settings are as follows:</p>
-<pre><code class="lang-lua">task(&quot;echo&quot;)
+<pre><code class="lang-lua">task("echo")
 
     -- Set the run script
     on_run(function ()
 
         -- Import parameter option module
-        import(&quot;core.base.option&quot;)
+        import("core.base.option")
 
         -- Initialize color mode
-        local modes = &quot;&quot;
-        for _, mode in ipairs({&quot;bright&quot;, &quot;dim&quot;, &quot;blink&quot;, &quot;reverse&quot;}) do
+        local modes = ""
+        for _, mode in ipairs({"bright", "dim", "blink", "reverse"}) do
             if option.get(mode) then
-                modes = modes .. &quot; &quot; .. mode
+                modes = modes .. " " .. mode
             end
         end
 
         -- Get parameter content and display information
-        cprint(&quot;${%s%s}%s&quot;, option.get(&quot;color&quot;), modes, table.concat(option.get(&quot;contents&quot;) or {}, &quot; &quot;))
+        cprint("${%s%s}%s", option.get("color"), modes, table.concat(option.get("contents") or {}, " "))
     end)
 
     -- Set the command line options for the plugin. There are no parameter options here, just the plugin description.
     set_menu {
                 -- Settings menu usage
-                usage = &quot;xmake echo [options]&quot;
+                usage = "xmake echo [options]"
 
                 -- Setup menu description
-            ,   description = &quot;Echo the given info!&quot;
+            ,   description = "Echo the given info!"
 
                 -- Set menu options, if there are no options, you can set it to {}
             ,   options =
                 {
                     -- Set k mode as key-only bool parameter
-                    {&#39;b&#39;, &quot;bright&quot;, &quot;k&quot;, nil, &quot;Enable bright.&quot; }
-                ,   {&#39;d&#39;, &quot;dim&quot;, &quot;k&quot;, nil, &quot;Enable dim.&quot; }
-                ,   {&#39;-&#39;, &quot;blink&quot;, &quot;k&quot;, nil, &quot;Enable blink.&quot; }
-                ,   {&#39;r&#39;, &quot;reverse&quot;, &quot;k&quot;, nil, &quot;Reverse color.&quot; }
+                    {&#39;b&#39;, "bright", "k", nil, "Enable bright." }
+                ,   {&#39;d&#39;, "dim", "k", nil, "Enable dim." }
+                ,   {&#39;-&#39;, "blink", "k", nil, "Enable blink." }
+                ,   {&#39;r&#39;, "reverse", "k", nil, "Reverse color." }
 
                     -- When the menu is displayed, a blank line
                 ,   {}
 
                     -- Set kv as the key-value parameter and set the default value: black
-                ,   {&#39;c&#39;, &quot;color&quot;, &quot;kv&quot;, &quot;black&quot;, &quot;Set the output color.&quot;
-                                                     , &quot; - red&quot;
-                                                     , &quot; - blue&quot;
-                                                     , &quot; - yellow&quot;
-                                                     , &quot; - green&quot;
-                                                     , &quot; - magenta&quot;
-                                                     , &quot; - cyan&quot;
-                                                     , &quot; - white&quot; }
+                ,   {&#39;c&#39;, "color", "kv", "black", "Set the output color."
+                                                     , " - red"
+                                                     , " - blue"
+                                                     , " - yellow"
+                                                     , " - green"
+                                                     , " - magenta"
+                                                     , " - cyan"
+                                                     , " - white" }
 
                     -- Set `vs` as a value multivalued parameter and a `v` single value type
                     -- generally placed last, used to get a list of variable parameters
                 ,   {}
-                ,   {nil, &quot;contents&quot;, &quot;vs&quot;, nil, &quot;The info contents.&quot; }
+                ,   {nil, "contents", "vs", nil, "The info contents." }
                 }
             }
 </code></pre>
@@ -266,7 +266,7 @@ Options:
 
     Contents ... The info contents.
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>The most part of the menu is the common options built into xmake. Basically, each task will be used. You don&#39;t need to define it yourself to simplify the menu definition.<br>&lt;/p&gt;
+<p><p class="tip"><br>The most part of the menu is the common options built into xmake. Basically, each task will be used. You don&#39;t need to define it yourself to simplify the menu definition.<br></p>
 
 </p>
 <p>Below, let&#39;s actually run this task, for example, I want to display the red <code>hello xmake!</code>, only need to:</p>
@@ -275,11 +275,11 @@ Options:
 <p>You can also use the full name of the option and highlight it:</p>
 <pre><code class="lang-bash">$ xmake echo --color=red --bright hello xmake!
 </code></pre>
-<p>The last variable argument list is retrieved by <code>option.get(&quot;contents&quot;)</code> in the <code>run</code> script, which returns an array of type <code>table</code>.</p>
+<p>The last variable argument list is retrieved by <code>option.get("contents")</code> in the <code>run</code> script, which returns an array of type <code>table</code>.</p>
 <h3 id="task-set_category">task:set_category</h3>
 <h4 id="setting-task-categories">Setting task categories</h4>
 <p>It is only used for grouping of menus. Of course, the plugin will use <code>plugin</code> by default. The built-in task will use <code>action</code> by default, but it is just a convention.</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>You can use any name you define yourself. The same name will be grouped and displayed together. If it is set to <code>plugin</code>, it will be displayed in the Plugins group of xmake.<br>&lt;/p&gt;
+<p><p class="tip"><br>You can use any name you define yourself. The same name will be grouped and displayed together. If it is set to <code>plugin</code>, it will be displayed in the Plugins group of xmake.<br></p>
 
 </p>
 <p>E.g:</p>
@@ -296,16 +296,16 @@ Options:
 <h3 id="task-on_run">task:on_run</h3>
 <h4 id="setting-up-a-task-to-run-a-script">Setting up a task to run a script</h4>
 <p>There are two ways to set it up. The easiest way is to set the inline function:</p>
-<pre><code class="lang-lua">task(&quot;hello&quot;)
+<pre><code class="lang-lua">task("hello")
 
     on_run(function ()
-        print(&quot;hello xmake!&quot;)
+        print("hello xmake!")
     end)
 </code></pre>
 <p>This is convenient and small for small tasks, but it is not suitable for large tasks, such as plugins, which require complex scripting support.</p>
 <p>This time you need a separate module file to set up the run script, for example:</p>
-<pre><code class="lang-lua">task(&quot;hello&quot;)
-    on_run(&quot;main&quot;)
+<pre><code class="lang-lua">task("hello")
+    on_run("main")
 </code></pre>
 <p>Here the <code>main</code> is set to run the main entry module for the script. The file name is <code>main.lua</code>, placed in the same directory as <code>xmake.lua</code> that defines <code>task</code>. Of course, you can use other file names.</p>
 <p>The directory structure is as follows:</p>
@@ -314,18 +314,18 @@ Options:
     - main.lua
 </code></pre><p>The contents of <code>main.lua</code> are as follows:</p>
 <pre><code class="lang-lua">function main(...)
-    print(&quot;hello xmake!&quot;)
+    print("hello xmake!")
 end
 </code></pre>
 <p>It&#39;s a simple script file with the main function of <code>main</code>. You can import various extension modules via <a href="/manual/builtin_modules?id=import">import</a> to implement complex functions, such as:</p>
 <pre><code class="lang-lua">-- Import parameter option module
-import(&quot;core.base.option&quot;)
+import("core.base.option")
 
 -- Entrance function
 function main(...)
 
     -- Get the parameter content
-    print(&quot;color: %s&quot;, option.get(&quot;color&quot;))
+    print("color: %s", option.get("color"))
 end
 </code></pre>
 <p>You can also create multiple custom module files in the current directory and use them after importing via <a href="/manual/builtin_modules?id=import">import</a>, for example:</p>
@@ -336,14 +336,14 @@ end
 </code></pre><p>The contents of <code>module.lua</code> are as follows:</p>
 <pre><code class="lang-lua">-- Define an export interface
 function hello()
-    print(&quot;hello xmake!&quot;)
+    print("hello xmake!")
 end
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>The private interface is named by the <code>_hello</code> with a descending line prefix, so that the imported module will not contain this interface and will only be used inside the module itself.<br>&lt;/p&gt;
+<p><p class="tip"><br>The private interface is named by the <code>_hello</code> with a descending line prefix, so that the imported module will not contain this interface and will only be used inside the module itself.<br></p>
 
 </p>
 <p>Then make a call in <code>main.lua</code>:</p>
-<pre><code class="lang-lua">import(&quot;module&quot;)
+<pre><code class="lang-lua">import("module")
 
 function main(...)
     module.hello()
@@ -351,9 +351,9 @@ end
 </code></pre>
 <p>For more modules, see: <a href="/manual/builtin_modules">Builtin Module</a> and <a href="/manual/extension_modules">Extension Module</a></p>
 <p>Among them, the parameter in <code>main(...)</code> is specified by <code>task.run</code>, for example:</p>
-<pre><code class="lang-lua">task.run(&quot;hello&quot;, {color=&quot;red&quot;}, arg1, arg2, arg3)
+<pre><code class="lang-lua">task.run("hello", {color="red"}, arg1, arg2, arg3)
 </code></pre>
-<p>Inside the <code>arg1, arg2</code> these are the arguments to the <code>hello</code> task <code>main(...)</code> entry, and <code>{color=&quot;red&quot;}</code> to specify the parameter options in the task menu.</p>
+<p>Inside the <code>arg1, arg2</code> these are the arguments to the <code>hello</code> task <code>main(...)</code> entry, and <code>{color="red"}</code> to specify the parameter options in the task menu.</p>
 <p>For a more detailed description of <code>task.run</code>, see: <a href="#task-run">task.run</a></p>
 </article>
 </body>

File diff suppressed because it is too large
+ 214 - 214
mirror/manual/project_target.html


+ 3 - 3
mirror/manual/specification.html

@@ -115,7 +115,7 @@
 </tr>
 <tr>
 <td><code>…s</code> + xxx <em>(plural)</em></td>
-<td>Support multi-parameters, .e.g:<code>add_files(&quot;*.c&quot;, &quot;test.cpp&quot;)</code></td>
+<td>Support multi-parameters, .e.g:<code>add_files("*.c", "test.cpp")</code></td>
 </tr>
 <tr>
 <td><code>on_</code> + xxx</td>
@@ -130,8 +130,8 @@
 <td>Set and run this script after running builtin-script</td>
 </tr>
 <tr>
-<td><code>scope(&quot;name&quot;)</code></td>
-<td>Define a description scope, .e.g <code>target(&quot;xxx&quot;)</code>, <code>option(&quot;xxx&quot;)</code></td>
+<td><code>scope("name")</code></td>
+<td>Define a description scope, .e.g <code>target("xxx")</code>, <code>option("xxx")</code></td>
 </tr>
 <tr>
 <td>scope/settings</td>

File diff suppressed because it is too large
+ 297 - 297
mirror/old/manual.html


+ 70 - 70
mirror/old/plugins.html

@@ -110,25 +110,25 @@
 <h4 id="quick-start">Quick Start</h4>
 <p>Now we write a simple plugin demo for printing &#39;hello xmake!&#39;</p>
 <pre><code class="lang-lua">-- define a plugin task 
-task(&quot;hello&quot;)
+task("hello")
 
     -- set the category for showing it in plugin category menu (optional)
-    set_category(&quot;plugin&quot;)
+    set_category("plugin")
 
     -- the main entry of the plugin
     on_run(function ()
 
         -- print &#39;hello xmake!&#39;
-        print(&quot;hello xmake!&quot;)
+        print("hello xmake!")
     end)
 
     -- set the menu options, but we put empty options now.
     set_menu {
                 -- usage
-                usage = &quot;xmake hello [options]&quot;
+                usage = "xmake hello [options]"
 
                 -- description
-            ,   description = &quot;Hello xmake!&quot;
+            ,   description = "Hello xmake!"
 
                 -- options
             ,   options = {}
@@ -142,7 +142,7 @@ task(&quot;hello&quot;)
 <ol>
 <li>Put this plugin directory into xmake/plugins the source codes as the builtin plugin.</li>
 <li>Put this plugin directory into ~/.xmake/plugins as the global user plugin.</li>
-<li>Put this plugin directory to anywhere and call <code>add_plugindirs(&quot;./hello&quot;)</code> in xmake.lua as the local project plugin.</li>
+<li>Put this plugin directory to anywhere and call <code>add_plugindirs("./hello")</code> in xmake.lua as the local project plugin.</li>
 </ol>
 <h4 id="run-plugin">Run Plugin</h4>
 <p>Next we run this plugin</p>
@@ -152,16 +152,16 @@ task(&quot;hello&quot;)
 <pre><code>hello xmake!
 </code></pre><p>Finally, we can also run this plugin in the custom scripts of <code>xmake.lua</code></p>
 <pre><code class="lang-lua">
-target(&quot;demo&quot;)
+target("demo")
 
     -- run this plugin after building target
     after_build(function (target)
 
         -- import task module
-        import(&quot;core.project.task&quot;)
+        import("core.project.task")
 
         -- run the plugin task
-        task.run(&quot;hello&quot;)
+        task.run("hello")
     end)
 </code></pre>
 <h2 id="builtin-plugins">Builtin Plugins</h2>
@@ -223,22 +223,22 @@ $ xmake macro --export=/xxx/macrodir
 <h5 id="custom-macro-script">Custom Macro Script</h5>
 <p>Create and write a <code>macro.lua</code> script first.</p>
 <pre><code class="lang-lua">function main()
-    os.exec(&quot;xmake f -p android --ndk=/xxx/ndk -a arm64-v8a&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p mingw --sdk=/mingwsdk&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a armv7&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a arm64&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a armv7s&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a i386&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a x86_64&quot;)
-    os.exec(&quot;xmake p&quot;)  
+    os.exec("xmake f -p android --ndk=/xxx/ndk -a arm64-v8a")
+    os.exec("xmake p")
+    os.exec("xmake f -p mingw --sdk=/mingwsdk")
+    os.exec("xmake p")
+    os.exec("xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a armv7")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a arm64")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a armv7s")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a i386")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a x86_64")
+    os.exec("xmake p")  
 end
 </code></pre>
 <p>Import this macro script to xmake.</p>
@@ -255,52 +255,52 @@ end
 <h5 id="advance-macro-script">Advance Macro Script</h5>
 <p>Let&#39;s see the <code>package</code> macro script:</p>
 <pre><code class="lang-lua">-- imports
-import(&quot;core.base.option&quot;)
-import(&quot;core.project.config&quot;)
-import(&quot;core.project.project&quot;)
-import(&quot;core.platform.platform&quot;)
+import("core.base.option")
+import("core.project.config")
+import("core.project.project")
+import("core.platform.platform")
 
 -- the options
 local options =
 {
-    {&#39;p&#39;, &quot;plat&quot;,       &quot;kv&quot;,  os.host(),   &quot;Set the platform.&quot;                                    }
-,   {&#39;f&#39;, &quot;config&quot;,     &quot;kv&quot;,  nil,         &quot;Pass the config arguments to \&quot;xmake config\&quot; ..&quot;     }
-,   {&#39;o&#39;, &quot;outputdir&quot;,  &quot;kv&quot;,  nil,         &quot;Set the output directory of the package.&quot;             }
+    {&#39;p&#39;, "plat",       "kv",  os.host(),   "Set the platform."                                    }
+,   {&#39;f&#39;, "config",     "kv",  nil,         "Pass the config arguments to \"xmake config\" .."     }
+,   {&#39;o&#39;, "outputdir",  "kv",  nil,         "Set the output directory of the package."             }
 }
 
 -- package all
 --
 -- .e.g
 -- xmake m package 
--- xmake m package -f &quot;-m debug&quot;
+-- xmake m package -f "-m debug"
 -- xmake m package -p linux
--- xmake m package -p iphoneos -f &quot;-m debug --xxx ...&quot; -o /tmp/xxx
--- xmake m package -f \&quot;--mode=debug\&quot;
+-- xmake m package -p iphoneos -f "-m debug --xxx ..." -o /tmp/xxx
+-- xmake m package -f \"--mode=debug\"
 --
 function main(argv)
 
     -- parse arguments
-    local args = option.parse(argv, options, &quot;Package all architectures for the given the platform.&quot;
-                                           , &quot;&quot;
-                                           , &quot;Usage: xmake macro package [options]&quot;)
+    local args = option.parse(argv, options, "Package all architectures for the given the platform."
+                                           , ""
+                                           , "Usage: xmake macro package [options]")
 
     -- package all archs
     local plat = args.plat
     for _, arch in ipairs(platform.archs(plat)) do
 
         -- config it
-        os.exec(&quot;xmake f -p %s -a %s %s -c %s&quot;, plat, arch, args.config or &quot;&quot;, ifelse(option.get(&quot;verbose&quot;), &quot;-v&quot;, &quot;&quot;))
+        os.exec("xmake f -p %s -a %s %s -c %s", plat, arch, args.config or "", ifelse(option.get("verbose"), "-v", ""))
 
         -- package it
         if args.outputdir then
-            os.exec(&quot;xmake p -o %s %s&quot;, args.outputdir, ifelse(option.get(&quot;verbose&quot;), &quot;-v&quot;, &quot;&quot;))
+            os.exec("xmake p -o %s %s", args.outputdir, ifelse(option.get("verbose"), "-v", ""))
         else
-            os.exec(&quot;xmake p %s&quot;, ifelse(option.get(&quot;verbose&quot;), &quot;-v&quot;, &quot;&quot;))
+            os.exec("xmake p %s", ifelse(option.get("verbose"), "-v", ""))
         end
     end
 
     -- package universal for iphoneos, watchos ...
-    if plat == &quot;iphoneos&quot; or plat == &quot;watchos&quot; then
+    if plat == "iphoneos" or plat == "watchos" then
 
         -- load configure
         config.load()
@@ -312,13 +312,13 @@ function main(argv)
         os.cd(project.directory())
 
         -- the outputdir directory
-        local outputdir = args.outputdir or config.get(&quot;buildir&quot;)
+        local outputdir = args.outputdir or config.get("buildir")
 
         -- package all targets
         for _, target in pairs(project.targets()) do
 
             -- get all modes
-            local modedirs = os.match(format(&quot;%s/%s.pkg/lib/*&quot;, outputdir, target:name()), true)
+            local modedirs = os.match(format("%s/%s.pkg/lib/*", outputdir, target:name()), true)
             for _, modedir in ipairs(modedirs) do
 
                 -- get mode
@@ -327,41 +327,41 @@ function main(argv)
                 -- make lipo arguments
                 local lipoargs = nil
                 for _, arch in ipairs(platform.archs(plat)) do
-                    local archfile = format(&quot;%s/%s.pkg/lib/%s/%s/%s/%s&quot;, outputdir, target:name(), mode, plat, arch, path.filename(target:targetfile())) 
+                    local archfile = format("%s/%s.pkg/lib/%s/%s/%s/%s", outputdir, target:name(), mode, plat, arch, path.filename(target:targetfile())) 
                     if os.isfile(archfile) then
-                        lipoargs = format(&quot;%s -arch %s %s&quot;, lipoargs or &quot;&quot;, arch, archfile) 
+                        lipoargs = format("%s -arch %s %s", lipoargs or "", arch, archfile) 
                     end
                 end
                 if lipoargs then
 
                     -- make full lipo arguments
-                    lipoargs = format(&quot;-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s&quot;, lipoargs, outputdir, target:name(), mode, plat, path.filename(target:targetfile()))
+                    lipoargs = format("-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s", lipoargs, outputdir, target:name(), mode, plat, path.filename(target:targetfile()))
 
                     -- make universal directory
-                    os.mkdir(format(&quot;%s/%s.pkg/lib/%s/%s/universal&quot;, outputdir, target:name(), mode, plat))
+                    os.mkdir(format("%s/%s.pkg/lib/%s/%s/universal", outputdir, target:name(), mode, plat))
 
                     -- package all archs
-                    os.execv(&quot;xmake&quot;, {&quot;l&quot;, &quot;lipo&quot;, lipoargs})
+                    os.execv("xmake", {"l", "lipo", lipoargs})
                 end
             end
         end
     end
 end
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    If you want to known more options, please run: <code>xmake macro --help</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    If you want to known more options, please run: <code>xmake macro --help</code><br></p>
 
 </p>
 <h4 id="run-the-custom-lua-script">Run the Custom Lua Script</h4>
 <h5 id="run-the-given-script">Run the given script</h5>
 <p>Write a simple lua script:</p>
 <pre><code class="lang-lua">function main()
-    print(&quot;hello xmake!&quot;)
+    print("hello xmake!")
 end
 </code></pre>
 <p>Run this lua script.</p>
 <pre><code class="lang-bash">$ xmake lua /tmp/test.lua
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    You can also use <code>import</code> api to write a more advance lua script.<br>&lt;/p&gt;
+<p><p class="tip"><br>    You can also use <code>import</code> api to write a more advance lua script.<br></p>
 
 </p>
 <h5 id="run-the-builtin-script">Run the builtin script</h5>
@@ -376,37 +376,37 @@ scripts:
 </code></pre>
 <p>And run them:</p>
 <pre><code class="lang-bash">$ xmake lua cat ~/file.txt
-$ xmake lua echo &quot;hello xmake&quot;
+$ xmake lua echo "hello xmake"
 $ xmake lua cp /tmp/file /tmp/file2
 $ xmake lua versioninfo
 </code></pre>
 <h5 id="run-interactive-commands-repl-">Run interactive commands (REPL)</h5>
 <p>Enter interactive mode:</p>
 <pre><code class="lang-bash">$ xmake lua
-&gt; 1 + 2
+> 1 + 2
 3
 
-&gt; a = 1
-&gt; a
+> a = 1
+> a
 1
 
-&gt; for _, v in pairs({1, 2, 3}) do
-&gt;&gt; print(v)
-&gt;&gt; end
+> for _, v in pairs({1, 2, 3}) do
+>> print(v)
+>> end
 1
 2
 3
 </code></pre>
 <p>And we can <code>import</code> modules:</p>
-<pre><code class="lang-bash">&gt; task = import(&quot;core.project.task&quot;)
-&gt; task.run(&quot;hello&quot;)
+<pre><code class="lang-bash">> task = import("core.project.task")
+> task.run("hello")
 hello xmake!
 </code></pre>
 <p>If you want to cancel multiline input, please input character <code>q</code>, for example:</p>
-<pre><code class="lang-bash">&gt; for _, v in ipairs({1, 2}) do
-&gt;&gt; print(v)
-&gt;&gt; q             &lt;--  cancel multiline and clear previous input
-&gt; 1 + 2
+<pre><code class="lang-bash">> for _, v in ipairs({1, 2}) do
+>> print(v)
+>> q             <--  cancel multiline and clear previous input
+> 1 + 2
 3
 </code></pre>
 <h4 id="generate-ide-project-files">Generate IDE Project Files</h4>
@@ -419,9 +419,9 @@ hello xmake!
 </code></pre>
 <p>The the content of the output file:</p>
 <pre><code>[
-  { &quot;directory&quot;: &quot;/home/user/llvm/build&quot;,
-    &quot;command&quot;: &quot;/usr/bin/clang++ -Irelative -DSOMEDEF=\&quot;With spaces, quotes and \\-es.\&quot; -c -o file.o file.cc&quot;,
-    &quot;file&quot;: &quot;file.cc&quot; },
+  { "directory": "/home/user/llvm/build",
+    "command": "/usr/bin/clang++ -Irelative -DSOMEDEF=\"With spaces, quotes and \\-es.\" -c -o file.o file.cc",
+    "file": "file.cc" },
   ...
 ]
 
@@ -431,11 +431,11 @@ hello xmake!
 </code></pre>
 <p>v2.1.2 or later, it supports multi-mode and multi-architecture generation for vs201x project.</p>
 <p>For example:</p>
-<pre><code class="lang-bash">$ xmake project -k vs2017 -m &quot;debug,release&quot;
+<pre><code class="lang-bash">$ xmake project -k vs2017 -m "debug,release"
 </code></pre>
 <p>It will generate four project configurations: <code>debug|x86</code>, <code>debug|x64</code>, <code>release|x86</code>, <code>release|x64</code>.</p>
 <p>Or you can set modes to <code>xmake.lua</code>:</p>
-<pre><code class="lang-lua">set_modes(&quot;debug&quot;, &quot;release&quot;)
+<pre><code class="lang-lua">set_modes("debug", "release")
 </code></pre>
 <p>Then, we run the following command:</p>
 <pre><code class="lang-bash">$ xmake project -k vs2017

File diff suppressed because it is too large
+ 295 - 295
mirror/old/zh/manual.html


+ 72 - 72
mirror/old/zh/plugins.html

@@ -110,26 +110,26 @@
 <h4 id="-">快速开始</h4>
 <p>接下来我们介绍下本文的重点,一个简单的hello xmake插件的开发,代码如下:</p>
 <pre><code class="lang-lua">-- 定义一个名叫hello的插件任务
-task(&quot;hello&quot;)
+task("hello")
 
     -- 设置类型为插件
-    set_category(&quot;plugin&quot;)
+    set_category("plugin")
 
     -- 插件运行的入口
     on_run(function ()
 
         -- 显示hello xmake!
-        print(&quot;hello xmake!&quot;)
+        print("hello xmake!")
 
     end)
 
     -- 设置插件的命令行选项,这里没有任何参数选项,仅仅显示插件描述
     set_menu {
                 -- usage
-                usage = &quot;xmake hello [options]&quot;
+                usage = "xmake hello [options]"
 
                 -- description
-            ,   description = &quot;Hello xmake!&quot;
+            ,   description = "Hello xmake!"
 
                 -- options
             ,   options = {}
@@ -143,7 +143,7 @@ task(&quot;hello&quot;)
 <ol>
 <li>把 hello 这个文件夹放置在 xmake的插件安装目录 <code>xmake/plugins</code>,这个里面都是些内建的插件</li>
 <li>把 hello 文件夹放置在 <code>~/.xmake/plugins</code> 用户全局目录,这样对当前xmake 全局生效</li>
-<li>把 hello 文件夹放置在任意地方,通过在工程描述文件xmake.lua中调用<code>add_plugindirs(&quot;./hello&quot;)</code> 添加当前的工程的插件搜索目录,这样只对当前工程生效</li>
+<li>把 hello 文件夹放置在任意地方,通过在工程描述文件xmake.lua中调用<code>add_plugindirs("./hello")</code> 添加当前的工程的插件搜索目录,这样只对当前工程生效</li>
 </ol>
 <h4 id="-">运行插件</h4>
 <p>接下来,我们尝试运行下这个插件:</p>
@@ -152,16 +152,16 @@ task(&quot;hello&quot;)
 <p>显示结果:</p>
 <pre><code>hello xmake!
 </code></pre><p>最后我们还可以在target自定义的脚本中运行这个插件:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;)
+<pre><code class="lang-lua">target("demo")
 
     -- 构建之后运行插件
     after_build(function (target)
 
         -- 导入task模块
-        import(&quot;core.project.task&quot;)
+        import("core.project.task")
 
         -- 运行插件任务
-        task.run(&quot;hello&quot;)
+        task.run("hello")
     end)
 </code></pre>
 <h2 id="-">内置插件</h2>
@@ -232,22 +232,22 @@ $ xmake macro --export=/xxx/macrodir
 <h5 id="-">自定义宏脚本</h5>
 <p>我们也可以自己编写个宏脚本 <code>macro.lua</code> 然后导入到xmake中去。</p>
 <pre><code class="lang-lua">function main()
-    os.exec(&quot;xmake f -p android --ndk=/xxx/ndk -a arm64-v8a&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p mingw --sdk=/mingwsdk&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a armv7&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a arm64&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a armv7s&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a i386&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a x86_64&quot;)
-    os.exec(&quot;xmake p&quot;)  
+    os.exec("xmake f -p android --ndk=/xxx/ndk -a arm64-v8a")
+    os.exec("xmake p")
+    os.exec("xmake f -p mingw --sdk=/mingwsdk")
+    os.exec("xmake p")
+    os.exec("xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a armv7")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a arm64")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a armv7s")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a i386")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a x86_64")
+    os.exec("xmake p")  
 end
 </code></pre>
 <p>导入到xmake,并且定义宏名字:</p>
@@ -264,52 +264,52 @@ end
 <h5 id="-">高级的宏脚本编写</h5>
 <p>以上面提到的<code>package</code>宏为例,我们看下其具体代码,里面通过<code>import</code>导入一些扩展模块,实现了复杂的脚本操作。</p>
 <pre><code class="lang-lua">-- imports
-import(&quot;core.base.option&quot;)
-import(&quot;core.project.config&quot;)
-import(&quot;core.project.project&quot;)
-import(&quot;core.platform.platform&quot;)
+import("core.base.option")
+import("core.project.config")
+import("core.project.project")
+import("core.platform.platform")
 
 -- the options
 local options =
 {
-    {&#39;p&#39;, &quot;plat&quot;,       &quot;kv&quot;,  os.host(),   &quot;Set the platform.&quot;                                    }
-,   {&#39;f&#39;, &quot;config&quot;,     &quot;kv&quot;,  nil,         &quot;Pass the config arguments to \&quot;xmake config\&quot; ..&quot;     }
-,   {&#39;o&#39;, &quot;outputdir&quot;,  &quot;kv&quot;,  nil,         &quot;Set the output directory of the package.&quot;             }
+    {&#39;p&#39;, "plat",       "kv",  os.host(),   "Set the platform."                                    }
+,   {&#39;f&#39;, "config",     "kv",  nil,         "Pass the config arguments to \"xmake config\" .."     }
+,   {&#39;o&#39;, "outputdir",  "kv",  nil,         "Set the output directory of the package."             }
 }
 
 -- package all
 --
 -- .e.g
 -- xmake m package 
--- xmake m package -f &quot;-m debug&quot;
+-- xmake m package -f "-m debug"
 -- xmake m package -p linux
--- xmake m package -p iphoneos -f &quot;-m debug --xxx ...&quot; -o /tmp/xxx
--- xmake m package -f \&quot;--mode=debug\&quot;
+-- xmake m package -p iphoneos -f "-m debug --xxx ..." -o /tmp/xxx
+-- xmake m package -f \"--mode=debug\"
 --
 function main(argv)
 
     -- parse arguments
-    local args = option.parse(argv, options, &quot;Package all architectures for the given the platform.&quot;
-                                           , &quot;&quot;
-                                           , &quot;Usage: xmake macro package [options]&quot;)
+    local args = option.parse(argv, options, "Package all architectures for the given the platform."
+                                           , ""
+                                           , "Usage: xmake macro package [options]")
 
     -- package all archs
     local plat = args.plat
     for _, arch in ipairs(platform.archs(plat)) do
 
         -- config it
-        os.exec(&quot;xmake f -p %s -a %s %s -c %s&quot;, plat, arch, args.config or &quot;&quot;, ifelse(option.get(&quot;verbose&quot;), &quot;-v&quot;, &quot;&quot;))
+        os.exec("xmake f -p %s -a %s %s -c %s", plat, arch, args.config or "", ifelse(option.get("verbose"), "-v", ""))
 
         -- package it
         if args.outputdir then
-            os.exec(&quot;xmake p -o %s %s&quot;, args.outputdir, ifelse(option.get(&quot;verbose&quot;), &quot;-v&quot;, &quot;&quot;))
+            os.exec("xmake p -o %s %s", args.outputdir, ifelse(option.get("verbose"), "-v", ""))
         else
-            os.exec(&quot;xmake p %s&quot;, ifelse(option.get(&quot;verbose&quot;), &quot;-v&quot;, &quot;&quot;))
+            os.exec("xmake p %s", ifelse(option.get("verbose"), "-v", ""))
         end
     end
 
     -- package universal for iphoneos, watchos ...
-    if plat == &quot;iphoneos&quot; or plat == &quot;watchos&quot; then
+    if plat == "iphoneos" or plat == "watchos" then
 
         -- load configure
         config.load()
@@ -321,13 +321,13 @@ function main(argv)
         os.cd(project.directory())
 
         -- the outputdir directory
-        local outputdir = args.outputdir or config.get(&quot;buildir&quot;)
+        local outputdir = args.outputdir or config.get("buildir")
 
         -- package all targets
         for _, target in pairs(project.targets()) do
 
             -- get all modes
-            local modedirs = os.match(format(&quot;%s/%s.pkg/lib/*&quot;, outputdir, target:name()), true)
+            local modedirs = os.match(format("%s/%s.pkg/lib/*", outputdir, target:name()), true)
             for _, modedir in ipairs(modedirs) do
 
                 -- get mode
@@ -336,28 +336,28 @@ function main(argv)
                 -- make lipo arguments
                 local lipoargs = nil
                 for _, arch in ipairs(platform.archs(plat)) do
-                    local archfile = format(&quot;%s/%s.pkg/lib/%s/%s/%s/%s&quot;, outputdir, target:name(), mode, plat, arch, path.filename(target:targetfile())) 
+                    local archfile = format("%s/%s.pkg/lib/%s/%s/%s/%s", outputdir, target:name(), mode, plat, arch, path.filename(target:targetfile())) 
                     if os.isfile(archfile) then
-                        lipoargs = format(&quot;%s -arch %s %s&quot;, lipoargs or &quot;&quot;, arch, archfile) 
+                        lipoargs = format("%s -arch %s %s", lipoargs or "", arch, archfile) 
                     end
                 end
                 if lipoargs then
 
                     -- make full lipo arguments
-                    lipoargs = format(&quot;-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s&quot;, lipoargs, outputdir, target:name(), mode, plat, path.filename(target:targetfile()))
+                    lipoargs = format("-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s", lipoargs, outputdir, target:name(), mode, plat, path.filename(target:targetfile()))
 
                     -- make universal directory
-                    os.mkdir(format(&quot;%s/%s.pkg/lib/%s/%s/universal&quot;, outputdir, target:name(), mode, plat))
+                    os.mkdir(format("%s/%s.pkg/lib/%s/%s/universal", outputdir, target:name(), mode, plat))
 
                     -- package all archs
-                    os.execv(&quot;xmake&quot;, {&quot;l&quot;, &quot;lipo&quot;, lipoargs})
+                    os.execv("xmake", {"l", "lipo", lipoargs})
                 end
             end
         end
     end
 end
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    如果你想要获取更多宏参数选项信息,请运行: <code>xmake macro --help</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    如果你想要获取更多宏参数选项信息,请运行: <code>xmake macro --help</code><br></p>
 
 </p>
 <h4 id="-lua-">运行自定义lua脚本</h4>
@@ -365,13 +365,13 @@ end
 <h5 id="-">运行指定的脚本文件</h5>
 <p>我们先写个简单的lua脚本:</p>
 <pre><code class="lang-lua">function main()
-    print(&quot;hello xmake!&quot;)
+    print("hello xmake!")
 end
 </code></pre>
 <p>然后直接运行它就行了:</p>
 <pre><code class="lang-console">$ xmake lua /tmp/test.lua
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    当然,你也可以像宏脚本那样,使用<code>import</code>接口导入扩展模块,实现复杂的功能。<br>&lt;/p&gt;
+<p><p class="tip"><br>    当然,你也可以像宏脚本那样,使用<code>import</code>接口导入扩展模块,实现复杂的功能。<br></p>
 
 </p>
 <h5 id="-">运行内置的脚本命令</h5>
@@ -386,7 +386,7 @@ scripts:
 </code></pre>
 <p>并且运行它们:</p>
 <pre><code class="lang-console">$ xmake lua cat ~/file.txt
-$ xmake lua echo &quot;hello xmake&quot;
+$ xmake lua echo "hello xmake"
 $ xmake lua cp /tmp/file /tmp/file2
 $ xmake lua versioninfo
 </code></pre>
@@ -395,41 +395,41 @@ $ xmake lua versioninfo
 <p>我们先看下,如何进入交互模式:</p>
 <pre><code class="lang-console"># 不带任何参数执行,就可以进入
 $ xmake lua
-&gt;
+>
 
 # 进行表达式计算
-&gt; 1 + 2
+> 1 + 2
 3
 
 # 赋值和打印变量值
-&gt; a = 1
-&gt; a
+> a = 1
+> a
 1
 
 # 多行输入和执行
-&gt; for _, v in pairs({1, 2, 3}) do
-&gt;&gt; print(v)
-&gt;&gt; end
+> for _, v in pairs({1, 2, 3}) do
+>> print(v)
+>> end
 1
 2
 3
 </code></pre>
 <p>我们也能够通过 <code>import</code> 来导入扩展模块:</p>
-<pre><code class="lang-console">&gt; task = import(&quot;core.project.task&quot;)
-&gt; task.run(&quot;hello&quot;)
+<pre><code class="lang-console">> task = import("core.project.task")
+> task.run("hello")
 hello xmake!
 </code></pre>
 <p>如果要中途取消多行输入,只需要输入字符:<code>q</code> 就行了</p>
-<pre><code class="lang-console">&gt; for _, v in ipairs({1, 2}) do
-&gt;&gt; print(v)
-&gt;&gt; q             &lt;--  取消多行输入,清空先前的输入数据
-&gt; 1 + 2
+<pre><code class="lang-console">> for _, v in ipairs({1, 2}) do
+>> print(v)
+>> q             <--  取消多行输入,清空先前的输入数据
+> 1 + 2
 3
 </code></pre>
 <h4 id="-ide-">生成IDE工程文件</h4>
 <h5 id="-">简介</h5>
 <p>XMake跟<code>cmake</code>, <code>premake</code>等其他一些构建工具的区别在于:</p>
-<p>&lt;p class=&quot;warn&quot;&gt;<br><code>xmake</code>默认是直接构建运行的,生成第三方的IDE的工程文件仅仅作为<code>插件</code>来提供。<br>&lt;/p&gt;
+<p><p class="warn"><br><code>xmake</code>默认是直接构建运行的,生成第三方的IDE的工程文件仅仅作为<code>插件</code>来提供。<br></p>
 
 </p>
 <p>这样做的一个好处是:插件更加容易扩展,维护也更加独立和方便。</p>
@@ -442,9 +442,9 @@ hello xmake!
 </code></pre>
 <p>输出的内容格式如下:</p>
 <pre><code>[
-  { &quot;directory&quot;: &quot;/home/user/llvm/build&quot;,
-    &quot;command&quot;: &quot;/usr/bin/clang++ -Irelative -DSOMEDEF=\&quot;With spaces, quotes and \\-es.\&quot; -c -o file.o file.cc&quot;,
-    &quot;file&quot;: &quot;file.cc&quot; },
+  { "directory": "/home/user/llvm/build",
+    "command": "/usr/bin/clang++ -Irelative -DSOMEDEF=\"With spaces, quotes and \\-es.\" -c -o file.o file.cc",
+    "file": "file.cc" },
   ...
 ]
 
@@ -453,12 +453,12 @@ hello xmake!
 <pre><code class="lang-console">$ xmake project -k [vs2008|vs2013|vs2015|..]
 </code></pre>
 <p>v2.1.2以上版本,增强了vs201x版本工程的生成,支持多模式+多架构生成,生成的时候只需要指定:</p>
-<pre><code class="lang-console">$ xmake project -k vs2017 -m &quot;debug,release&quot;
+<pre><code class="lang-console">$ xmake project -k vs2017 -m "debug,release"
 </code></pre>
 <p>生成后的工程文件,同时支持<code>debug|x86</code>, <code>debug|x64</code>, <code>release|x86</code>, <code>release|x64</code>四种配置模式。</p>
 <p>如果不想每次生成的时候,指定模式,可以把模式配置加到<code>xmake.lua</code>的中,例如:</p>
 <pre><code class="lang-lua">-- 配置当前的工程,支持哪些编译模式
-set_modes(&quot;debug&quot;, &quot;release&quot;)
+set_modes("debug", "release")
 </code></pre>
 <p>具体<code>set_modes</code>的使用,可以参考对应的接口手册文档。</p>
 <h4 id="-doxygen-">生成doxygen文档</h4>

+ 3 - 3
mirror/package/local_package.html

@@ -100,11 +100,11 @@
 - pcre.pkg
 - ...
 </code></pre><p>If you want the current project to recognize loading these packages, you first need to specify the package directory path, for example:</p>
-<pre><code class="lang-lua">add_packagedirs(&quot;packages&quot;)
+<pre><code class="lang-lua">add_packagedirs("packages")
 </code></pre>
 <p>Once specified, you can add integration package dependencies in the target scope via the <a href="/manual/project_target?id=targetadd_packages">add_packages</a> interface, for example:</p>
-<pre><code class="lang-lua">target(&quot;tbox&quot;)
-    add_packages(&quot;zlib&quot;, &quot;polarssl&quot;, &quot;pcre&quot;, &quot;mysql&quot;)
+<pre><code class="lang-lua">target("tbox")
+    add_packages("zlib", "polarssl", "pcre", "mysql")
 </code></pre>
 <p>So how to generate a *.pkg package, if it is based on xmake project, the generation method is very simple, only need:</p>
 <pre><code class="lang-console">$ cd tbox

+ 226 - 226
mirror/package/remote_package.html

@@ -91,30 +91,30 @@
 }
 </style>
     <p>This has been initially supported after the 2.2.2 version, the usage is much simpler, just set the corresponding dependency package, for example:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;libpng ~1.16&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "libpng ~1.16", "zlib")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("tbox", "libpng", "zlib")
 </code></pre>
 <p>The above <code>add_requires</code> is used to describe the dependencies required by the current project, and <code>add_packages</code> is used to apply dependencies to the test target. Only settings will automatically add links, linkdirs, includedirs, etc.</p>
 <p>Then directly compile:</p>
 <pre><code class="lang-console">$ xmake
 </code></pre>
 <p>xmake will remotely pull the relevant source package, then automatically compile and install, finally compile the project, and link the dependency package. The specific effect is shown in the following figure:</p>
-<p>&lt;img src=&quot;/assets/img/index/package_manage.png&quot; width=&quot;80%&quot; /&gt;</p>
+<p><img src="/assets/img/index/package_manage.png" width="80%" /></p>
 <p>For more information and progress on package dependency management see the related issues: <a href="https://github.com/xmake-io/xmake/issues/69">Remote package management</a></p>
 <h2 id="currently-supported-features">Currently Supported Features</h2>
 <ul>
-<li>Semantic version support, for example: &quot;&gt;= 1.1.0 &lt; 1.2&quot;, &quot;~1.6&quot;, &quot;1.2.x&quot;, &quot;1.*&quot;</li>
+<li>Semantic version support, for example: ">= 1.1.0 < 1.2", "~1.6", "1.2.x", "1.*"</li>
 <li>Provide multi-repository management support such as official package repository, self-built private repository, project built-in repository, etc.</li>
 <li>Cross-platform package compilation integration support (packages of different platforms and different architectures can be installed at the same time, fast switching use)</li>
 <li>Debug dependency package support, source code debugging</li>
 </ul>
 <h2 id="dependency-package-processing-mechanism">Dependency Package Processing Mechanism</h2>
 <p>Here we briefly introduce the processing mechanism of the entire dependency package:</p>
-<p>&lt;div align=&quot;center&quot;&gt;<br>&lt;img src=&quot;/assets/img/index/package_arch.png&quot; width=&quot;80%&quot; /&gt;<br>&lt;/div&gt;
+<p><div align="center"><br><img src="/assets/img/index/package_arch.png" width="80%" /><br></div>
 
 </p>
 <ol>
@@ -123,121 +123,121 @@ target(&quot;test&quot;)
 <li>Compile the project, and finally automatically link the enabled dependencies</li>
 </ol>
 <h2 id="semantic-version-settings">Semantic Version Settings</h2>
-<p>Xmake&#39;s dependency package management fully supports semantic version selection, for example: &quot;~1.6.1&quot;. For a detailed description of the semantic version, see: <a href="https://semver.org/">https://semver.org/</a></p>
+<p>Xmake&#39;s dependency package management fully supports semantic version selection, for example: "~1.6.1". For a detailed description of the semantic version, see: <a href="https://semver.org/">https://semver.org/</a></p>
 <p>Some semantic versions are written:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;pcre 1.3.x&quot;, &quot;libpng ^1.18&quot;)
-add_requires(&quot;libpng ~1.16&quot;, &quot;zlib 1.1.2 || &gt;=1.2.11 &lt;1.3.0&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "pcre 1.3.x", "libpng ^1.18")
+add_requires("libpng ~1.16", "zlib 1.1.2 || >=1.2.11 <1.3.0")
 </code></pre>
 <p>The semantic version parser currently used by xmake is the <a href="https://github.com/uael/sv">sv</a> library contributed by <a href="https://github.com/uael">uael</a>, which also has a description of the version. For detailed instructions, please refer to the following: <a href="https://github.com/uael/sv#versions">Version Description</a></p>
 <p>Of course, if we have no special requirements for the current version of the dependency package, then we can write directly:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox", "libpng", "zlib")
 </code></pre>
 <p>This will use the latest version of the package known, or the source code compiled by the master branch. If the current package has a git repo address, we can also specify a specific branch version:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox master&quot;)
-add_requires(&quot;tbox dev&quot;)
+<pre><code class="lang-lua">add_requires("tbox master")
+add_requires("tbox dev")
 </code></pre>
 <h2 id="extra-package-information-settings">Extra Package Information Settings</h2>
 <h3 id="optional-package-settings">Optional Package Settings</h3>
 <p>If the specified dependency package is not supported by the current platform, or if the compilation and installation fails, then xmake will compile the error, which is reasonable for some projects that must rely on certain packages to work.<br>However, if some packages are optional dependencies, they can be set to optional packages even if they are not compiled properly.</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {optional = true})
+<pre><code class="lang-lua">add_requires("tbox", {optional = true})
 </code></pre>
 <h3 id="disable-system-library">Disable System Library</h3>
 <p>With the default settings, xmake will first check to see if the system library exists (if no version is required). If the user does not want to use the system library and the library provided by the third-party package management, then you can set:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {system = false})
+<pre><code class="lang-lua">add_requires("tbox", {system = false})
 </code></pre>
 <h3 id="using-the-debug-version-of-the-package">Using the debug version of the package</h3>
 <p>If we want to debug the dependencies at the same time, we can set them to use the debug version of the package (provided that this package supports debug compilation):</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {debug = true})
+<pre><code class="lang-lua">add_requires("tbox", {debug = true})
 </code></pre>
 <p>If the current package does not support debug compilation, you can submit the modified compilation rules in the repository to support the debug, for example:</p>
-<pre><code class="lang-lua">package(&quot;openssl&quot;)
-    on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
-        os.vrun(&quot;./config %s --prefix=\&quot;%s\&quot;&quot;, package:debug() and &quot;--debug&quot; or &quot;&quot;, package:installdir())
-        os.vrun(&quot;make -j4&quot;)
-        os.vrun(&quot;make install&quot;)
+<pre><code class="lang-lua">package("openssl")
+    on_install("linux", "macosx", function (package)
+        os.vrun("./config %s --prefix=\"%s\"", package:debug() and "--debug" or "", package:installdir())
+        os.vrun("make -j4")
+        os.vrun("make install")
     end)
 </code></pre>
 <h3 id="passing-additional-compilation-information-to-the-package">Passing additional compilation information to the package</h3>
 <p>Some packages have various compile options at compile time, and we can pass them in. Of course, the package itself supports:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {configs = {small=true}})
+<pre><code class="lang-lua">add_requires("tbox", {configs = {small=true}})
 </code></pre>
 <p>Pass <code>--small=true</code> to the tbox package so that compiling the installed tbox package is enabled.</p>
 <p>We can get a list of all configurable parameters and descriptions of the specified package by executing <code>xmake require --info tbox</code> in the project directory.</p>
 <p>such as:</p>
 <pre><code class="lang-console">xmake require --info spdlog
     require(spdlog):
-      -&gt; requires:
-         -&gt; plat: macosx
-         -&gt; arch: x86_64
-         -&gt; configs:
-            -&gt; header_only: true
-            -&gt; shared: false
-            -&gt; vs_runtime: MT
-            -&gt; debug: false
-            -&gt; fmt_external: true
-            -&gt; noexcept: false
-      -&gt; configs:
-         -&gt; header_only: Use header only (default: true)
-         -&gt; fmt_external: Use external fmt library instead of bundled (default: false)
-         -&gt; noexcept: Compile with -fno-exceptions. Call abort() on any spdlog exceptions (default: false)
-      -&gt; configs (builtin):
-         -&gt; debug: Enable debug symbols. (default: false)
-         -&gt; shared: Enable shared library. (default: false)
-         -&gt; cflags: Set the C compiler flags.
-         -&gt; cxflags: Set the C/C++ compiler flags.
-         -&gt; cxxflags: Set the C++ compiler flags.
-         -&gt; asflags: Set the assembler flags.
-         -&gt; vs_runtime: Set vs compiler runtime. (default: MT)
-            -&gt; values: {&quot;MT&quot;,&quot;MD&quot;}
+      -> requires:
+         -> plat: macosx
+         -> arch: x86_64
+         -> configs:
+            -> header_only: true
+            -> shared: false
+            -> vs_runtime: MT
+            -> debug: false
+            -> fmt_external: true
+            -> noexcept: false
+      -> configs:
+         -> header_only: Use header only (default: true)
+         -> fmt_external: Use external fmt library instead of bundled (default: false)
+         -> noexcept: Compile with -fno-exceptions. Call abort() on any spdlog exceptions (default: false)
+      -> configs (builtin):
+         -> debug: Enable debug symbols. (default: false)
+         -> shared: Enable shared library. (default: false)
+         -> cflags: Set the C compiler flags.
+         -> cxflags: Set the C/C++ compiler flags.
+         -> cxxflags: Set the C++ compiler flags.
+         -> asflags: Set the assembler flags.
+         -> vs_runtime: Set vs compiler runtime. (default: MT)
+            -> values: {"MT","MD"}
 </code></pre>
 <p>Among them, configs is the configurable parameters provided by the spdlog package itself, and the configs part with builtin below is the built-in configuration parameters that all packages will have.<br>The top required section is the current configuration value of the project.</p>
-<p>!&gt; <code>vs_runtime</code> is the setting for vs runtime under msvc. In v2.2.9, it also supports automatic inheritance of all static dependencies. That is to say, if spdlog is set to MD, then the fmt package it depends on will also inherit automatically. Set the MD.</p>
+<p>!> <code>vs_runtime</code> is the setting for vs runtime under msvc. In v2.2.9, it also supports automatic inheritance of all static dependencies. That is to say, if spdlog is set to MD, then the fmt package it depends on will also inherit automatically. Set the MD.</p>
 <p>It can be seen that we have been able to customize the required packages very conveniently, but each package may have a lot of dependencies. If these dependencies are also customized, what should I do?</p>
-<p>Or take <code>spdlog-&gt;fmt</code> as an example. For <code>vs_runtime</code> this can automatically inherit the configuration, because it is a built-in configuration item, many private configurations can not be processed.</p>
+<p>Or take <code>spdlog->fmt</code> as an example. For <code>vs_runtime</code> this can automatically inherit the configuration, because it is a built-in configuration item, many private configurations can not be processed.</p>
 <p>At this time, we can add the fmt package by <code>add_requires</code> in advance in the outer project xmake.lua (this time you can set various configuration of your own).<br>Make sure that spdlog has been installed by <code>add_requires</code> before installation. If spdlog is installed, it will be detected automatically and used directly. It will not continue to install fmt dependencies internally.</p>
 <p>e.g:</p>
-<pre><code class="lang-lua">add_requires(&quot;fmt&quot;, {system = false, configs = {cxflags = &quot;-fPIC&quot;}})
-add_requires(&quot;spdlog&quot;, {system = false, configs = {fmt_external = true, cxflags = &quot;-fPIC&quot;}})
+<pre><code class="lang-lua">add_requires("fmt", {system = false, configs = {cxflags = "-fPIC"}})
+add_requires("spdlog", {system = false, configs = {fmt_external = true, cxflags = "-fPIC"}})
 </code></pre>
 <p>Our project requires spdlog to enable fPIC compilation, then its fmt dependency package also needs to be enabled, then we can add the fmt package first on the spdlog, and also set the fPIC to install it in advance.</p>
 <p>In this way, spdlog corresponds to the internal fmt dependency package, we can also flexibly set various complex custom configurations in the upper layer through <code>add_requires</code>.</p>
 <h2 id="install-third-party-packages">Install third-party packages</h2>
 <p>After version 2.2.5, xmake supports support for dependency libraries in third-party package managers, such as: conan, brew, vcpkg, clib and etc.</p>
 <h3 id="add-a-homebrew-dependency-package">Add a homebrew dependency package</h3>
-<pre><code class="lang-lua">add_requires(&quot;brew::zlib&quot;, {alias = &quot;zlib&quot;}})
-add_requires(&quot;brew::pcre2/libpcre2-8&quot;, {alias = &quot;pcre2&quot;}})
+<pre><code class="lang-lua">add_requires("brew::zlib", {alias = "zlib"}})
+add_requires("brew::pcre2/libpcre2-8", {alias = "pcre2"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;pcre2&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("pcre2", "zlib")
 </code></pre>
 <h3 id="add-a-vcpkg-dependency-package">Add a vcpkg dependency package</h3>
-<pre><code class="lang-lua">add_requires(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+<pre><code class="lang-lua">add_requires("vcpkg::zlib", "vcpkg::pcre2")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("vcpkg::zlib", "vcpkg::pcre2")
 </code></pre>
 <p>We can also add a package alias name to simplify the use of <code>add_packages</code>:</p>
-<pre><code class="lang-lua">add_requires(&quot;vcpkg::zlib&quot;, {alias = &quot;zlib&quot;})
-add_requires(&quot;vcpkg::pcre2&quot;, {alias = &quot;pcre2&quot;})
+<pre><code class="lang-lua">add_requires("vcpkg::zlib", {alias = "zlib"})
+add_requires("vcpkg::pcre2", {alias = "pcre2"})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;zlib&quot;, &quot;pcre2&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("zlib", "pcre2")
 </code></pre>
 <h3 id="add-a-conan-dependency-package">Add a conan dependency package</h3>
-<pre><code class="lang-lua">add_requires(&quot;CONAN::zlib/1.2.11@conan/stable&quot;, {alias = &quot;zlib&quot;, debug = true})
-add_requires(&quot;CONAN::OpenSSL/1.0.2n@conan/stable&quot;, {alias = &quot;openssl&quot;, 
-    configs = {options = &quot;OpenSSL:shared=True&quot;}})
+<pre><code class="lang-lua">add_requires("CONAN::zlib/1.2.11@conan/stable", {alias = "zlib", debug = true})
+add_requires("CONAN::OpenSSL/1.0.2n@conan/stable", {alias = "openssl", 
+    configs = {options = "OpenSSL:shared=True"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("openssl", "zlib")
 </code></pre>
 <p>After executing xmake to compile:</p>
 <pre><code class="lang-console">ruki:test_package ruki$ xmake
@@ -245,12 +245,12 @@ checking for the architecture ... x86_64
 checking for the Xcode directory ... /Applications/Xcode.app
 checking for the SDK version of Xcode ... 10.14
 note: try installing these packages (pass -y to skip confirm)?
-  -&gt; CONAN::zlib/1.2.11@conan/stable  (debug)
-  -&gt; CONAN::OpenSSL/1.0.2n@conan/stable  
+  -> CONAN::zlib/1.2.11@conan/stable  (debug)
+  -> CONAN::OpenSSL/1.0.2n@conan/stable  
 please input: y (y/n)
 
-  =&gt; installing CONAN::zlib/1.2.11@conan/stable .. ok
-  =&gt; installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
+  => installing CONAN::zlib/1.2.11@conan/stable .. ok
+  => installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
 
 [  0%]: ccache compiling.release src/main.c
 [100%]: linking.release test
@@ -258,13 +258,13 @@ please input: y (y/n)
 <h3 id="add-a-clib-dependency-package">Add a clib dependency package</h3>
 <p>Clib is a source-based dependency package manager. The dependent package is downloaded directly to the corresponding library source code, integrated into the project to compile, rather than binary library dependencies.</p>
 <p>It is also very convenient to integrate in xmake. The only thing to note is that you need to add the source code of the corresponding library to xmake.lua, for example:</p>
-<pre><code class="lang-lua">add_requires(&quot;clib::clibs/[email protected]&quot;, {alias = &quot;bytes&quot;})
+<pre><code class="lang-lua">add_requires("clib::clibs/[email protected]", {alias = "bytes"})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;clib/bytes/*.c&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;bytes&quot;)
+target("test")
+    set_kind("binary")
+    add_files("clib/bytes/*.c")
+    add_files("src/*.c")
+    add_packages("bytes")
 </code></pre>
 <h2 id="using-self-built-private-package-repository">Using self-built private package repository</h2>
 <p>If the required package is not in the official repository <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a>, we can submit the contribution code to the repository for support.<br>But if some packages are only for personal or private projects, we can create a private repository repo. The repository organization structure can be found at: <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a></p>
@@ -276,8 +276,8 @@ target(&quot;test&quot;)
 <pre><code class="lang-console">$ xmake repo --add myrepo [email protected]:myrepo/xmake-repo.git dev
 </code></pre>
 <p>Or we write directly in xmake.lua:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git&quot;)
-add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git dev&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo [email protected]:myrepo/xmake-repo.git")
+add_repositories("my-repo [email protected]:myrepo/xmake-repo.git dev")
 </code></pre>
 <p>If we just want to add one or two private packages, this time to build a git repo is too big, we can directly put the package repository into the project, for example:</p>
 <pre><code>projectdir
@@ -289,35 +289,35 @@ add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git dev&quot;)
     - main.c
   - xmake.lua
 </code></pre><p>The above myrepo directory is your own private package repository, built into your own project, and then add this repository location in xmake.lua:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo myrepo&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo myrepo")
 </code></pre>
 <p>This can be referred to <a href="https://github.com/tboox/benchbox">benchbox</a> project, which has a built-in private repository.</p>
 <p>We can even build a package without directly building a package description into the project xmake.lua, which is useful for relying on one or two packages, for example:</p>
-<pre><code class="lang-lua">package(&quot;libjpeg&quot;)
+<pre><code class="lang-lua">package("libjpeg")
 
-    set_urls(&quot;http://www.ijg.org/files/jpegsrc.$(version).tar.gz&quot;)
+    set_urls("http://www.ijg.org/files/jpegsrc.$(version).tar.gz")
 
-    add_versions(&quot;v9c&quot;, &quot;650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122&quot;)
+    add_versions("v9c", "650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122")
 
-    on_install(&quot;windows&quot;, function (package)
-        os.mv(&quot;jconfig.vc&quot;, &quot;jconfig.h&quot;)
-        os.vrun(&quot;nmake -f makefile.vc&quot;)
-        os.cp(&quot;*.h&quot;, package:installdir(&quot;include&quot;))
-        os.cp(&quot;libjpeg.lib&quot;, package:installdir(&quot;lib&quot;))
+    on_install("windows", function (package)
+        os.mv("jconfig.vc", "jconfig.h")
+        os.vrun("nmake -f makefile.vc")
+        os.cp("*.h", package:installdir("include"))
+        os.cp("libjpeg.lib", package:installdir("lib"))
     end)
 
-    on_install(&quot;macosx&quot;, &quot;linux&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).install(package)
+    on_install("macosx", "linux", function (package)
+        import("package.tools.autoconf").install(package)
     end)
 
 package_end()
 
-add_requires(&quot;libjpeg&quot;)
+add_requires("libjpeg")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;libjpeg&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("libjpeg")
 </code></pre>
 <h2 id="package-management-command">Package Management Command</h2>
 <p>The package management command <code>$ xmake require</code> can be used to manually display the download, install, uninstall, retrieve, and view package information.</p>
@@ -325,13 +325,13 @@ target(&quot;test&quot;)
 <pre><code class="lang-console">$ xmake require tbox
 </code></pre>
 <p>Install the specified version package:</p>
-<pre><code class="lang-console">$ xmake require tbox &quot;~1.6&quot;
+<pre><code class="lang-console">$ xmake require tbox "~1.6"
 </code></pre>
 <p>Force a re-download of the installation and display detailed installation information:</p>
-<pre><code class="lang-console">$ xmake require -f -v tbox &quot;1.5.x&quot;
+<pre><code class="lang-console">$ xmake require -f -v tbox "1.5.x"
 </code></pre>
 <p>Pass additional setup information:</p>
-<pre><code class="lang-console">$ xmake require --extra=&quot;debug=true,config={small=true}&quot; tbox
+<pre><code class="lang-console">$ xmake require --extra="debug=true,config={small=true}" tbox
 </code></pre>
 <p>Install the debug package and pass the compilation configuration information of <code>small=true</code> to the package.</p>
 <h3 id="uninstall-the-specified-package">Uninstall the specified package</h3>
@@ -369,18 +369,18 @@ target(&quot;test&quot;)
 <h3 id="manual-download">Manual download</h3>
 <p>By default, xmake will call curl, wget and other tools to download, users can also manually download with their own downloader (you can also use an agent), put the downloaded package in their own directory, for example: <code>/download/packages/zlib -v1.0.tar.gz</code></p>
 <p>Then use the following command to set the search directory for package download:</p>
-<pre><code class="lang-console">$ xmake g --pkg_searchdirs=&quot;/download/packages&quot;
+<pre><code class="lang-console">$ xmake g --pkg_searchdirs="/download/packages"
 </code></pre>
 <p>Then re-execute xmake to compile, xmake will first look for the source package from <code>/download/packages</code>, and then use it directly, no longer download it yourself.</p>
 <p>As for the package name you are looking for, you can check it by the following command:</p>
 <pre><code class="lang-console">$ xmake require --info zlib
--&gt; searchdirs: /download/packages
--&gt; searchnames: zlib-1.2.11.tar.gz
+-> searchdirs: /download/packages
+-> searchnames: zlib-1.2.11.tar.gz
 </code></pre>
 <p>We can see the corresponding search directory and the searched package name.</p>
 <h3 id="proxy-download">Proxy download</h3>
 <p>If manual downloading is still troublesome, we can also let xmake go directly to the agent.</p>
-<pre><code class="lang-console">$ xmake g --proxy=&quot;socks5://127.0.0.1:1086&quot;
+<pre><code class="lang-console">$ xmake g --proxy="socks5://127.0.0.1:1086"
 $ xmake g --help
     -x PROXY, --proxy=PROXY Use proxy on given port. [PROTOCOL://]HOST[:PORT]
                                  e.g.
@@ -407,14 +407,14 @@ $ xmake g --help
                                            end
                                        end
 </code></pre>
-<p>!&gt; If there are proxy_hosts, the host configuration is preferred, otherwise, the pac configuration can be used.</p>
+<p>!> If there are proxy_hosts, the host configuration is preferred, otherwise, the pac configuration can be used.</p>
 <p>The default path of pac: ~/.xmake/pac.lua, if --proxy is set, and this file exists, it will automatically go to pac. If it does not exist, and there are no hosts, then the proxy will take effect globally.</p>
 <p>You can also manually specify the pac full path</p>
 <pre><code class="lang-console">$ xmake g --proxy_pac=/xxxx/xxxxx_pac.lua
 </code></pre>
 <p>Configuration rule description:</p>
 <pre><code class="lang-lua">function main(url, host)
-    if host:find(&quot;bintray.com&quot;) then
+    if host:find("bintray.com") then
         return true
     end
 end
@@ -433,38 +433,38 @@ end
 <p>The description rules for the package are basically done in its xmake.lua, which is similar to the xmake.lua description in the project project. The difference is that the description field only supports <code>package()</code>.</p>
 <p>However, in the project xmake.lua, you can also directly add <code>package()</code> to the built-in package description, and even the package warehouse is saved, sometimes it will be more convenient.</p>
 <p>First, let&#39;s take a look at zlib&#39;s description rules first. This rule can be found at <a href="https://github.com/xmake-io/xmake-repo/blob Found under /master/packages/z/zlib/xmake.lua">xmake-repo/z/zlib/xmake.lua</a>.</p>
-<pre><code>package(&quot;zlib&quot;)
+<pre><code>package("zlib")
 
-    set_homepage(&quot;http://www.zlib.net&quot;)
-    set_description(&quot;A Massively Spiffy Yet Delicately Unobtrusive Compression Library&quot;)
+    set_homepage("http://www.zlib.net")
+    set_description("A Massively Spiffy Yet Delicately Unobtrusive Compression Library")
 
-    set_urls(&quot;http://zlib.net/zlib-$(version).tar.gz&quot;,
-             &quot;https://downloads.sourceforge.net/project/libpng/zlib/$(version)/zlib-$(version).tar.gz&quot;)
+    set_urls("http://zlib.net/zlib-$(version).tar.gz",
+             "https://downloads.sourceforge.net/project/libpng/zlib/$(version)/zlib-$(version).tar.gz")
 
-    add_versions(&quot;1.2.10&quot;, &quot;8d7e9f698ce48787b6e1c67e6bff79e487303e66077e25cb9784ac8835978017&quot;)
-    add_versions(&quot;1.2.11&quot;, &quot;c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1&quot;)
+    add_versions("1.2.10", "8d7e9f698ce48787b6e1c67e6bff79e487303e66077e25cb9784ac8835978017")
+    add_versions("1.2.11", "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1")
 
-    on_install(&quot;windows&quot;, function (package)
-        io.gsub(&quot;win32/Makefile.msc&quot;, &quot;%-MD&quot;, &quot;-&quot; .. package:config(&quot;vs_runtime&quot;))
-        os.vrun(&quot;nmake -f win32\\Makefile.msc zlib.lib&quot;)
-        os.cp(&quot;zlib.lib&quot;, package:installdir(&quot;lib&quot;))
-        os.cp(&quot;*.h&quot;, package:installdir(&quot;include&quot;))
+    on_install("windows", function (package)
+        io.gsub("win32/Makefile.msc", "%-MD", "-" .. package:config("vs_runtime"))
+        os.vrun("nmake -f win32\\Makefile.msc zlib.lib")
+        os.cp("zlib.lib", package:installdir("lib"))
+        os.cp("*.h", package:installdir("include"))
     end)
 
-    on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).install(package, {&quot;--static&quot;})
+    on_install("linux", "macosx", function (package)
+        import("package.tools.autoconf").install(package, {"--static"})
     end)
 
-    on_install(&quot;iphoneos&quot;, &quot;android@linux,macosx&quot;, &quot;mingw@linux,macosx&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).configure(package, {host = &quot;&quot;, &quot;--static&quot;})
-        io.gsub(&quot;Makefile&quot;, &quot;\nAR=.-\n&quot;,      &quot;\nAR=&quot; .. (package:build_getenv(&quot;ar&quot;) or &quot;&quot;) .. &quot;\n&quot;)
-        io.gsub(&quot;Makefile&quot;, &quot;\nARFLAGS=.-\n&quot;, &quot;\nARFLAGS=cr\n&quot;)
-        io.gsub(&quot;Makefile&quot;, &quot;\nRANLIB=.-\n&quot;,  &quot;\nRANLIB=\n&quot;)
-        os.vrun(&quot;make install -j4&quot;)
+    on_install("iphoneos", "android@linux,macosx", "mingw@linux,macosx", function (package)
+        import("package.tools.autoconf").configure(package, {host = "", "--static"})
+        io.gsub("Makefile", "\nAR=.-\n",      "\nAR=" .. (package:build_getenv("ar") or "") .. "\n")
+        io.gsub("Makefile", "\nARFLAGS=.-\n", "\nARFLAGS=cr\n")
+        io.gsub("Makefile", "\nRANLIB=.-\n",  "\nRANLIB=\n")
+        os.vrun("make install -j4")
     end)
 
     on_test(function (package)
-        assert(package:has_cfuncs(&quot;inflate&quot;, {includes = &quot;zlib.h&quot;}))
+        assert(package:has_cfuncs("inflate", {includes = "zlib.h"}))
     end)
 </code></pre><p>This package rule adds installation rules to windows, linux, macosx, iphoneos, mingw and other platforms. Basically, it has achieved full platform coverage, and even some cross-compilation platforms, which is a typical example.</p>
 <p>Of course, some packages rely on source code implementation and are not completely cross-platform, so you only need to set the installation rules for the platforms it supports.</p>
@@ -474,59 +474,59 @@ end
 <p>Set the package description information, generally see the relevant package information through <code>xmake require --info zlib</code>.</p>
 <h4 id="set_kind">set_kind</h4>
 <p>Set the package type. For the dependent library, you don&#39;t need to set it. If it is an executable package, you need to set it to binary.</p>
-<pre><code>package(&quot;cmake&quot;)
+<pre><code>package("cmake")
 
-    set_kind(&quot;binary&quot;)
-    set_homepage(&quot;https://cmake.org&quot;)
-    set_description(&quot;A cross-platform family of tool designed to build, test and package software&quot;)
+    set_kind("binary")
+    set_homepage("https://cmake.org")
+    set_description("A cross-platform family of tool designed to build, test and package software")
 </code></pre><h4 id="set_urls">set_urls</h4>
 <p>Set the source package or git repository address of the package. Unlike add_urls, this interface is the override setting, and add_urls is the additional setting. Other usage methods are similar. This is chosen according to different needs.</p>
 <h4 id="add_urls">add_urls</h4>
 <p>Add the source package of the package or the git repository address. This interface is generally paired with add_version to set the version of each source package and the corresponding sha256 value.</p>
-<p>!&gt; You can add multiple urls as the mirror source, xmake will automatically detect the fastest url for download, and if the download fails, try other urls.</p>
-<pre><code class="lang-lua">add_urls(&quot;https://github.com/protobuf-c/protobuf-c/releases/download/v$(version)/protobuf-c-$(version).tar.gz&quot;)
-add_versions(&quot;1.3.1&quot;, &quot;51472d3a191d6d7b425e32b612e477c06f73fe23e07f6a6a839b11808e9d2267&quot;)
+<p>!> You can add multiple urls as the mirror source, xmake will automatically detect the fastest url for download, and if the download fails, try other urls.</p>
+<pre><code class="lang-lua">add_urls("https://github.com/protobuf-c/protobuf-c/releases/download/v$(version)/protobuf-c-$(version).tar.gz")
+add_versions("1.3.1", "51472d3a191d6d7b425e32b612e477c06f73fe23e07f6a6a839b11808e9d2267")
 </code></pre>
 <p>The <code>$(version)</code> built-in variable in urls will be adapted according to the version selected during the actual installation, and the version number is selected from the list of versions specified in <code>add_versions</code>.</p>
 <p>If there is a more complicated version string for urls and there is no direct correspondence with add_versions, you need to customize the conversion in the following way:</p>
-<pre><code class="lang-lua">add_urls(&quot;https://sqlite.org/2018/sqlite-autoconf-$(version)000.tar.gz&quot;,
-         {version = function (version) return version:gsub(&quot;%.&quot;, &quot;&quot;) end})
+<pre><code class="lang-lua">add_urls("https://sqlite.org/2018/sqlite-autoconf-$(version)000.tar.gz",
+         {version = function (version) return version:gsub("%.", "") end})
 
-add_versions(&quot;3.24.0&quot;, &quot;d9d14e88c6fb6d68de9ca0d1f9797477d82fc3aed613558f87ffbdbbc5ceb74a&quot;)
-add_versions(&quot;3.23.0&quot;, &quot;b7711a1800a071674c2bf76898ae8584fc6c9643cfe933cfc1bc54361e3a6e49&quot;)
+add_versions("3.24.0", "d9d14e88c6fb6d68de9ca0d1f9797477d82fc3aed613558f87ffbdbbc5ceb74a")
+add_versions("3.23.0", "b7711a1800a071674c2bf76898ae8584fc6c9643cfe933cfc1bc54361e3a6e49")
 </code></pre>
 <p>Of course, we can only add the git source address:</p>
-<pre><code class="lang-lua">add_urls(&quot;https://gitlab.gnome.org/GNOME/libxml2.git&quot;)
+<pre><code class="lang-lua">add_urls("https://gitlab.gnome.org/GNOME/libxml2.git")
 </code></pre>
 <p>If the source code package sha256 corresponding to multiple mirror addresses is different, we can set them separately by means of alias:</p>
-<pre><code class="lang-lua">add_urls(&quot;https://ffmpeg.org/releases/ffmpeg-$(version).tar.bz2&quot;, {alias = &quot;home&quot;})
-add_urls(&quot;https://github.com/FFmpeg/FFmpeg/archive/n$(version).zip&quot;, {alias = &quot;github&quot;})
-add_versions(&quot;home:4.0.2&quot;, &quot;346c51735f42c37e0712e0b3d2f6476c86ac15863e4445d9e823fe396420d056&quot;)
-add_versions(&quot;github:4.0.2&quot;, &quot;4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1bb34062a097f026&quot;)
+<pre><code class="lang-lua">add_urls("https://ffmpeg.org/releases/ffmpeg-$(version).tar.bz2", {alias = "home"})
+add_urls("https://github.com/FFmpeg/FFmpeg/archive/n$(version).zip", {alias = "github"})
+add_versions("home:4.0.2", "346c51735f42c37e0712e0b3d2f6476c86ac15863e4445d9e823fe396420d056")
+add_versions("github:4.0.2", "4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1bb34062a097f026")
 </code></pre>
 <h4 id="add_versions">add_versions</h4>
 <p>Used to set the version of each source package and the corresponding sha256 value, as described in <a href="#add_urls">add_urls</a></p>
 <h4 id="add_patches">add_patches</h4>
 <p>This interface is used for the source code package. Before compiling and installing, firstly set the corresponding patch package, compile it, and support multiple patches at the same time.</p>
-<pre><code class="lang-lua">if is_plat(&quot;macosx&quot;) then
-    add_patches(&quot;1.15&quot;, &quot;https://raw.githubusercontent.com/Homebrew/patches/9be2793af/libiconv/patch-utf8mac.diff&quot;,
-                        &quot;e8128732f22f63b5c656659786d2cf76f1450008f36bcf541285268c66cabeab&quot;)
+<pre><code class="lang-lua">if is_plat("macosx") then
+    add_patches("1.15", "https://raw.githubusercontent.com/Homebrew/patches/9be2793af/libiconv/patch-utf8mac.diff",
+                        "e8128732f22f63b5c656659786d2cf76f1450008f36bcf541285268c66cabeab")
 end
 </code></pre>
 <p>For example, the above code, when compiled for macosx, is marked with the corresponding patch-utf8mac.diff patch, and each patch is also set to the value of sha256 to ensure integrity.</p>
 <h4 id="add_links">add_links</h4>
 <p>By default, xmake will automatically detect the installed libraries and set the link relationship, but sometimes it is not very accurate. If you want to manually adjust the link order and the link name, you can set it through this interface.</p>
-<pre><code class="lang-lua">add_links(&quot;mbedtls&quot;, &quot;mbedx509&quot;, &quot;mbedcrypto&quot;)
+<pre><code class="lang-lua">add_links("mbedtls", "mbedx509", "mbedcrypto")
 </code></pre>
 <h4 id="add_syslinks">add_syslinks</h4>
 <p>Add some system library links. When some packages integrate links, you also need to rely on some system libraries to link them. This time you can attach them to the package description.</p>
-<pre><code>if is_plat(&quot;macosx&quot;) then
-    add_frameworks(&quot;CoreGraphics&quot;, &quot;CoreFoundation&quot;, &quot;Foundation&quot;)
-elseif is_plat(&quot;windows&quot;) then
-    add_defines(&quot;CAIRO_WIN32_STATIC_BUILD=1&quot;)
-    add_syslinks(&quot;gdi32&quot;, &quot;msimg32&quot;, &quot;user32&quot;)
+<pre><code>if is_plat("macosx") then
+    add_frameworks("CoreGraphics", "CoreFoundation", "Foundation")
+elseif is_plat("windows") then
+    add_defines("CAIRO_WIN32_STATIC_BUILD=1")
+    add_syslinks("gdi32", "msimg32", "user32")
 else
-    add_syslinks(&quot;pthread&quot;)
+    add_syslinks("pthread")
 end
 </code></pre><h4 id="add_frameworks">add_frameworks</h4>
 <p>Add a dependent system frameworks link.</p>
@@ -539,42 +539,42 @@ end
 <p>Some specific definition options can be exported to the integrated package.</p>
 <h4 id="add_configs">add_configs</h4>
 <p>We can add the external output configuration parameters of each package through this interface:</p>
-<pre><code class="lang-lua">package(&quot;pcre2&quot;)
+<pre><code class="lang-lua">package("pcre2")
 
-    set_homepage(&quot;https://www.pcre.org/&quot;)
-    set_description(&quot;A Perl Compatible Regular Expressions Library&quot;)
+    set_homepage("https://www.pcre.org/")
+    set_description("A Perl Compatible Regular Expressions Library")
 
-    add_configs(&quot;bitwidth&quot;, {description = &quot;Set the code unit width.&quot;, default = &quot;8&quot;, values = {&quot;8&quot;, &quot;16&quot;, &quot;32&quot;}})
+    add_configs("bitwidth", {description = "Set the code unit width.", default = "8", values = {"8", "16", "32"}})
 
     on_load(function (package)
-        local bitwidth = package:config(&quot;bitwidth&quot;) or &quot;8&quot;
-        package:add(&quot;links&quot;, &quot;pcre2-&quot; .. bitwidth)
-        package:add(&quot;defines&quot;, &quot;PCRE2_CODE_UNIT_WIDTH=&quot; .. bitwidth)
+        local bitwidth = package:config("bitwidth") or "8"
+        package:add("links", "pcre2-" .. bitwidth)
+        package:add("defines", "PCRE2_CODE_UNIT_WIDTH=" .. bitwidth)
     end)
 </code></pre>
 <p>In the engineering project, we can also view a list of configurable parameters and values for a particular package:</p>
 <pre><code class="lang-bash">$ xmake require --info pcre2
 The package info of project:
     require(pcre2): 
-      -&gt; description: A Perl Compatible Regular Expressions Library
-      -&gt; version: 10.31
+      -> description: A Perl Compatible Regular Expressions Library
+      -> version: 10.31
       ...
-      -&gt; configs:
-         -&gt; bitwidth:
-            -&gt; description: Set the code unit width.
-            -&gt; values: {&quot;8&quot;,&quot;16&quot;,&quot;32&quot;}
-            -&gt; default: 8
+      -> configs:
+         -> bitwidth:
+            -> description: Set the code unit width.
+            -> values: {"8","16","32"}
+            -> default: 8
 </code></pre>
 <p>Then in the project, enable these configurations and compile the package with the specific configuration:</p>
-<pre><code class="lang-lua">add_requires(&quot;pcre2&quot;, {configs = {bitwidth = 16}})
+<pre><code class="lang-lua">add_requires("pcre2", {configs = {bitwidth = 16}})
 </code></pre>
 <h4 id="on_load">on_load</h4>
 <p>This is an optional interface. If you want to be more flexible and dynamically judge various platform architectures, you can do it in this way, for example:</p>
 <pre><code class="lang-lua">on_load(function (package)
-    Local bitwidth = package:config(&quot;bitwidth&quot;) or &quot;8&quot;
-    package:add(&quot;links&quot;, &quot;pcre&quot; .. (bitwidth ~= &quot;8&quot; and bitwidth or &quot;&quot;))
-    If not package:config(&quot;shared&quot;) then
-        package:add(&quot;defines&quot;, &quot;PCRE_STATIC&quot;)
+    Local bitwidth = package:config("bitwidth") or "8"
+    package:add("links", "pcre" .. (bitwidth ~= "8" and bitwidth or ""))
+    If not package:config("shared") then
+        package:add("defines", "PCRE_STATIC")
     end
 end)
 </code></pre>
@@ -590,24 +590,24 @@ end)
 end)
 </code></pre>
 <p>If the installation script is valid for a specific platform, then directly specify the corresponding compilation platform, you can specify more than one at the same time:</p>
-<pre><code class="lang-lua">on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
+<pre><code class="lang-lua">on_install("linux", "macosx", function (package)
     -- TODO
 end)
 </code></pre>
 <p>If you want to break down to the specified architecture to take effect, you can write:</p>
-<pre><code class="lang-lua">on_install(&quot;linux|x86_64&quot;, &quot;iphoneos|arm64&quot;, function (package)
+<pre><code class="lang-lua">on_install("linux|x86_64", "iphoneos|arm64", function (package)
     -- TODO
 end)
 </code></pre>
 <p>If you want to limit the execution of the host environment platform and architecture, you can append <code>@host|arch</code> to the end, for example:</p>
-<pre><code class="lang-lua">on_install(&quot;mingw@windows&quot;, function (package)
+<pre><code class="lang-lua">on_install("mingw@windows", function (package)
     -- TODO
 end)
 </code></pre>
 <p>This means that only the mingw platform is valid for Windows.</p>
 <p>We can also specify the host platform and architecture without specifying a platform and architecture. This is usually used to describe some dependencies related to the build tool and can only be run in the host environment.</p>
 <p>For example, the package we compiled depends on cmake, we need to add the package description of cmake, then the compiler installation environment can only be the host platform:</p>
-<pre><code class="lang-lua">on_install(&quot;@windows&quot;, &quot;@linux&quot;, &quot;@macosx&quot;, function (package)
+<pre><code class="lang-lua">on_install("@windows", "@linux", "@macosx", function (package)
     -- TODO
 end)
 </code></pre>
@@ -625,77 +625,77 @@ end)
 <h6 id="xmake">xmake</h6>
 <p>If it is a xmake-based dependency package, then the integration is very simple, xmake has very good built-in integration support, you can directly support it for cross-platform compilation, generally only need to:</p>
 <pre><code class="lang-lua">on_install(function (package)
-    import(&quot;package.tools.xmake&quot;).install(package)
+    import("package.tools.xmake").install(package)
 end)
 </code></pre>
 <p>If you want to pass some unique build configuration parameters:</p>
 <pre><code class="lang-lua">on_install(function (package)
-    import(&quot;package.tools.xmake&quot;).install(package, {&quot;--xxx=y&quot;})
+    import("package.tools.xmake").install(package, {"--xxx=y"})
 end)
 </code></pre>
 <h6 id="cmake">cmake</h6>
 <p>If it is a cmake-based package, the integration is also very short-answered. Usually you only need to set some configuration parameters, but you need to add the cmake dependency first:</p>
-<pre><code class="lang-lua">add_deps(&quot;cmake&quot;)
+<pre><code class="lang-lua">add_deps("cmake")
 on_install(function (package)
-    import(&quot;package.tools.cmake&quot;).install(package, {&quot;-Dxxx=ON&quot;})
+    import("package.tools.cmake").install(package, {"-Dxxx=ON"})
 end)
 </code></pre>
 <h6 id="autoconf">autoconf</h6>
 <p>If it is based on autoconf package, the integration method is similar to cmake, but the configuration parameters are different. However, under normal circumstances, the Unix system has built-in autoconf series tools, so it is fine without any dependencies.</p>
 <pre><code class="lang-lua">on_install(function (package)
-    import(&quot;package.tools.autoconf&quot;).install(package, {&quot;--enable-shared=no&quot;})
+    import("package.tools.autoconf").install(package, {"--enable-shared=no"})
 end)
 </code></pre>
 <p>However, some source packages may not be fully satisfied with the system&#39;s built-in autoconf, so you can add autoconf family dependencies and build them:</p>
-<pre><code class="lang-lua">add_deps(&quot;autoconf&quot;, &quot;automake&quot;, &quot;libtool&quot;, &quot;pkg-config&quot;)
+<pre><code class="lang-lua">add_deps("autoconf", "automake", "libtool", "pkg-config")
 on_install(function (package)
-    import(&quot;package.tools.autoconf&quot;).install(package, {&quot;--enable-shared=no&quot;})
+    import("package.tools.autoconf").install(package, {"--enable-shared=no"})
 end)
 </code></pre>
 <h6 id="meson">meson</h6>
 <p>If it is meson, you need to add ninja&#39;s dependencies to perform the build.</p>
-<pre><code class="lang-lua">add_deps(&quot;meson&quot;, &quot;ninja&quot;)
+<pre><code class="lang-lua">add_deps("meson", "ninja")
 on_install(function (package)
-    import(&quot;package.tools.meson&quot;).install(package, {&quot;-Dxxx=ON&quot;})
+    import("package.tools.meson").install(package, {"-Dxxx=ON"})
 end)
 </code></pre>
 <h4 id="on_test">on_test</h4>
 <p>After installation, you need to set the corresponding test script, perform some tests to ensure the reliability of the installation package, if the test does not pass, the entire installation package will be revoked.</p>
 <pre><code class="lang-lua">on_test(function (package)
-    assert(package:has_cfuncs(&quot;inflate&quot;, {includes = &quot;zlib.h&quot;}))
+    assert(package:has_cfuncs("inflate", {includes = "zlib.h"}))
 end)
 </code></pre>
 <p>The above script calls the built-in <code>has_cfuncs</code> interface to detect whether the zlib.h header file exists in the installed package, and whether the interface function <code>inflate</code> exists in the library and header files.</p>
 <p>Xmake will try to compile the link for testing, <code>has_cfuncs</code> for detecting c functions, and <code>has_cxxfuncs</code> for detecting c++ library functions.</p>
-<p>And include multiple header files in include, for example: <code>includes = {&quot;xxx.h&quot;, &quot;yyy.h&quot;}</code></p>
+<p>And include multiple header files in include, for example: <code>includes = {"xxx.h", "yyy.h"}</code></p>
 <p>We can also pass some of our own compilation parameters into the detection, for example:</p>
 <pre><code class="lang-lua">on_test(function (package)
-    assert(package:has_cxxfuncs(&quot;func1&quot;, {includes = &quot;xxx.h&quot;, configs = {defines = &quot;c++14&quot;, cxflags = &quot;-Dxxx&quot;}}))
+    assert(package:has_cxxfuncs("func1", {includes = "xxx.h", configs = {defines = "c++14", cxflags = "-Dxxx"}}))
 end)
 </code></pre>
 <p>We can also detect a code snippet with <code>check_csnippets</code> and <code>check_cxxsnippets</code>:</p>
 <pre><code class="lang-lua">on_test(function (package)
     assert(package:check_cxxsnippets({test = [[
-        #include &lt;boost/algorithm/string.hpp&gt;
-        #include &lt;string&gt;
-        #include &lt;vector&gt;
-        #include &lt;assert.h&gt;
+        #include <boost/algorithm/string.hpp>
+        #include <string>
+        #include <vector>
+        #include <assert.h>
         using namespace boost::algorithm;
         using namespace std;
         static void test() {
-            string str(&quot;a,b&quot;);
-            vector&lt;string&gt; strVec;
-            split(strVec, str, is_any_of(&quot;,&quot;));
+            string str("a,b");
+            vector<string> strVec;
+            split(strVec, str, is_any_of(","));
             assert(strVec.size()==2);
-            assert(strVec[0]==&quot;a&quot;);
-            assert(strVec[1]==&quot;b&quot;);
+            assert(strVec[0]=="a");
+            assert(strVec[1]=="b");
         }
-    ]]}, {configs = {languages = &quot;c++14&quot;}}))
+    ]]}, {configs = {languages = "c++14"}}))
 end)
 </code></pre>
 <p>if it is an executable package, it can also be detected by trying to run:</p>
 <pre><code class="lang-lua">on_test(function (package)
-    os.run(&quot;xxx --help&quot;)
+    os.run("xxx --help")
 end)
 </code></pre>
 <p>if the run fails, the test will not pass.</p>
@@ -704,56 +704,56 @@ end)
 <h3 id="built-in-configuration-parameters">Built-in configuration parameters</h3>
 <p>In addition to setting some extended configuration parameters via <a href="#add_configs">add_configs</a>, xmake also provides some built-in configuration parameters that can be used.</p>
 <h4 id="enable-debug-package">Enable debug package</h4>
-<pre><code class="lang-lua">add_requires(&quot;xxx&quot;, {debug = true})
+<pre><code class="lang-lua">add_requires("xxx", {debug = true})
 </code></pre>
 <p>There must be relevant processing in the package description to support:</p>
 <pre><code class="lang-lua">on_install(function (package)
     Local configs = {}
     if package:debug() then
-        Table.insert(configs, &quot;--enable-debug&quot;)
+        Table.insert(configs, "--enable-debug")
     end
-    import(&quot;package.tools.autoconf&quot;).install(package)
+    import("package.tools.autoconf").install(package)
 end)
 </code></pre>
 <h4 id="setting-up-the-msvc-runtime-library">Setting up the msvc runtime library</h4>
-<pre><code class="lang-lua">add_requires(&quot;xxx&quot;, {configs = {vs_runtime = &quot;MT&quot;}})
+<pre><code class="lang-lua">add_requires("xxx", {configs = {vs_runtime = "MT"}})
 </code></pre>
-<p>Normally, packages installed by built-in tool scripts such as <code>import(&quot;package.tools.autoconf&quot;).install</code> are automatically processed internally by vs_runtime.</p>
+<p>Normally, packages installed by built-in tool scripts such as <code>import("package.tools.autoconf").install</code> are automatically processed internally by vs_runtime.</p>
 <p>But if it is a special source package, the build rules are special, then you need to handle it yourself:</p>
 <pre><code class="lang-lua">on_install(function (package)
-    io.gsub(&quot;build/Makefile.win32.common&quot;, &quot;%-MD&quot;, &quot;-&quot; .. package:config(&quot;vs_runtime&quot;))
+    io.gsub("build/Makefile.win32.common", "%-MD", "-" .. package:config("vs_runtime"))
 end)
 </code></pre>
 <h3 id="adding-environment-variables">Adding environment variables</h3>
 <p>For some libraries, there are also executable tools. if you need to use these tools in the integration package, you can also set the corresponding PATH environment variable:</p>
-<pre><code class="lang-lua">package(&quot;luajit&quot;)
+<pre><code class="lang-lua">package("luajit")
     on_load(function (package)
-        if is_plat(&quot;windows&quot;) then
-            Package:addenv(&quot;PATH&quot;, &quot;lib&quot;)
+        if is_plat("windows") then
+            Package:addenv("PATH", "lib")
         end
-        Package:addenv(&quot;PATH&quot;, &quot;bin&quot;)
+        Package:addenv("PATH", "bin")
     end)
 </code></pre>
 <p>In the project project, the corresponding environment variables will only take effect after the corresponding package is integrated by <code>add_packages</code>.</p>
-<pre><code class="lang-lua">add_requires(&quot;luajit&quot;)
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_packages(&quot;luajit&quot;)
+<pre><code class="lang-lua">add_requires("luajit")
+target("test")
+    set_kind("binary")
+    add_packages("luajit")
     after_run(function (package)
-        os.exec(&quot;luajit --version&quot;)
+        os.exec("luajit --version")
     end)
 </code></pre>
 <h3 id="installing-binary-packages">Installing binary packages</h3>
 <p>Xmake also supports direct reference to the binary version package, which is used directly for installation, for example:</p>
-<pre><code class="lang-lua">if is_plat(&quot;windows&quot;) then
-    set_urls(&quot;https://www.libsdl.org/release/SDL2-devel-$(version)-VC.zip&quot;)
-    add_versions(&quot;2.0.8&quot;, &quot;68505e1f7c16d8538e116405411205355a029dcf2df738dbbc768b2fe95d20fd&quot;)
+<pre><code class="lang-lua">if is_plat("windows") then
+    set_urls("https://www.libsdl.org/release/SDL2-devel-$(version)-VC.zip")
+    add_versions("2.0.8", "68505e1f7c16d8538e116405411205355a029dcf2df738dbbc768b2fe95d20fd")
 end
 
-on_install(&quot;windows&quot;, function (package)
-    os.cp(&quot;include&quot;, package:installdir())
-    os.cp(&quot;lib/$(arch)/*.lib&quot;, package:installdir(&quot;lib&quot;))
-    os.cp(&quot;lib/$(arch)/*.dll&quot;, package:installdir(&quot;lib&quot;))
+on_install("windows", function (package)
+    os.cp("include", package:installdir())
+    os.cp("lib/$(arch)/*.lib", package:installdir("lib"))
+    os.cp("lib/$(arch)/*.dll", package:installdir("lib"))
 end)
 </code></pre>
 <h3 id="local-test">Local test</h3>

+ 15 - 15
mirror/package/system_package.html

@@ -93,25 +93,25 @@
     <h2 id="find-system-package">Find System Package</h2>
 <p>If you feel that the above built-in package management method is very inconvenient, you can use the built-in interface <code>find_packages</code> provided by xmake.</p>
 <p>And through the system and third-party package management tools for the installation of the dependency package, and then integrated with xmake, for example, we look for an openssl package:</p>
-<pre><code class="lang-lua">local packages = find_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">local packages = find_packages("openssl", "zlib")
 </code></pre>
 <p>The returned results are as follows:</p>
 <pre><code class="lang-lua">{
-    {links = {&quot;ssl&quot;, &quot;crypto&quot;}, linkdirs = {&quot;/usr/local/lib&quot;}, includedirs = {&quot;/usr/local/include&quot;}},
-    {links = {&quot;z&quot;}, linkdirs = {&quot;/usr/local/lib&quot;}, includedirs = {&quot;/usr/local/include&quot;}}
+    {links = {"ssl", "crypto"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}},
+    {links = {"z"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}}
 }
 </code></pre>
 <p>If the search is successful, return a table containing all the package information, if it fails, return nil</p>
 <p>The return result here can be directly passed as the parameter of <code>target:add</code>, <code>option:add</code>, which is used to dynamically increase the configuration of <code>target/option</code>:</p>
-<pre><code class="lang-lua">option(&quot;zlib&quot;)
+<pre><code class="lang-lua">option("zlib")
     set_showmenu(true)
     before_check(function (option)
-        option:add(find_packages(&quot;openssl&quot;, &quot;zlib&quot;))
+        option:add(find_packages("openssl", "zlib"))
     end)
 </code></pre>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
     on_load(function (target)
-        target:add(find_packages(&quot;openssl&quot;, &quot;zlib&quot;))
+        target:add(find_packages("openssl", "zlib"))
     end)
 </code></pre>
 <p>Currently this interface supports the following package management support:</p>
@@ -126,7 +126,7 @@
 <p>Of course, if you feel that integrating third-party dependencies by looking for packages is not enough, you can also directly integrate remote dependencies through <code>add_requires</code>.<br>For details, see the documentation: <a href="/package/remote_package">Using Remote Dependencies</a></p>
 <h2 id="find-homebrew-package">Find homebrew package</h2>
 <p>Alternatively, we can also find the package from the manually specified package manager:</p>
-<pre><code class="lang-lua">find_packages(&quot;brew::pcre2/libpcre2-8&quot;, &quot;brew::x264&quot;)
+<pre><code class="lang-lua">find_packages("brew::pcre2/libpcre2-8", "brew::x264")
 </code></pre>
 <p>We only need to add the <code>brew::</code> prefix, you can explicitly specify the package source from homebrew to find the package, if there are multiple pkgconfig files in <code>brew::pcre2</code>, for example: libpcre2-8.pc, libpcre2-16. Pc, libpcre2-32.pc</p>
 <p>Then we can use <code>brew::pcre2/libpcre2-16</code> to select the link library information specified by the corresponding pkgconfig file.</p>
@@ -140,11 +140,11 @@
 <pre><code class="lang-console">$ xmake g --vcpkg=f:\vcpkg
 </code></pre>
 <p>Then, we can specify the dependency package in vcpkg by using the <code>vcpkg::</code> prefix:</p>
-<pre><code class="lang-lua">find_packages(&quot;vcpkg::zlib&quot;, &quot;vcpkg::openssl&quot;)
+<pre><code class="lang-lua">find_packages("vcpkg::zlib", "vcpkg::openssl")
 </code></pre>
 <h2 id="find-the-conan-package">Find the conan package</h2>
 <p>Xmake v2.2.6 and later versions also support finding the specified package from the conan:</p>
-<pre><code class="lang-lua">find_packages(&quot;conan::OpenSSL/1.0.2n@conan/stable&quot;)
+<pre><code class="lang-lua">find_packages("conan::OpenSSL/1.0.2n@conan/stable")
 </code></pre>
 <h2 id="test-command-for-finding-package">Test command for finding package</h2>
 <p>We can use the following command to quickly detect the package information specified on the system:</p>
@@ -152,14 +152,14 @@
 {
    {
      Links = {
-       &quot;x264&quot;
+       "x264"
      },
      Linkdirs = {
-       &quot;/usr/local/Cellar/x264/r2699/lib&quot;
+       "/usr/local/Cellar/x264/r2699/lib"
      },
-     Version = &quot;0.148.2699 a5e06b9&quot;,
+     Version = "0.148.2699 a5e06b9",
      Includeirs = {
-       &quot;/usr/local/Cellar/x264/r2699/include&quot;
+       "/usr/local/Cellar/x264/r2699/include"
      }
    }
 }
@@ -167,7 +167,7 @@
 <p>We can also add a third-party package manager prefix to test:</p>
 <pre><code class="lang-console">xmake l find_packages conan::OpenSSL/1.0.2n@conan/stable
 </code></pre>
-<p>!&gt; It should be noted that if the find_package command is executed in the project directory with xmake.lua, there will be a cache. If the search fails, the next lookup will also use the cached result. If you want to force a retest every time, Please switch to the non-project directory to execute the above command.</p>
+<p>!> It should be noted that if the find_package command is executed in the project directory with xmake.lua, there will be a cache. If the search fails, the next lookup will also use the cached result. If you want to force a retest every time, Please switch to the non-project directory to execute the above command.</p>
 </article>
 </body>
 </html>

+ 78 - 78
mirror/plugin/builtin_plugins.html

@@ -98,7 +98,7 @@
 <pre><code class="lang-console">$ xmake project -k cmakelists
 </code></pre>
 <h3 id="generate-build-ninja">Generate build.ninja</h3>
-<p>!&gt; Only supported in versions above 2.3.1</p>
+<p>!> Only supported in versions above 2.3.1</p>
 <pre><code class="lang-console">$ xmake project -k ninja
 </code></pre>
 <h3 id="generate-compiler_flags">Generate compiler_flags</h3>
@@ -110,9 +110,9 @@
 </code></pre>
 <p>The the content of the output file:</p>
 <pre><code>[
-  { &quot;directory&quot;: &quot;/home/user/llvm/build&quot;,
-    &quot;command&quot;: &quot;/usr/bin/clang++ -Irelative -DSOMEDEF=\&quot;With spaces, quotes and \\-es.\&quot; -c -o file.o file.cc&quot;,
-    &quot;file&quot;: &quot;file.cc&quot; },
+  { "directory": "/home/user/llvm/build",
+    "command": "/usr/bin/clang++ -Irelative -DSOMEDEF=\"With spaces, quotes and \\-es.\" -c -o file.o file.cc",
+    "file": "file.cc" },
   ...
 ]
 
@@ -123,25 +123,25 @@
 <p>But this mode, there is no way to support the rules of xmake. Because xmake&#39;s rules use a lot of custom scripts like <code>on_build</code>, they can&#39;t be expanded, so projects like qt, wdk can&#39;t support exporting to vs. compile.</p>
 <p>Therefore, in order to solve this problem, the new version of the vs. build plugin performs the compile operation by directly calling the xmake command under vs, and also supports intellisense and definition jumps, as well as breakpoint debugging.</p>
 <p>The specific use is similar to the old version:</p>
-<pre><code class="lang-console">$ xmake project -k [vsxmake2010|vsxmake2013|vsxmake2015|..] -m &quot;debug;release&quot;
+<pre><code class="lang-console">$ xmake project -k [vsxmake2010|vsxmake2013|vsxmake2015|..] -m "debug;release"
 </code></pre>
 <p>If no version is specified, xmake will automatically detect the current version of vs to generate:</p>
-<pre><code class="lang-bash">$ xmake project -k vsxmake -m &quot;debug;release&quot;
+<pre><code class="lang-bash">$ xmake project -k vsxmake -m "debug;release"
 </code></pre>
 <p><img src="/assets/img/manual/qt_vs.png" alt=""></p>
 <p>In addition, the vsxmake plugin will additionally generate a custom configuration property page for easy and flexible modification and appending some xmake compilation configuration in the vs., and even switch to other cross toolchains in the configuration to achieve the vs. vs. Cross-compilation of other platforms such as android, linux.</p>
 <p><img src="/assets/img/manual/property_page_vsxmake.png" alt=""></p>
 <h4 id="using-vs-built-in-compilation-mechanism">Using vs built-in compilation mechanism</h4>
-<p>!&gt; It is recommended to use the new version of the vs. plugin provided after v2.2.8 mentioned above. The support is more complete. The generation method here does not support the rules of xmake, and the generation of projects such as qt.</p>
+<p>!> It is recommended to use the new version of the vs. plugin provided after v2.2.8 mentioned above. The support is more complete. The generation method here does not support the rules of xmake, and the generation of projects such as qt.</p>
 <pre><code class="lang-bash">$ xmake project -k [vs2008|vs2013|vs2015|..]
 </code></pre>
 <p>v2.1.2 or later, it supports multi-mode and multi-architecture generation for vs201x project.</p>
 <p>For example:</p>
-<pre><code class="lang-bash">$ xmake project -k vs2017 -m &quot;debug,release&quot;
+<pre><code class="lang-bash">$ xmake project -k vs2017 -m "debug,release"
 </code></pre>
 <p>It will generate four project configurations: <code>debug|x86</code>, <code>debug|x64</code>, <code>release|x86</code>, <code>release|x64</code>.</p>
 <p>Or you can set modes to <code>xmake.lua</code>:</p>
-<pre><code class="lang-lua">set_modes(&quot;debug&quot;, &quot;release&quot;)
+<pre><code class="lang-lua">set_modes("debug", "release")
 </code></pre>
 <p>Then, we run the following command:</p>
 <pre><code class="lang-bash">$ xmake project -k vs2017
@@ -151,13 +151,13 @@
 <h3 id="run-the-given-script">Run the given script</h3>
 <p>Write a simple lua script:</p>
 <pre><code class="lang-lua">function main()
-    print(&quot;hello xmake!&quot;)
+    print("hello xmake!")
 end
 </code></pre>
 <p>Run this lua script.</p>
 <pre><code class="lang-bash">$ xmake lua /tmp/test.lua
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    You can also use <code>import</code> api to write a more advance lua script.<br>&lt;/p&gt;
+<p><p class="tip"><br>    You can also use <code>import</code> api to write a more advance lua script.<br></p>
 
 </p>
 <h3 id="run-the-builtin-script">Run the builtin script</h3>
@@ -172,37 +172,37 @@ scripts:
 </code></pre>
 <p>And run them:</p>
 <pre><code class="lang-bash">$ xmake lua cat ~/file.txt
-$ xmake lua echo &quot;hello xmake&quot;
+$ xmake lua echo "hello xmake"
 $ xmake lua cp /tmp/file /tmp/file2
 $ xmake lua versioninfo
 </code></pre>
 <h3 id="run-interactive-commands-repl-">Run interactive commands (REPL)</h3>
 <p>Enter interactive mode:</p>
 <pre><code class="lang-bash">$ xmake lua
-&gt; 1 + 2
+> 1 + 2
 3
 
-&gt; a = 1
-&gt; a
+> a = 1
+> a
 1
 
-&gt; for _, v in pairs({1, 2, 3}) do
-&gt;&gt; print(v)
-&gt;&gt; end
+> for _, v in pairs({1, 2, 3}) do
+>> print(v)
+>> end
 1
 2
 3
 </code></pre>
 <p>And we can <code>import</code> modules:</p>
-<pre><code class="lang-bash">&gt; task = import(&quot;core.project.task&quot;)
-&gt; task.run(&quot;hello&quot;)
+<pre><code class="lang-bash">> task = import("core.project.task")
+> task.run("hello")
 hello xmake!
 </code></pre>
 <p>If you want to cancel multiline input, please input character <code>q</code>, for example:</p>
-<pre><code class="lang-bash">&gt; for _, v in ipairs({1, 2}) do
-&gt;&gt; print(v)
-&gt;&gt; q             &lt;--  cancel multiline and clear previous input
-&gt; 1 + 2
+<pre><code class="lang-bash">> for _, v in ipairs({1, 2}) do
+>> print(v)
+>> q             <--  cancel multiline and clear previous input
+> 1 + 2
 3
 </code></pre>
 <h2 id="show-specified-information-and-list">Show specified information and list</h2>
@@ -261,24 +261,24 @@ The information of target(tbox):
     links: pthread
     syslinks: pthread, dl, m, c
     cxflags: -Wno-error=deprecated-declarations, -fno-strict-aliasing, -Wno-error=expansion-to-defined, -fno-stack-protector
-    defines: __tb_small__, __tb_prefix__=&quot;tbox&quot;
+    defines: __tb_small__, __tb_prefix__="tbox"
     mxflags: -Wno-error=deprecated-declarations, -fno-strict-aliasing, -Wno-error=expansion-to-defined
     headerfiles: src/(tbox/**.h)|**/impl/**.h, src/(tbox/prefix/**/prefix.S), src/(tbox/math/impl/*.h), src/(tbox/utils/impl/*.h), build/macosx/x86_64/release/tbox.config.h
     includedirs: src, build/macosx/x86_64/release
     at: /Users/ruki/projects/personal/tbox/src/tbox/xmake.lua
     sourcebatch(cc): with rule(c.build)
-      -&gt; src/tbox/string/static_string.c
-         -&gt; build/.objs/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o
-         -&gt; build/.deps/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o.d
-      -&gt; src/tbox/platform/sched.c
-         -&gt; build/.objs/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o
-         -&gt; build/.deps/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o.d
-      -&gt; src/tbox/stream/stream.c
-         -&gt; build/.objs/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o
-         -&gt; build/.deps/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o.d
-      -&gt; src/tbox/utils/base32.c
-         -&gt; build/.objs/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o
-         -&gt; build/.deps/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o.d
+      -> src/tbox/string/static_string.c
+         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o
+         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o.d
+      -> src/tbox/platform/sched.c
+         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o
+         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o.d
+      -> src/tbox/stream/stream.c
+         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o
+         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o.d
+      -> src/tbox/utils/base32.c
+         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o
+         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o.d
 </code></pre>
 <h3 id="show-builtin-compilation-modes-list">Show builtin compilation modes list</h3>
 <pre><code class="lang-bash">$ xmake show -l modes
@@ -349,22 +349,22 @@ $ xmake macro --export=/xxx/macrodir
 <h3 id="custom-macro-script">Custom Macro Script</h3>
 <p>Create and write a <code>macro.lua</code> script first.</p>
 <pre><code class="lang-lua">function main()
-    os.exec(&quot;xmake f -p android --ndk=/xxx/ndk -a arm64-v8a&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p mingw --sdk=/mingwsdk&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a armv7&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a arm64&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a armv7s&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a i386&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a x86_64&quot;)
-    os.exec(&quot;xmake p&quot;)  
+    os.exec("xmake f -p android --ndk=/xxx/ndk -a arm64-v8a")
+    os.exec("xmake p")
+    os.exec("xmake f -p mingw --sdk=/mingwsdk")
+    os.exec("xmake p")
+    os.exec("xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a armv7")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a arm64")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a armv7s")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a i386")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a x86_64")
+    os.exec("xmake p")  
 end
 </code></pre>
 <p>Import this macro script to xmake.</p>
@@ -381,52 +381,52 @@ end
 <h3 id="advance-macro-script">Advance Macro Script</h3>
 <p>Let&#39;s see the <code>package</code> macro script:</p>
 <pre><code class="lang-lua">-- imports
-import(&quot;core.base.option&quot;)
-import(&quot;core.project.config&quot;)
-import(&quot;core.project.project&quot;)
-import(&quot;core.platform.platform&quot;)
+import("core.base.option")
+import("core.project.config")
+import("core.project.project")
+import("core.platform.platform")
 
 -- the options
 local options =
 {
-    {&#39;p&#39;, &quot;plat&quot;,       &quot;kv&quot;,  os.host(),   &quot;Set the platform.&quot;                                    }
-,   {&#39;f&#39;, &quot;config&quot;,     &quot;kv&quot;,  nil,         &quot;Pass the config arguments to \&quot;xmake config\&quot; ..&quot;     }
-,   {&#39;o&#39;, &quot;outputdir&quot;,  &quot;kv&quot;,  nil,         &quot;Set the output directory of the package.&quot;             }
+    {&#39;p&#39;, "plat",       "kv",  os.host(),   "Set the platform."                                    }
+,   {&#39;f&#39;, "config",     "kv",  nil,         "Pass the config arguments to \"xmake config\" .."     }
+,   {&#39;o&#39;, "outputdir",  "kv",  nil,         "Set the output directory of the package."             }
 }
 
 -- package all
 --
 -- .e.g
 -- xmake m package 
--- xmake m package -f &quot;-m debug&quot;
+-- xmake m package -f "-m debug"
 -- xmake m package -p linux
--- xmake m package -p iphoneos -f &quot;-m debug --xxx ...&quot; -o /tmp/xxx
--- xmake m package -f \&quot;--mode=debug\&quot;
+-- xmake m package -p iphoneos -f "-m debug --xxx ..." -o /tmp/xxx
+-- xmake m package -f \"--mode=debug\"
 --
 function main(argv)
 
     -- parse arguments
-    local args = option.parse(argv, options, &quot;Package all architectures for the given the platform.&quot;
-                                           , &quot;&quot;
-                                           , &quot;Usage: xmake macro package [options]&quot;)
+    local args = option.parse(argv, options, "Package all architectures for the given the platform."
+                                           , ""
+                                           , "Usage: xmake macro package [options]")
 
     -- package all archs
     local plat = args.plat
     for _, arch in ipairs(platform.archs(plat)) do
 
         -- config it
-        os.exec(&quot;xmake f -p %s -a %s %s -c %s&quot;, plat, arch, args.config or &quot;&quot;, (option.get(&quot;verbose&quot;) and &quot;-v&quot; or &quot;&quot;))
+        os.exec("xmake f -p %s -a %s %s -c %s", plat, arch, args.config or "", (option.get("verbose") and "-v" or ""))
 
         -- package it
         if args.outputdir then
-            os.exec(&quot;xmake p -o %s %s&quot;, args.outputdir, (option.get(&quot;verbose&quot;) and &quot;-v&quot; or &quot;&quot;))
+            os.exec("xmake p -o %s %s", args.outputdir, (option.get("verbose") and "-v" or ""))
         else
-            os.exec(&quot;xmake p %s&quot;, (option.get(&quot;verbose&quot;) and &quot;-v&quot; or &quot;&quot;))
+            os.exec("xmake p %s", (option.get("verbose") and "-v" or ""))
         end
     end
 
     -- package universal for iphoneos, watchos ...
-    if plat == &quot;iphoneos&quot; or plat == &quot;watchos&quot; then
+    if plat == "iphoneos" or plat == "watchos" then
 
         -- load configure
         config.load()
@@ -438,13 +438,13 @@ function main(argv)
         os.cd(project.directory())
 
         -- the outputdir directory
-        local outputdir = args.outputdir or config.get(&quot;buildir&quot;)
+        local outputdir = args.outputdir or config.get("buildir")
 
         -- package all targets
         for _, target in pairs(project.targets()) do
 
             -- get all modes
-            local modedirs = os.match(format(&quot;%s/%s.pkg/lib/*&quot;, outputdir, target:name()), true)
+            local modedirs = os.match(format("%s/%s.pkg/lib/*", outputdir, target:name()), true)
             for _, modedir in ipairs(modedirs) do
 
                 -- get mode
@@ -453,28 +453,28 @@ function main(argv)
                 -- make lipo arguments
                 local lipoargs = nil
                 for _, arch in ipairs(platform.archs(plat)) do
-                    local archfile = format(&quot;%s/%s.pkg/lib/%s/%s/%s/%s&quot;, outputdir, target:name(), mode, plat, arch, path.filename(target:targetfile())) 
+                    local archfile = format("%s/%s.pkg/lib/%s/%s/%s/%s", outputdir, target:name(), mode, plat, arch, path.filename(target:targetfile())) 
                     if os.isfile(archfile) then
-                        lipoargs = format(&quot;%s -arch %s %s&quot;, lipoargs or &quot;&quot;, arch, archfile) 
+                        lipoargs = format("%s -arch %s %s", lipoargs or "", arch, archfile) 
                     end
                 end
                 if lipoargs then
 
                     -- make full lipo arguments
-                    lipoargs = format(&quot;-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s&quot;, lipoargs, outputdir, target:name(), mode, plat, path.filename(target:targetfile()))
+                    lipoargs = format("-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s", lipoargs, outputdir, target:name(), mode, plat, path.filename(target:targetfile()))
 
                     -- make universal directory
-                    os.mkdir(format(&quot;%s/%s.pkg/lib/%s/%s/universal&quot;, outputdir, target:name(), mode, plat))
+                    os.mkdir(format("%s/%s.pkg/lib/%s/%s/universal", outputdir, target:name(), mode, plat))
 
                     -- package all archs
-                    os.execv(&quot;xmake&quot;, {&quot;l&quot;, &quot;lipo&quot;, lipoargs})
+                    os.execv("xmake", {"l", "lipo", lipoargs})
                 end
             end
         end
     end
 end
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    If you want to known more options, please run: <code>xmake macro --help</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    If you want to known more options, please run: <code>xmake macro --help</code><br></p>
 
 </p>
 <h2 id="generate-doxygen-document">Generate Doxygen Document</h2>

+ 29 - 29
mirror/plugin/more_plugins.html

@@ -94,15 +94,15 @@
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-vscode">xmake-vscode</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-vscode/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-vscode/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-sublime">xmake-sublime</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-sublime/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-sublime/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-idea">xmake-idea</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-idea/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-idea/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/luzhlon/xmake.vim">xmake.vim</a> (third-party, thanks <a href="https://github.com/luzhlon">@luzhlon</a>)</li>
 </ul>
@@ -118,7 +118,7 @@
 <pre><code>buildscript {
   repositories {
     maven {
-      url &quot;https://plugins.gradle.org/m2/&quot;
+      url "https://plugins.gradle.org/m2/"
     }
   }
   dependencies {
@@ -129,14 +129,14 @@
   }
 }
 
-apply plugin: &quot;org.tboox.gradle-xmake-plugin&quot;
+apply plugin: "org.tboox.gradle-xmake-plugin"
 </code></pre><h3 id="simplest-example">Simplest Example</h3>
 <p>We add <code>xmake.lua</code> to <code>projectdir/jni/xmake.lua</code> and enable xmake in build.gradle.</p>
 <h4 id="build-gradle">build.gradle</h4>
 <pre><code>android {
     externalNativeBuild {
         xmake {
-            path &quot;jni/xmake.lua&quot;
+            path "jni/xmake.lua"
         }
     }
 }
@@ -150,10 +150,10 @@ apply plugin: &quot;org.tboox.gradle-xmake-plugin&quot;
     - xmake.lua
     - *.cpp
 </code></pre><p>xmake.lua:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)
-target(&quot;nativelib&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;nativelib.cc&quot;)
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
+target("nativelib")
+    set_kind("shared")
+    add_files("nativelib.cc")
 </code></pre>
 <h3 id="more-gradle-configuations">More Gradle Configuations</h3>
 <pre><code>android {
@@ -161,17 +161,17 @@ target(&quot;nativelib&quot;)
         externalNativeBuild {
             xmake {
                 // append the global cflags (optional)
-                cFlags &quot;-DTEST&quot;
+                cFlags "-DTEST"
 
                 // append the global cppflags (optional)
-                cppFlags &quot;-DTEST&quot;, &quot;-DTEST2&quot;
+                cppFlags "-DTEST", "-DTEST2"
 
                 // switch the build mode to `debug` for `xmake f -m debug` (optional)
-                buildMode &quot;debug&quot;
+                buildMode "debug"
 
                 // set abi filters (optional), e.g. armeabi, armeabi-v7a, arm64-v8a, x86, x86_64
                 // we can also get abiFilters from defaultConfig.ndk.abiFilters
-                abiFilters &quot;armeabi-v7a&quot;, &quot;arm64-v8a&quot;
+                abiFilters "armeabi-v7a", "arm64-v8a"
             }
         }
     }
@@ -179,13 +179,13 @@ target(&quot;nativelib&quot;)
     externalNativeBuild {
         xmake {
             // enable xmake and set xmake.lua project file path
-            path &quot;jni/xmake.lua&quot;
+            path "jni/xmake.lua"
 
             // enable verbose output (optional), e.g. verbose, warning, normal
-            logLevel &quot;verbose&quot;
+            logLevel "verbose"
 
             // set c++stl (optional), e.g. c++_static/c++_shared, gnustl_static/gnustl_shared, stlport_static/stlport_shared
-            stl &quot;c++_shared&quot;
+            stl "c++_shared"
 
             // set the given xmake program path (optional)
             // program /usr/local/bin/xmake
@@ -194,7 +194,7 @@ target(&quot;nativelib&quot;)
             // stdcxx false
 
             // set the given ndk directory path (optional)
-            // ndk &quot;/Users/ruki/files/android-ndk-r20b/&quot;
+            // ndk "/Users/ruki/files/android-ndk-r20b/"
 
             // set sdk version of ndk (optional)
             // sdkver 21
@@ -204,23 +204,23 @@ target(&quot;nativelib&quot;)
 </code></pre><h3 id="build-jni-and-generate-apk">Build JNI and generate apk</h3>
 <p>The <code>xmakeBuild</code> will be injected to <code>assemble</code> task automatically if the gradle-xmake-plugin has been applied.</p>
 <pre><code class="lang-console">$ ./gradlew app:assembleDebug
-&gt; Task :nativelib:xmakeConfigureForArm64
-&gt; Task :nativelib:xmakeBuildForArm64
-&gt;&gt; xmake build
+> Task :nativelib:xmakeConfigureForArm64
+> Task :nativelib:xmakeBuildForArm64
+>> xmake build
 [ 50%]: ccache compiling.debug nativelib.cc
 [ 75%]: linking.debug libnativelib.so
 [100%]: build ok!
-&gt;&gt; install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/arm64-v8a
-&gt; Task :nativelib:xmakeConfigureForArmv7
-&gt; Task :nativelib:xmakeBuildForArmv7
-&gt;&gt; xmake build
+>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/arm64-v8a
+> Task :nativelib:xmakeConfigureForArmv7
+> Task :nativelib:xmakeBuildForArmv7
+>> xmake build
 [ 50%]: ccache compiling.debug nativelib.cc
 [ 75%]: linking.debug libnativelib.so
 [100%]: build ok!
-&gt;&gt; install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/armeabi-v7a
-&gt; Task :nativelib:preBuild
-&gt; Task :nativelib:assemble
-&gt; Task :app:assembleDebug
+>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/armeabi-v7a
+> Task :nativelib:preBuild
+> Task :nativelib:assemble
+> Task :app:assembleDebug
 </code></pre>
 <h3 id="force-to-rebuild-jni">Force to rebuild JNI</h3>
 <pre><code class="lang-console">$ ./gradlew nativelib:xmakeRebuild

+ 9 - 9
mirror/plugin/plugin_development.html

@@ -109,25 +109,25 @@
 <h2 id="quick-start">Quick Start</h2>
 <p>Now we write a simple plugin demo for printing &#39;hello xmake!&#39;</p>
 <pre><code class="lang-lua">-- define a plugin task 
-task(&quot;hello&quot;)
+task("hello")
 
     -- set the category for showing it in plugin category menu (optional)
-    set_category(&quot;plugin&quot;)
+    set_category("plugin")
 
     -- the main entry of the plugin
     on_run(function ()
 
         -- print &#39;hello xmake!&#39;
-        print(&quot;hello xmake!&quot;)
+        print("hello xmake!")
     end)
 
     -- set the menu options, but we put empty options now.
     set_menu {
                 -- usage
-                usage = &quot;xmake hello [options]&quot;
+                usage = "xmake hello [options]"
 
                 -- description
-            ,   description = &quot;Hello xmake!&quot;
+            ,   description = "Hello xmake!"
 
                 -- options
             ,   options = {}
@@ -141,7 +141,7 @@ task(&quot;hello&quot;)
 <ol>
 <li>Put this plugin directory into xmake/plugins the source codes as the builtin plugin.</li>
 <li>Put this plugin directory into ~/.xmake/plugins as the global user plugin.</li>
-<li>Put this plugin directory to anywhere and call <code>add_plugindirs(&quot;./hello&quot;)</code> in xmake.lua as the local project plugin.</li>
+<li>Put this plugin directory to anywhere and call <code>add_plugindirs("./hello")</code> in xmake.lua as the local project plugin.</li>
 </ol>
 <h2 id="run-plugin">Run Plugin</h2>
 <p>Next we run this plugin</p>
@@ -151,16 +151,16 @@ task(&quot;hello&quot;)
 <pre><code>hello xmake!
 </code></pre><p>Finally, we can also run this plugin in the custom scripts of <code>xmake.lua</code></p>
 <pre><code class="lang-lua">
-target(&quot;demo&quot;)
+target("demo")
 
     -- run this plugin after building target
     after_build(function (target)
 
         -- import task module
-        import(&quot;core.project.task&quot;)
+        import("core.project.task")
 
         -- run the plugin task
-        task.run(&quot;hello&quot;)
+        task.run("hello")
     end)
 </code></pre>
 </article>

+ 4 - 4
mirror/theme/builtin_themes.html

@@ -92,7 +92,7 @@
 </style>
     <h2 id="default-theme">Default theme</h2>
 <p>This is the default display theme after we install xmake. Theme name: default, which will provide color output by default, suitable for some dark background terminals.</p>
-<p>&lt;img src=&quot;/assets/img/theme/default.png&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/theme/default.png" width="60%" /></p>
 <p>We can also switch back to the default theme with the following command:</p>
 <pre><code class="lang-bash">$ xmake g --theme=default
 </code></pre>
@@ -101,19 +101,19 @@
 <p>The configuration of the default theme is the same except that the progress is displayed differently.</p>
 <pre><code class="lang-bash">$ xmake g --theme=ninja
 </code></pre>
-<p>&lt;img src=&quot;/assets/img/theme/ninja.png&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/theme/ninja.png" width="60%" /></p>
 <h2 id="emoji-theme">Emoji Theme</h2>
 <p>This theme part output uses emoji characters instead of the previous color output.</p>
 <pre><code class="lang-bash">$ xmake g --theme=emoji
 </code></pre>
-<p>&lt;img src=&quot;/assets/img/theme/emoji.png&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/theme/emoji.png" width="60%" /></p>
 <h2 id="dark-theme">Dark Theme</h2>
 <p>This theme is mainly for some terminal backgrounds with a light color system (such as light yellow, etc.), which causes some warning outputs (the default is also yellow) to be invisible, so the theme color is changed to a dark system to improve visibility.</p>
 <pre><code class="lang-bash">$ xmake g --theme=dark
 </code></pre>
 <h2 id="plain-theme">Plain Theme</h2>
 <p>In fact, this theme is to completely disable color and emoji output, mainly to deal with the problem of garbled display caused by some terminals that do not support colors code, and it is also the most simple theme style.</p>
-<p>!&gt; Some win terminals may not support colors, you can set this theme to solve the problem of garbled display</p>
+<p>!> Some win terminals may not support colors, you can set this theme to solve the problem of garbled display</p>
 <pre><code class="lang-bash">$ xmake g --theme=plain
 </code></pre>
 <h2 id="powershell-theme">Powershell theme</h2>

+ 1 - 1
mirror/theme/switch_theme.html

@@ -101,7 +101,7 @@
 <pre><code class="lang-bash">$ xmake g --theme=default
 </code></pre>
 <p>In addition, xmake also provides a lot of interesting and practical built-in themes, everyone can try, the following will explain in detail.</p>
-<p>!&gt; If you have a better theme, you are welcome to mention pr contribution, thank you very much!</p>
+<p>!> If you have a better theme, you are welcome to mention pr contribution, thank you very much!</p>
 </article>
 </body>
 </html>

File diff suppressed because it is too large
+ 0 - 0
mirror/zh-cn/about/awesome.html


+ 24 - 24
mirror/zh-cn/about/changelog.html

@@ -102,7 +102,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/828">#828</a>: 针对protobuf规则增加导入子目录proto文件支持</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/835">#835</a>: 改进mode.minsizerel模式,针对msvc增加/GL支持,进一步优化目标程序大小</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/828">#828</a>: protobuf规则支持import多级子目录</li>
-<li><a href="https://github.com/xmake-io/xmake/issues/838#issuecomment-643570920">#838</a>: 支持完全重写内置的构建规则,<code>add_files(&quot;src/*.c&quot;, {rules = {&quot;xx&quot;, override = true}})</code></li>
+<li><a href="https://github.com/xmake-io/xmake/issues/838#issuecomment-643570920">#838</a>: 支持完全重写内置的构建规则,<code>add_files("src/*.c", {rules = {"xx", override = true}})</code></li>
 <li><a href="https://github.com/xmake-io/xmake/issues/847">#847</a>: 支持rc文件的头文件依赖解析</li>
 <li>改进msvc工具链,去除全局环境变量的依赖</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/857">#857</a>: 改进<code>set_toolchains()</code>支持交叉编译的时候,特定target可以切换到host工具链同时编译</li>
@@ -179,7 +179,7 @@
 <h2 id="v2-3-1">v2.3.1</h2>
 <h3 id="-">新特性</h3>
 <ul>
-<li><a href="https://github.com/xmake-io/xmake/issues/675">#675</a>: 支持通过设置强制将<code>*.c</code>作为c++代码编译, <code>add_files(&quot;*.c&quot;, {sourcekind = &quot;cxx&quot;})</code>。</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/675">#675</a>: 支持通过设置强制将<code>*.c</code>作为c++代码编译, <code>add_files("*.c", {sourcekind = "cxx"})</code>。</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/681">#681</a>: 支持在msys/cygwin上编译xmake,以及添加msys/cygwin编译平台</li>
 <li>添加socket/pipe模块,并且支持在协程中同时调度process/socket/pipe</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/192">#192</a>: 尝试构建带有第三方构建系统的项目,还支持autotools项目的交叉编译</li>
@@ -234,7 +234,7 @@
 <li>添加protobuf c/c++构建规则</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/468">#468</a>: 添加对 Windows 的 UTF-8 支持</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/472">#472</a>: 添加<code>xmake project -k vsxmake</code>去更好的支持vs工程的生成,内部直接调用xmake来编译</li>
-<li><a href="https://github.com/xmake-io/xmake/issues/487">#487</a>: 通过<code>xmake --files=&quot;src/*.c&quot;</code>支持指定一批文件进行编译。</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/487">#487</a>: 通过<code>xmake --files="src/*.c"</code>支持指定一批文件进行编译。</li>
 <li>针对io模块增加文件锁接口</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/513">#513</a>: 增加对android/termux终端的支持,可在android设备上执行xmake来构建项目</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/517">#517</a>: 为target增加<code>add_cleanfiles</code>接口,实现快速定制化清理文件</li>
@@ -245,7 +245,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/257">#257</a>: 锁定当前正在构建的工程,避免其他xmake进程同时对其操作</li>
 <li>尝试采用/dev/shm作为os.tmpdir去改善构建过程中临时文件的读写效率</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/542">#542</a>: 改进vs系列工具链的unicode输出问题</li>
-<li>对于安装的lua脚本,启用lua字节码存储,减少安装包大小(&lt;2.4M),提高运行加载效率。</li>
+<li>对于安装的lua脚本,启用lua字节码存储,减少安装包大小(<2.4M),提高运行加载效率。</li>
 </ul>
 <h3 id="bugs-">Bugs修复</h3>
 <ul>
@@ -258,7 +258,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/440">#440</a>: 为target/run添加<code>set_rundir()</code>和<code>add_runenvs()</code>接口设置</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/443">#443</a>: 添加命令行tab自动完成支持</li>
 <li>为rule/target添加<code>on_link</code>,<code>before_link</code>和<code>after_link</code>阶段自定义脚本支持</li>
-<li><a href="https://github.com/xmake-io/xmake/issues/190">#190</a>: 添加<code>add_rules(&quot;lex&quot;, &quot;yacc&quot;)</code>规则去支持lex/yacc项目</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/190">#190</a>: 添加<code>add_rules("lex", "yacc")</code>规则去支持lex/yacc项目</li>
 </ul>
 <h3 id="-">改进</h3>
 <ul>
@@ -301,7 +301,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/318">#318</a>: 添加<code>add_installfiles</code>接口到target去自定义安装文件</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/339">#339</a>: 改进<code>add_requires</code>和<code>find_package</code>使其支持对第三方包管理的集成支持</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/327">#327</a>: 实现对conan包管理的集成支持</li>
-<li>添加内置API <code>find_packages(&quot;pcre2&quot;, &quot;zlib&quot;)</code>去同时查找多个依赖包,不需要通过import导入即可直接调用</li>
+<li>添加内置API <code>find_packages("pcre2", "zlib")</code>去同时查找多个依赖包,不需要通过import导入即可直接调用</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/320">#320</a>: 添加模板配置文件相关接口,<code>add_configfiles</code>和<code>set_configvar</code></li>
 <li><a href="https://github.com/xmake-io/xmake/issues/179">#179</a>: 扩展<code>xmake project</code>插件,新增CMakelist.txt生成支持</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/361">#361</a>: 增加对vs2019 preview的支持</li>
@@ -319,8 +319,8 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/322">#322</a>: 添加<code>option.add_features</code>, <code>option.add_cxxsnippets</code> 和 <code>option.add_csnippets</code></li>
 <li>移除xmake 1.x的一些废弃接口, 例如:<code>add_option_xxx</code></li>
 <li><a href="https://github.com/xmake-io/xmake/issues/327">#327</a>: 改进<code>lib.detect.find_package</code>增加对conan包管理器的支持</li>
-<li>改进<code>lib.detect.find_package</code>并且添加内建的<code>find_packages(&quot;zlib 1.x&quot;, &quot;openssl&quot;, {xxx = ...})</code>接口</li>
-<li>标记<code>set_modes()</code>作为废弃接口, 我们使用<code>add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)</code>来替代它</li>
+<li>改进<code>lib.detect.find_package</code>并且添加内建的<code>find_packages("zlib 1.x", "openssl", {xxx = ...})</code>接口</li>
+<li>标记<code>set_modes()</code>作为废弃接口, 我们使用<code>add_rules("mode.debug", "mode.release")</code>来替代它</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/353">#353</a>: 改进<code>target:set</code>, <code>target:add</code> 并且添加<code>target:del</code>去动态修改target配置</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/356">#356</a>: 添加<code>qt_add_static_plugins()</code>接口去支持静态Qt sdk</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/351">#351</a>: 生成vs201x插件增加对yasm的支持</li>
@@ -328,7 +328,7 @@
 </ul>
 <h3 id="bugs-">Bugs修复</h3>
 <ul>
-<li>修复无法通过 <code>set_optimize()</code> 设置优化选项,如果存在<code>add_rules(&quot;mode.release&quot;)</code>的情况下</li>
+<li>修复无法通过 <code>set_optimize()</code> 设置优化选项,如果存在<code>add_rules("mode.release")</code>的情况下</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/289">#289</a>: 修复在windows下解压gzip文件失败</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/296">#296</a>: 修复<code>option.add_includedirs</code>对cuda编译不生效</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/321">#321</a>: 修复PATH环境改动后查找工具不对问题</li>
@@ -356,7 +356,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/259">#259</a>: 改进 on_build, on_build_file 和 on_xxx 等接口</li>
 <li>改进远程包管理器,更加方便的包依赖配置切换</li>
 <li>支持only头文件依赖包的安装</li>
-<li>支持对包内置links的手动调整,<code>add_packages(&quot;xxx&quot;, {links = {}})</code></li>
+<li>支持对包内置links的手动调整,<code>add_packages("xxx", {links = {}})</code></li>
 </ul>
 <h3 id="bugs-">Bugs修复</h3>
 <ul>
@@ -370,7 +370,7 @@
 <li>添加<code>set_config</code>接口去设置默认配置</li>
 <li>添加<code>$xmake --try</code>去尝试构建工程</li>
 <li>添加<code>set_enabled(false)</code>去显示的禁用target</li>
-<li><a href="https://github.com/xmake-io/xmake/issues/69">#69</a>: 添加远程依赖包管理, <code>add_requires(&quot;tbox ~1.6.1&quot;)</code></li>
+<li><a href="https://github.com/xmake-io/xmake/issues/69">#69</a>: 添加远程依赖包管理, <code>add_requires("tbox ~1.6.1")</code></li>
 <li><a href="https://github.com/xmake-io/xmake/pull/216">#216</a>: 添加windows mfc编译规则</li>
 </ul>
 <h3 id="-">改进</h3>
@@ -408,7 +408,7 @@
 <h3 id="-">改进</h3>
 <ul>
 <li>添加FAQ到自动生成的xmake.lua文件,方便用户快速上手</li>
-<li>支持Android NDK &gt;= r14的版本</li>
+<li>支持Android NDK >= r14的版本</li>
 <li>改进swiftc对warning flags的支持</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/167">#167</a>: 改进自定义规则:<code>rule()</code></li>
 <li>改进<code>os.files</code>和<code>os.dirs</code>接口,加速文件模式匹配</li>
@@ -417,7 +417,7 @@
 </ul>
 <h3 id="bugs-">Bugs修复</h3>
 <ul>
-<li>修复无法通过<code>add_ldflags(&quot;xx&quot;, &quot;xx&quot;, {force = true})</code>强制设置多个flags的问题</li>
+<li>修复无法通过<code>add_ldflags("xx", "xx", {force = true})</code>强制设置多个flags的问题</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/157">#157</a>: 修复pdb符号输出目录不存在情况下编译失败问题</li>
 <li>修复对macho格式目标strip all符号失效问题</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/168">#168</a>: 修复生成vs201x工程插件,在x64下失败的问题</li>
@@ -426,7 +426,7 @@
 <h3 id="-">新特性</h3>
 <ul>
 <li>添加<code>del_files()</code>接口去从已添加的文件列表中移除一些文件</li>
-<li>添加<code>rule()</code>, <code>add_rules()</code>接口实现自定义构建规则,并且改进<code>add_files(&quot;src/*.md&quot;, {rule = &quot;markdown&quot;})</code></li>
+<li>添加<code>rule()</code>, <code>add_rules()</code>接口实现自定义构建规则,并且改进<code>add_files("src/*.md", {rule = "markdown"})</code></li>
 <li>添加<code>os.filesize()</code>接口</li>
 <li>添加<code>core.ui.xxx</code>等cui组件模块,实现终端可视化界面,用于实现跟用户进行短暂的交互</li>
 <li>通过<code>xmake f --menu</code>实现可视化菜单交互配置,简化工程的编译配置</li>
@@ -440,8 +440,8 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/151">#151</a>: 改进mingw平台下动态库生成</li>
 <li>改进生成makefile插件</li>
 <li>改进检测错误提示</li>
-<li>改进<code>add_cxflags</code>等flags api的设置,添加force参数,来禁用自动检测和映射,强制设置选项:<code>add_cxflags(&quot;-DTEST&quot;, {force = true})</code></li>
-<li>改进<code>add_files</code>的flags设置,添加force域,用于设置不带自动检测和映射的原始flags:<code>add_files(&quot;src/*.c&quot;, {force = {cxflags = &quot;-DTEST&quot;}})</code></li>
+<li>改进<code>add_cxflags</code>等flags api的设置,添加force参数,来禁用自动检测和映射,强制设置选项:<code>add_cxflags("-DTEST", {force = true})</code></li>
+<li>改进<code>add_files</code>的flags设置,添加force域,用于设置不带自动检测和映射的原始flags:<code>add_files("src/*.c", {force = {cxflags = "-DTEST"}})</code></li>
 <li>改进搜索工程根目录策略</li>
 <li>改进vs环境探测,支持加密文件系统下vs环境的探测</li>
 <li>升级luajit到最新2.1.0-beta3</li>
@@ -468,7 +468,7 @@
 <li>当生成新工程的时候,自动生成一个<code>.gitignore</code>文件,忽略一些xmake的临时文件和目录</li>
 <li>改进创建模板工程,使用模板名代替模板id作为参数</li>
 <li>改进macOS编译平台的探测,如果没有安装xcode也能够进行编译构建,如果有编译器的话</li>
-<li>改进<code>set_config_header</code>接口,支持局部版本号设置,优先于全局<code>set_version</code>,例如:<code>set_config_header(&quot;config&quot;, {version = &quot;2.1.8&quot;, build = &quot;%Y%m%d%H%M&quot;})</code></li>
+<li>改进<code>set_config_header</code>接口,支持局部版本号设置,优先于全局<code>set_version</code>,例如:<code>set_config_header("config", {version = "2.1.8", build = "%Y%m%d%H%M"})</code></li>
 </ul>
 <h3 id="bugs-">Bugs修复</h3>
 <ul>
@@ -487,7 +487,7 @@
 <ul>
 <li>改进<code>cprint()</code>,支持24位真彩色输出</li>
 <li>对<code>add_rpathdirs()</code>增加对<code>@loader_path</code>和<code>$ORIGIN</code>的内置变量支持,提供可迁移动态库加载</li>
-<li>改进<code>set_version(&quot;x.x.x&quot;, {build = &quot;%Y%m%d%H%M&quot;})</code> 支持buildversion设置</li>
+<li>改进<code>set_version("x.x.x", {build = "%Y%m%d%H%M"})</code> 支持buildversion设置</li>
 <li>移除docs目录,将其放置到独立xmake-docs仓库中,减少xmake.zip的大小,优化下载安装的效率</li>
 <li>改进安装和卸载脚本,支持DESTDIR和PREFIX环境变量设置</li>
 <li>通过缓存优化flags探测,加速编译效率</li>
@@ -512,7 +512,7 @@
 <ul>
 <li>改进<code>add_files</code>,支持对files粒度进行编译选项的各种配置,更加灵活。</li>
 <li>从依赖的target和option中继承links和linkdirs。</li>
-<li>改进<code>target.add_deps</code>接口,添加继承配置,允许手动禁止依赖继承,例如:<code>add_deps(&quot;test&quot;, {inherit = false})</code></li>
+<li>改进<code>target.add_deps</code>接口,添加继承配置,允许手动禁止依赖继承,例如:<code>add_deps("test", {inherit = false})</code></li>
 <li>移除<code>tbox.pkg</code>二进制依赖,直接集成tbox源码进行编译</li>
 </ul>
 <h3 id="bugs-">Bugs修复</h3>
@@ -529,7 +529,7 @@
 <li><a href="https://github.com/xmake-io/xmake/issues/83">#83</a>: 添加用户扩展模块去探测程序,库文件以及其他主机环境</li>
 <li>添加<code>find_program</code>, <code>find_file</code>, <code>find_library</code>, <code>find_tool</code>和<code>find_package</code> 等模块接口</li>
 <li>添加<code>net.*</code>和<code>devel.*</code>扩展模块</li>
-<li>添加<code>val()</code>接口去获取内置变量,例如:<code>val(&quot;host&quot;)</code>, <code>val(&quot;env PATH&quot;)</code>, <code>val(&quot;shell echo hello&quot;)</code> and <code>val(&quot;reg HKEY_LOCAL_MACHINE\\XX;Value&quot;)</code></li>
+<li>添加<code>val()</code>接口去获取内置变量,例如:<code>val("host")</code>, <code>val("env PATH")</code>, <code>val("shell echo hello")</code> and <code>val("reg HKEY_LOCAL_MACHINE\\XX;Value")</code></li>
 <li>增加对微软.rc资源文件的编译支持,当在windows上编译时,可以增加资源文件了</li>
 <li>增加<code>has_flags</code>, <code>features</code>和<code>has_features</code>等探测模块接口</li>
 <li>添加<code>option.on_check</code>, <code>option.after_check</code> 和 <code>option.before_check</code> 接口</li>
@@ -551,7 +551,7 @@
 <li>改进<code>print</code>接口去更好些显示table数据</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/111">#111</a>: 添加<code>--root</code>通用选项去临时支持作为root运行</li>
 <li><a href="https://github.com/xmake-io/xmake/pull/113">#113</a>: 改进权限管理,现在作为root运行也是非常安全的</li>
-<li>改进<code>xxx_script</code>工程描述api,支持多平台模式选择, 例如:<code>on_build(&quot;iphoneos|arm*&quot;, function (target) end)</code></li>
+<li>改进<code>xxx_script</code>工程描述api,支持多平台模式选择, 例如:<code>on_build("iphoneos|arm*", function (target) end)</code></li>
 <li>改进内置变量,支持环境变量和注册表数据的获取</li>
 <li>改进vstudio环境和交叉工具链的探测</li>
 <li><a href="https://github.com/xmake-io/xmake/issues/71">#71</a>: 改进从环境变量中探测链接器和编译器</li>
@@ -562,7 +562,7 @@
 <li>优化<code>xmake rebuild</code>在windows上的构建速度</li>
 <li>将<code>core.project.task</code>模块迁移至<code>core.base.task</code></li>
 <li>将<code>echo</code> 和 <code>app2ipa</code> 插件迁移到 <a href="https://github.com/xmake-io/xmake-plugins">xmake-plugins</a> 仓库</li>
-<li>添加<code>set_config_header(&quot;config.h&quot;, {prefix = &quot;&quot;})</code> 代替 <code>set_config_h</code> 和 <code>set_config_h_prefix</code></li>
+<li>添加<code>set_config_header("config.h", {prefix = ""})</code> 代替 <code>set_config_h</code> 和 <code>set_config_h_prefix</code></li>
 </ul>
 <h3 id="bugs-">Bugs修复</h3>
 <ul>
@@ -695,7 +695,7 @@
 <h2 id="v2-0-4">v2.0.4</h2>
 <h3 id="-">新特性</h3>
 <ul>
-<li>在<code>xmake.lua</code>中添加原生shell支持,例如:<code>add_ldflags(&quot;$(shell pkg-config --libs sqlite3)&quot;)</code></li>
+<li>在<code>xmake.lua</code>中添加原生shell支持,例如:<code>add_ldflags("$(shell pkg-config --libs sqlite3)")</code></li>
 <li>编译windows目标程序,默认默认启用pdb符号文件</li>
 <li>在windows上添加调试器支持(vsjitdebugger, ollydbg, windbg ... )</li>
 <li>添加<code>getenv</code>接口到<code>xmake.lua</code>的全局作用域中</li>
@@ -775,7 +775,7 @@
 <li>优化构建速度,支持多任务编译(支持vs编译器)(实测:比v1.0.4提升x4倍的构建性能)</li>
 <li>优化自动检测机制,更加的稳定和准确</li>
 <li>修改部分工程描述api,增强扩展性,减少一些命名歧义(对低版本向下兼容)</li>
-<li>优化静态库合并:<code>add_files(&quot;*.a&quot;)</code>,修复一些bug</li>
+<li>优化静态库合并:<code>add_files("*.a")</code>,修复一些bug</li>
 <li>优化交叉编译,通过<code>--sdk=xxx</code>参数实现更加方便智能的进行交叉编译配置,简化mingw平台的编译配置</li>
 <li>简化命令行配置开关, 支持<code>xmake config --xxx=[y|n|yes|no|true|false]</code>等开关值</li>
 <li>合并iphoneos和iphonesimulator平台,以及watchos和watchsimulator平台,通过arch来区分,使得打包更加方便,能够支持一次性打包iphoneos的所有arch到一个包中</li>

+ 6 - 6
mirror/zh-cn/about/sponsor.html

@@ -92,22 +92,22 @@
 </style>
     <p>xmake项目属于个人开源项目,它的发展需要您的帮助,如果您愿意支持xmake项目的开发,欢迎为其捐赠,支持它的发展。</p>
 <h2 id="-">支付宝</h2>
-<p>&lt;img src=&quot;/assets/img/alipay.png&quot; alt=&quot;alipay&quot; width=&quot;256&quot; height=&quot;256&quot;&gt;</p>
+<p><img src="/assets/img/alipay.png" alt="alipay" width="256" height="256"></p>
 <p>账号:<a href="mailto:[email protected]">[email protected]</a></p>
 <h2 id="-">微信</h2>
-<p>&lt;img src=&quot;/assets/img/weixin.png&quot; alt=&quot;weixin&quot; width=&quot;218&quot; height=&quot;218&quot;&gt;</p>
+<p><img src="/assets/img/weixin.png" alt="weixin" width="218" height="218"></p>
 <h2 id="github-sponsor">Github Sponsor</h2>
-<p>&lt;iframe src=&quot;https://github.com/sponsors/waruqi/card&quot; title=&quot;Sponsor waruqi&quot; height=&quot;130&quot; width=&quot;600&quot; style=&quot;border: 0;&quot;&gt;&lt;/iframe&gt;
+<p><iframe src="https://github.com/sponsors/waruqi/card" title="Sponsor waruqi" height="130" width="600" style="border: 0;"></iframe>
 
 </p>
 <h2 id="-">爱发电</h2>
-<p>&lt;a href=&quot;https://afdian.net/@xmake&quot; target=&quot;_blank&quot;&gt;<br>&lt;img src=&quot;/assets/img/afdian-xmake.png&quot; alt=&quot;afdian&quot; width=&quot;50%&quot; height=&quot;50%&quot;&gt;<br>&lt;/a&gt;</p>
+<p><a href="https://afdian.net/@xmake" target="_blank"><br><img src="/assets/img/afdian-xmake.png" alt="afdian" width="50%" height="50%"><br></a></p>
 <h2 id="paypal">Paypal</h2>
 <p><a href="https://paypal.me/tboox/5"><img src="/assets/img/paypal.png" alt="Paypal Me"></a></p>
 <h2 id="bitcoin">Bitcoin</h2>
 <pre><code>bc1qstzyehpjsryh8qwj8kf95js4cjcj3p670s5j9fyd3gkj946qdt7qx0xjpa
 </code></pre><h2 id="-">支持者</h2>
-<p>&lt;a href=&quot;https://opencollective.com/xmake#backers&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/backers.svg?width=890&quot;&gt;&lt;/a&gt;</p>
+<p><a href="https://opencollective.com/xmake#backers" target="_blank"><img src="https://opencollective.com/xmake/backers.svg?width=890"></a></p>
 <table>
 <thead>
 <tr>
@@ -304,7 +304,7 @@
 </table>
 <h2 id="-">赞助者</h2>
 <p>通过赞助支持此项目,您的logo和网站链接将显示在这里。[<a href="https://opencollective.com/xmake#sponsor">赞助此项目</a>]</p>
-<p>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/0/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/0/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/1/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/1/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/2/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/2/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/3/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/3/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/4/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/4/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/5/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/5/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/6/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/6/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/7/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/7/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/8/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/8/avatar.svg&quot;&gt;&lt;/a&gt;<br>&lt;a href=&quot;https://opencollective.com/xmake/sponsor/9/website&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/sponsor/9/avatar.svg&quot;&gt;&lt;/a&gt;</p>
+<p><a href="https://opencollective.com/xmake/sponsor/0/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/0/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/1/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/1/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/2/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/2/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/3/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/3/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/4/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/4/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/5/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/5/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/6/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/6/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/7/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/7/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/8/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/8/avatar.svg"></a><br><a href="https://opencollective.com/xmake/sponsor/9/website" target="_blank"><img src="https://opencollective.com/xmake/sponsor/9/avatar.svg"></a></p>
 </article>
 </body>
 </html>

+ 52 - 52
mirror/zh-cn/getting_started.html

@@ -95,18 +95,18 @@
 <p>👉 <a href="https://xmake.io/#/zh-cn/about/sponsor">捐助页面</a></p>
 <h2 id="-">安装</h2>
 <h4 id="-curl">使用curl</h4>
-<pre><code class="lang-bash">bash &lt;(curl -fsSL https://xmake.io/shget.text)
+<pre><code class="lang-bash">bash <(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h4 id="-wget">使用wget</h4>
-<pre><code class="lang-bash">bash &lt;(wget https://xmake.io/shget.text -O -)
+<pre><code class="lang-bash">bash <(wget https://xmake.io/shget.text -O -)
 </code></pre>
 <h4 id="-powershell">使用powershell</h4>
 <pre><code class="lang-powershell">Invoke-Expression (Invoke-Webrequest &#39;https://xmake.io/psget.text&#39; -UseBasicParsing).Content
 </code></pre>
 <h2 id="-">简单的工程描述</h2>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/showcode1.png&quot; width=&quot;340px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/showcode1.png" width="340px" /></p>
 <h2 id="-">包依赖描述</h2>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/add_require.png&quot; width=&quot;600px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/add_require.png" width="600px" /></p>
 <p>官方的xmake包管理仓库: <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a></p>
 <h2 id="-">构建工程</h2>
 <pre><code class="lang-bash">$ xmake
@@ -124,7 +124,7 @@ $ xmake
 <h2 id="-">图形化菜单配置</h2>
 <pre><code class="lang-bash">$ xmake f --menu
 </code></pre>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/menuconf.png&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/menuconf.png" width="650px" /></p>
 <h2 id="-ninja-">跟ninja一样快的构建速度</h2>
 <p>测试工程: <a href="https://github.com/xmake-io/xmake/tree/master/core">xmake-core</a></p>
 <h3 id="-">多任务并行编译测试</h3>
@@ -203,9 +203,9 @@ $ xmake
 </table>
 <h2 id="-">包依赖管理</h2>
 <h3 id="-">下载和编译</h3>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/package_manage.png&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/package_manage.png" width="650px" /></p>
 <h3 id="-">架构和流程</h3>
-<p>&lt;img src=&quot;https://xmake.io/assets/img/index/package_arch.png&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://xmake.io/assets/img/index/package_arch.png" width="650px" /></p>
 <h2 id="-">支持平台</h2>
 <ul>
 <li>Windows (x86, x64)</li>
@@ -245,73 +245,73 @@ $ xmake
 </ul>
 <h2 id="-">更多例子</h2>
 <p>Debug和Release模式:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
 
-target(&quot;console&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    if is_mode(&quot;debug&quot;) then
-        add_defines(&quot;DEBUG&quot;)
+target("console")
+    set_kind("binary")
+    add_files("src/*.c")
+    if is_mode("debug") then
+        add_defines("DEBUG")
     end
 </code></pre>
 <p>自定义脚本:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
     after_build(function (target)
-        print(&quot;hello: %s&quot;, target:name())
-        os.exec(&quot;echo %s&quot;, target:targetfile())
+        print("hello: %s", target:name())
+        os.exec("echo %s", target:targetfile())
     end)
 </code></pre>
 <p>下载和使用在<a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a>和第三方包仓库的依赖包:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox &gt;1.6.1&quot;, &quot;libuv master&quot;, &quot;vcpkg::ffmpeg&quot;, &quot;brew::pcre2/libpcre2-8&quot;)
-add_requires(&quot;conan::OpenSSL/1.0.2n@conan/stable&quot;, {alias = &quot;openssl&quot;, optional = true, debug = true}) 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;tbox&quot;, &quot;libuv&quot;, &quot;vcpkg::ffmpeg&quot;, &quot;brew::pcre2/libpcre2-8&quot;, &quot;openssl&quot;)
+<pre><code class="lang-lua">add_requires("tbox >1.6.1", "libuv master", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8")
+add_requires("conan::OpenSSL/1.0.2n@conan/stable", {alias = "openssl", optional = true, debug = true}) 
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("tbox", "libuv", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8", "openssl")
 </code></pre>
 <p>Qt QuickApp应用程序:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.quickapp&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/qml.qrc&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.quickapp")
+    add_files("src/*.cpp")
+    add_files("src/qml.qrc")
 </code></pre>
 <p>Cuda程序:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.cu&quot;)
-    add_cugencodes(&quot;native&quot;)
-    add_cugencodes(&quot;compute_30&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.cu")
+    add_cugencodes("native")
+    add_cugencodes("compute_30")
 </code></pre>
 <p>WDK/UMDF驱动程序:</p>
-<pre><code class="lang-lua">target(&quot;echo&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;driver/*.c&quot;) 
-    add_files(&quot;driver/*.inx&quot;)
-    add_includedirs(&quot;exe&quot;)
+<pre><code class="lang-lua">target("echo")
+    add_rules("wdk.driver", "wdk.env.umdf")
+    add_files("driver/*.c") 
+    add_files("driver/*.inx")
+    add_includedirs("exe")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;exe/*.cpp&quot;)
+target("app")
+    add_rules("wdk.binary", "wdk.env.umdf")
+    add_files("exe/*.cpp")
 </code></pre>
 <p>更多WDK驱动程序例子(umdf/kmdf/wdm),见:<a href="https://xmake.io/#/zh-cn/guide/project_examples?id=wdk%e9%a9%b1%e5%8a%a8%e7%a8%8b%e5%ba%8f">WDK工程例子</a></p>
 <h2 id="-">插件</h2>
 <h4 id="-ide-makefile-vs2002-vs2019-">生成IDE工程文件插件(makefile, vs2002 - vs2019, ...)</h4>
-<pre><code class="lang-bash">$ xmake project -k vsxmake -m &quot;debug;release&quot; # 新版vs工程生成插件(推荐)
-$ xmake project -k vs -m &quot;debug;release&quot;
+<pre><code class="lang-bash">$ xmake project -k vsxmake -m "debug;release" # 新版vs工程生成插件(推荐)
+$ xmake project -k vs -m "debug;release"
 $ xmake project -k cmake
 $ xmake project -k ninja
 $ xmake project -k compile_commands
 </code></pre>
 <h4 id="-lua-">加载自定义lua脚本插件</h4>
 <pre><code class="lang-bash">$ xmake l ./test.lua
-$ xmake l -c &quot;print(&#39;hello xmake!&#39;)&quot;
+$ xmake l -c "print(&#39;hello xmake!&#39;)"
 $ xmake l lib.detect.find_tool gcc
 $ xmake l
-&gt; print(&quot;hello xmake!&quot;)
-&gt; {1, 2, 3}
-&lt; { 
+> print("hello xmake!")
+> {1, 2, 3}
+< { 
     1,
     2,
     3 
@@ -323,15 +323,15 @@ $ xmake l
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-vscode">xmake-vscode</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-vscode/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-vscode/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-sublime">xmake-sublime</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-sublime/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-sublime/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-idea">xmake-idea</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-idea/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-idea/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><p><a href="https://github.com/luzhlon/xmake.vim">xmake.vim</a> (third-party, thanks <a href="https://github.com/luzhlon">@luzhlon</a>)</p>
 </li>
@@ -347,7 +347,7 @@ $ xmake l
 <li><a href="https://github.com/xmake-io/awesome-xmake">更多</a></li>
 </ul>
 <h2 id="-">演示视频</h2>
-<p>&lt;a href=&quot;https://asciinema.org/a/133693&quot;&gt;<br>&lt;img src=&quot;https://asciinema.org/a/133693.png&quot; width=&quot;650px&quot; /&gt;<br>&lt;/a&gt;</p>
+<p><a href="https://asciinema.org/a/133693"><br><img src="https://asciinema.org/a/133693.png" width="650px" /><br></a></p>
 <h2 id="-">联系方式</h2>
 <ul>
 <li>邮箱:<a href="mailto:[email protected]">[email protected]</a></li>
@@ -359,7 +359,7 @@ $ xmake l
 <li>微信公众号:tboox-os</li>
 </ul>
 <h2 id="-">感谢</h2>
-<p>感谢所有对xmake有所<a href="CONTRIBUTING.md">贡献</a>的人:<br>&lt;a href=&quot;https://github.com/xmake-io/xmake/graphs/contributors&quot;&gt;&lt;img src=&quot;https://opencollective.com/xmake/contributors.svg?width=890&amp;button=false&quot; /&gt;&lt;/a&gt;</p>
+<p>感谢所有对xmake有所<a href="CONTRIBUTING.md">贡献</a>的人:<br><a href="https://github.com/xmake-io/xmake/graphs/contributors"><img src="https://opencollective.com/xmake/contributors.svg?width=890&amp;button=false" /></a></p>
 <ul>
 <li><a href="https://github.com/TitanSnow">TitanSnow</a>: 提供xmake <a href="https://github.com/TitanSnow/ts-xmake-logo">logo</a> 和安装脚本</li>
 <li><a href="https://github.com/uael">uael</a>: 提供语义版本跨平台c库 <a href="https://github.com/uael/sv">sv</a></li>

+ 53 - 53
mirror/zh-cn/guide/configuration.html

@@ -91,14 +91,14 @@
 }
 </style>
     <p>通过<code>xmake f|config</code>配置命令,设置构建前的相关配置信息,详细参数选项,请运行: <code>xmake f --help</code>。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    你可以使用命令行缩写来简化输入,也可以使用全名,例如: &lt;br&gt;<br>    <code>xmake f</code> 或者 <code>xmake config</code>.&lt;br&gt;<br>    <code>xmake f -p linux</code> 或者 <code>xmake config --plat=linux</code>.<br>&lt;/p&gt;
+<p><p class="tip"><br>    你可以使用命令行缩写来简化输入,也可以使用全名,例如: <br><br>    <code>xmake f</code> 或者 <code>xmake config</code>.<br><br>    <code>xmake f -p linux</code> 或者 <code>xmake config --plat=linux</code>.<br></p>
 
 </p>
 <h2 id="-">目标平台</h2>
 <h3 id="-">主机平台</h3>
 <pre><code class="lang-bash">$ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    xmake将会自动探测当前主机平台,默认自动生成对应的目标程序。<br>&lt;/p&gt;
+<p><p class="tip"><br>    xmake将会自动探测当前主机平台,默认自动生成对应的目标程序。<br></p>
 
 </p>
 <h3 id="linux">Linux</h3>
@@ -113,7 +113,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p android --ndk=~/files/android-ndk-r10e/ -a arm64-v8a --bin=~/files/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin
 </code></pre>
 <p><a href="#-bin">--bin</a>主要用于设置选择编译工具的具体bin目录,这个的使用跟<a href="#交叉编译">交叉编译</a>中的<a href="#-bin">--bin</a>的行为是一致的。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果手动设置了bin目录,没有通过检测,可以看下是否<code>--arch=</code>参数没有匹配对。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果手动设置了bin目录,没有通过检测,可以看下是否<code>--arch=</code>参数没有匹配对。<br></p>
 
 </p>
 <h3 id="iphoneos">iPhoneOS</h3>
@@ -162,7 +162,7 @@ arm-linux-armeabi-strip
 $ xmake
 </code></pre>
 <p>其中,<code>-p cross</code>用于指定当前的平台是交叉编译平台,<code>--sdk=</code>用于指定交叉工具链的根目录。</p>
-<p>注:我们也可以指定<code>-p linux</code>平台来配置交叉编译,效果是一样的,唯一的区别是额外标识了linux平台名,方便xmake.lua里面通过<code>is_plat(&quot;linux&quot;)</code>来判断平台。</p>
+<p>注:我们也可以指定<code>-p linux</code>平台来配置交叉编译,效果是一样的,唯一的区别是额外标识了linux平台名,方便xmake.lua里面通过<code>is_plat("linux")</code>来判断平台。</p>
 <p>这个时候,xmake会去自动探测gcc等编译器的前缀名cross:<code>arm-linux-armeabi-</code>,并且编译的时候,也会自动加上<code>链接库</code>和<code>头文件</code>的搜索选项,例如:</p>
 <pre><code>-I/home/toolchains_sdkdir/include 
 -L/home/toolchains_sdkdir/lib
@@ -222,32 +222,32 @@ $ xmake
 <li>arflags: 指定静态库的生成参数</li>
 </ul>
 <p>例如:</p>
-<pre><code class="lang-bash">$ xmake f -p linux --sdk=/usr/toolsdk --cflags=&quot;-DTEST -I/xxx/xxx&quot; --ldflags=&quot;-lpthread&quot;
+<pre><code class="lang-bash">$ xmake f -p linux --sdk=/usr/toolsdk --cflags="-DTEST -I/xxx/xxx" --ldflags="-lpthread"
 </code></pre>
 <h3 id="-">项目描述设置</h3>
 <h4 id="set_toolchains">set_toolchains</h4>
 <p>这对某个特定的target单独切换设置不同的工具链,和set_toolset不同的是,此接口是对完整工具链的整体切换,比如cc/ld/sh等一系列工具集。</p>
 <p>这也是推荐做法,因为像gcc/clang等大部分编译工具链,编译器和链接器都是配套使用的,要切就得整体切,单独零散的切换设置会很繁琐。</p>
 <p>比如我们切换test目标到clang+yasm两个工具链:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    set_toolchains(&quot;clang&quot;, &quot;yasm&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    set_toolchains("clang", "yasm")
 </code></pre>
 <h4 id="set_toolset">set_toolset</h4>
 <p>如果觉得每次通过命令行配置比较繁琐,有些配置可以通过在xmake.lua预先配置好,来简化命令配置,比如编译器的指定,就可以通过<code>set_toolset</code>来对每个target单独设置。</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;)
-    set_toolset(&quot;ld&quot;, &quot;clang++&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    set_toolset("cxx", "clang")
+    set_toolset("ld", "clang++")
 </code></pre>
 <p>强制test目标的编译器和链接器使用clang编译器,或者指定交叉编译工具链中的编译器名或者路径。</p>
 <h4 id="set_config">set_config</h4>
 <p>我们也可以通过<code>set_config</code>来设置在<code>xmake f/config</code>命令中的每个配置参数的默认值,这是个全局api,对每个target都会生效。</p>
-<pre><code class="lang-lua">set_config(&quot;cflags&quot;, &quot;-DTEST&quot;)
-set_config(&quot;sdk&quot;, &quot;/home/xxx/tooksdk&quot;)
-set_config(&quot;cc&quot;, &quot;gcc&quot;)
-set_config(&quot;ld&quot;, &quot;g++&quot;)
+<pre><code class="lang-lua">set_config("cflags", "-DTEST")
+set_config("sdk", "/home/xxx/tooksdk")
+set_config("cc", "gcc")
+set_config("ld", "g++")
 </code></pre>
 <p>不过,我们还是可以通过<code>xmake f --name=value</code>的方式,去修改xmake.lua中的默认配置。</p>
 <h3 id="-">自定义编译平台</h3>
@@ -257,27 +257,27 @@ set_config(&quot;ld&quot;, &quot;g++&quot;)
 $ xmake
 </code></pre>
 <p>我们传入了myplat自定义平台名,作为当前交叉工具链的编译平台,然后xmake.lua里面我们对这个平台,配置下对应的设置:</p>
-<pre><code class="lang-lua">if is_plat(&quot;myplat&quot;) then
-    add_defines(&quot;TEST&quot;)
+<pre><code class="lang-lua">if is_plat("myplat") then
+    add_defines("TEST")
 end
 </code></pre>
 <p>通过这种方式,xmake就可以很方便的扩展处理各种编译平台,用户可以自己扩展支持freebsd, netbsd, sunos等其他各种平台的交叉编译。</p>
 <p>我摘录一段之前移植libuv写的交叉编译的配置,直观感受下:</p>
 <pre><code class="lang-lua">-- for gragonfly/freebsd/netbsd/openbsd platform
-if is_plat(&quot;gragonfly&quot;, &quot;freebsd&quot;, &quot;netbsd&quot;, &quot;openbsd&quot;) then
-    add_files(&quot;src/unix/bsd-ifaddrs.c&quot;)
-    add_files(&quot;src/unix/freebsd.c&quot;)
-    add_files(&quot;src/unix/kqueue.c&quot;)
-    add_files(&quot;src/unix/posix-hrtime.c&quot;)
-    add_headerfiles(&quot;(include/uv-bsd.h)&quot;)
+if is_plat("gragonfly", "freebsd", "netbsd", "openbsd") then
+    add_files("src/unix/bsd-ifaddrs.c")
+    add_files("src/unix/freebsd.c")
+    add_files("src/unix/kqueue.c")
+    add_files("src/unix/posix-hrtime.c")
+    add_headerfiles("(include/uv-bsd.h)")
 end 
 
 -- for sunos platform
-if is_plat(&quot;sunos&quot;) then
-    add_files(&quot;src/unix/no-proctitle.c&quot;)
-    add_files(&quot;src/unix/sunos.c&quot;)
-    add_defines(&quot;__EXTENSIONS_&quot;, &quot;_XOPEN_SOURCE=600&quot;)
-    add_headerfiles(&quot;(include/uv-sunos.h)&quot;)
+if is_plat("sunos") then
+    add_files("src/unix/no-proctitle.c")
+    add_files("src/unix/sunos.c")
+    add_defines("__EXTENSIONS_", "_XOPEN_SOURCE=600")
+    add_headerfiles("(include/uv-sunos.h)")
 end
 </code></pre>
 <p>然后,我们就可以切换这些平台来编译:</p>
@@ -290,7 +290,7 @@ $ xmake
 </code></pre>
 <p>只要设置了<code>--sdk=</code>等参数,就会启用linux平台的交叉编译模式。</p>
 <h3 id="-">常用工具链配置</h3>
-<p>!&gt; 此特性需要v2.3.4以上版本才支持</p>
+<p>!> 此特性需要v2.3.4以上版本才支持</p>
 <p>上文讲述的是通用的交叉编译工具链配置,如果一些特定的工具链需要额外传入<code>--ldflags/--includedirs</code>等场景就比较繁琐了,<br>因此xmake也内置了一些常用工具链,可以省去交叉编译工具链复杂的配置过程,只需要执行:</p>
 <pre><code class="lang-bash">$ xmake f --toolchain=gnu-rm --sdk=/xxx/
 $ xmake
@@ -328,18 +328,18 @@ fasm          Flat Assembler
 </code></pre>
 <h4 id="-">自定义工具链</h4>
 <p>另外,我们也可以在xmake.lua中自定义toolchain,然后通过<code>xmake f --toolchain=myclang</code>指定切换,例如:</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;ld&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;sh&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;ar&quot;, &quot;ar&quot;)
-    set_toolset(&quot;ex&quot;, &quot;ar&quot;)
-    set_toolset(&quot;strip&quot;, &quot;strip&quot;)
-    set_toolset(&quot;mm&quot;, &quot;clang&quot;)
-    set_toolset(&quot;mxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;as&quot;, &quot;clang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
     -- ...
 </code></pre>
@@ -385,7 +385,7 @@ $ xmake
 <p>另外,其他的工具链配置参数用法,跟上文描述的没什么区别,像<code>--cross</code>, <code>--bin=</code>等都可以根据实际的环境需要,自己控制是否需要额外追加配置来适配自己的mingw工具链。</p>
 <h4 id="llvm-">LLVM工具链</h4>
 <p>llvm工具链下载地址:<a href="https://releases.llvm.org/">https://releases.llvm.org/</a></p>
-<pre><code class="lang-bash">$ xmake f -p cross --toolchain=llvm --sdk=&quot;C:\Program Files\LLVM&quot;
+<pre><code class="lang-bash">$ xmake f -p cross --toolchain=llvm --sdk="C:\Program Files\LLVM"
 $ xmake
 </code></pre>
 <h4 id="gnu-rm-">GNU-RM工具链</h4>
@@ -576,7 +576,7 @@ $ xmake
 </tr>
 </tbody>
 </table>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果你想要了解更多参数选项,请运行: <code>xmake f --help</code>。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果你想要了解更多参数选项,请运行: <code>xmake f --help</code>。<br></p>
 
 </p>
 <h4 id="-sdk">--sdk</h4>
@@ -610,7 +610,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/home/toolchains_sdkdir --bin=/usr/opt/bin
 $ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>v2.2.1版本之前,这个参数名是<code>--toolchains</code>,比较有歧义,因此新版本中,统一改成<code>--bin=</code>来设置bin目录。<br>&lt;/p&gt;
+<p><p class="tip"><br>v2.2.1版本之前,这个参数名是<code>--toolchains</code>,比较有歧义,因此新版本中,统一改成<code>--bin=</code>来设置bin目录。<br></p>
 
 </p>
 <h4 id="-cross">--cross</h4>
@@ -634,7 +634,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --as=armv7-linux-as
 </code></pre>
 <p>如果存在<code>AS</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --as=gcc@/home/xxx/asmips.exe</code> 设置ccmips.exe编译器作为类gcc的使用方式来编译。<br>也就是说,在指定编译器为<code>asmips.exe</code>的同时,告诉xmake,它跟gcc用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --as=gcc@/home/xxx/asmips.exe</code> 设置ccmips.exe编译器作为类gcc的使用方式来编译。<br>也就是说,在指定编译器为<code>asmips.exe</code>的同时,告诉xmake,它跟gcc用法和参数选项基本相同。<br></p>
 
 </p>
 <h4 id="-cc">--cc</h4>
@@ -645,7 +645,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --cc=armv7-linux-clang
 </code></pre>
 <p>如果存在<code>CC</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --cc=gcc@/home/xxx/ccmips.exe</code> 设置ccmips.exe编译器作为类gcc的使用方式来编译。<br>也就是说,在指定编译器为<code>ccmips.exe</code>的同时,告诉xmake,它跟gcc用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --cc=gcc@/home/xxx/ccmips.exe</code> 设置ccmips.exe编译器作为类gcc的使用方式来编译。<br>也就是说,在指定编译器为<code>ccmips.exe</code>的同时,告诉xmake,它跟gcc用法和参数选项基本相同。<br></p>
 
 </p>
 <h4 id="-cxx">--cxx</h4>
@@ -656,7 +656,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --cxx=armv7-linux-clang++
 </code></pre>
 <p>如果存在<code>CXX</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --cxx=clang++@/home/xxx/c++mips.exe</code> 设置c++mips.exe编译器作为类clang++的使用方式来编译。<br>也就是说,在指定编译器为<code>c++mips.exe</code>的同时,告诉xmake,它跟clang++用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --cxx=clang++@/home/xxx/c++mips.exe</code> 设置c++mips.exe编译器作为类clang++的使用方式来编译。<br>也就是说,在指定编译器为<code>c++mips.exe</code>的同时,告诉xmake,它跟clang++用法和参数选项基本相同。<br></p>
 
 </p>
 <h4 id="-ld">--ld</h4>
@@ -667,7 +667,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --ld=armv7-linux-clang++
 </code></pre>
 <p>如果存在<code>LD</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --ld=g++@/home/xxx/c++mips.exe</code> 设置c++mips.exe链接器作为类g++的使用方式来编译。<br>也就是说,在指定链接器为<code>c++mips.exe</code>的同时,告诉xmake,它跟g++用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --ld=g++@/home/xxx/c++mips.exe</code> 设置c++mips.exe链接器作为类g++的使用方式来编译。<br>也就是说,在指定链接器为<code>c++mips.exe</code>的同时,告诉xmake,它跟g++用法和参数选项基本相同。<br></p>
 
 </p>
 <h4 id="-sh">--sh</h4>
@@ -677,7 +677,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --sh=armv7-linux-clang++
 </code></pre>
 <p>如果存在<code>SH</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --sh=g++@/home/xxx/c++mips.exe</code> 设置c++mips.exe链接器作为类g++的使用方式来编译。<br>也就是说,在指定链接器为<code>c++mips.exe</code>的同时,告诉xmake,它跟g++用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --sh=g++@/home/xxx/c++mips.exe</code> 设置c++mips.exe链接器作为类g++的使用方式来编译。<br>也就是说,在指定链接器为<code>c++mips.exe</code>的同时,告诉xmake,它跟g++用法和参数选项基本相同。<br></p>
 
 </p>
 <h4 id="-ar">--ar</h4>
@@ -687,7 +687,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --ar=armv7-linux-ar
 </code></pre>
 <p>如果存在<code>AR</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有ar等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --ar=ar@/home/xxx/armips.exe</code> 设置armips.exe链接器作为类ar的使用方式来编译。<br>也就是说,在指定链接器为<code>armips.exe</code>的同时,告诉xmake,它跟ar用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有ar等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --ar=ar@/home/xxx/armips.exe</code> 设置armips.exe链接器作为类ar的使用方式来编译。<br>也就是说,在指定链接器为<code>armips.exe</code>的同时,告诉xmake,它跟ar用法和参数选项基本相同。<br></p>
 
 </p>
 <h2 id="-">全局配置</h2>
@@ -700,7 +700,7 @@ $ xmake
 $ xmake
 </code></pre>
 <p>以后,就不需要每次重复配置<code>--ndk=</code>参数了。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    每个命令都有其简写,例如: <code>xmake g</code> 或者 <code>xmake global</code>.&lt;br&gt;<br>&lt;/p&gt;
+<p><p class="tip"><br>    每个命令都有其简写,例如: <code>xmake g</code> 或者 <code>xmake global</code>.<br><br></p>
 
 </p>
 <h2 id="-">清除配置</h2>

+ 11 - 11
mirror/zh-cn/guide/installation.html

@@ -91,24 +91,24 @@
 }
 </style>
     <h2 id="master-">Master版本</h2>
-<p>!&gt; 切记,xmake不建议在root下安装和使用,所以尽量不要在root下拉取源码编译安装!</p>
+<p>!> 切记,xmake不建议在root下安装和使用,所以尽量不要在root下拉取源码编译安装!</p>
 <h4 id="-curl">使用curl</h4>
-<pre><code class="lang-bash">bash &lt;(curl -fsSL https://xmake.io/shget.text)
+<pre><code class="lang-bash">bash <(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h4 id="-wget">使用wget</h4>
-<pre><code class="lang-bash">bash &lt;(wget https://xmake.io/shget.text -O -)
+<pre><code class="lang-bash">bash <(wget https://xmake.io/shget.text -O -)
 </code></pre>
 <h4 id="-powershell">使用powershell</h4>
 <pre><code class="lang-powershell">Invoke-Expression (Invoke-Webrequest &#39;https://xmake.io/psget.text&#39; -UseBasicParsing).Content
 </code></pre>
-<p>!&gt; 如果ps脚本执行提示失败,可以尝试在管理员模式下执行</p>
+<p>!> 如果ps脚本执行提示失败,可以尝试在管理员模式下执行</p>
 <h2 id="windows">Windows</h2>
 <h3 id="-">使用安装包</h3>
 <ol>
 <li>从 <a href="https://github.com/xmake-io/xmake/releases">Releases</a> 上下载windows安装包</li>
 <li>运行安装程序 xmake-[version].[win32|win64].exe</li>
 </ol>
-<p>!&gt; releases下面xmake-[version].[win32|win64].zip的包是不带安装程序的,可直接解压使用,绿色无依赖,不过需要自己添加PATH环境变量。</p>
+<p>!> releases下面xmake-[version].[win32|win64].zip的包是不带安装程序的,可直接解压使用,绿色无依赖,不过需要自己添加PATH环境变量。</p>
 <h3 id="-scoop">使用scoop</h3>
 <pre><code class="lang-bash">scoop install xmake
 </code></pre>
@@ -121,7 +121,7 @@
 <pre><code class="lang-bash">pacman -Sy mingw-w64-i686-xmake
 </code></pre>
 <h2 id="macos">MacOS</h2>
-<pre><code class="lang-bash">ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;
+<pre><code class="lang-bash">ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 brew install xmake
 </code></pre>
 <p>或者:</p>
@@ -134,7 +134,7 @@ brew install xmake
 brew install xmake --HEAD
 
 # 或者直接调用shell下载安装
-bash &lt;(curl -fsSL https://xmake.io/shget.text)
+bash <(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h2 id="linux">Linux</h2>
 <p>在archlinux上安装:</p>
@@ -152,7 +152,7 @@ bash &lt;(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h2 id="-">源码编译安装</h2>
 <h3 id="-">安装</h3>
-<p>!&gt; 切记,xmake不建议在root下安装和使用,所以尽量不要在root下拉取源码编译安装!</p>
+<p>!> 切记,xmake不建议在root下安装和使用,所以尽量不要在root下拉取源码编译安装!</p>
 <pre><code class="lang-bash">git clone --recursive https://github.com/xmake-io/xmake.git
 cd ./xmake
 make build
@@ -160,7 +160,7 @@ make build
 source ~/.xmake/profile
 </code></pre>
 <p>如果觉得github的源太慢,可以通过gitee的镜像源拉取:<code>clone --recursive https://gitee.com/tboox/xmake.git</code></p>
-<p>!&gt; 由于目前xmake源码通过git submodule维护依赖,所以clone的时候需要加上<code>--recursive</code>参数同时拉取所有submodules代码,请不要直接下载tar.gz源码,因为github不会自动打包submodules里面的代码。</p>
+<p>!> 由于目前xmake源码通过git submodule维护依赖,所以clone的时候需要加上<code>--recursive</code>参数同时拉取所有submodules代码,请不要直接下载tar.gz源码,因为github不会自动打包submodules里面的代码。</p>
 <p>如果git clone的时候忘记加<code>--recursive</code>,那么也可以执行<code>git submodule update --init</code>来拉取所有submodules,例如:</p>
 <pre><code class="lang-bash">git clone https://github.com/xmake-io/xmake.git
 cd ./xmake
@@ -168,7 +168,7 @@ git submodule update --init
 make build
 ./scripts/get.sh __local__ __install_only__
 </code></pre>
-<p>!&gt; <code>./get.sh __local__</code>是安装到<code>~/.local/xmake</code>下,然后通过<code>source ~/.xmake/profile</code>方式来加载的,所以安装完,当前终端如果执行xmake失败,提示找不到,就手动执行下 <code>source ~/.xmake/profile</code>,而下次打开终端就不需要了。</p>
+<p>!> <code>./get.sh __local__</code>是安装到<code>~/.local/xmake</code>下,然后通过<code>source ~/.xmake/profile</code>方式来加载的,所以安装完,当前终端如果执行xmake失败,提示找不到,就手动执行下 <code>source ~/.xmake/profile</code>,而下次打开终端就不需要了。</p>
 <h3 id="-">卸载</h3>
 <pre><code class="lang-bash">./scripts/get.sh __uninstall__
 </code></pre>
@@ -184,7 +184,7 @@ make build
 <li>如果想要提速编译,可以装下ccache,xmake会自动检测并使用,这也是可选的。</li>
 </ol>
 <h2 id="-">其他安装方式</h2>
-<p>!&gt; 这种也是源码编译安装,但是安装路径会直接写入<code>/usr/</code>下,需要root权限,因此除非特殊情况,不推荐这种安装方式,建议采用上文提供的<code>./get.sh __local__</code>方式来安装,这两种安装方式的安装路径是不同的,不要混用。</p>
+<p>!> 这种也是源码编译安装,但是安装路径会直接写入<code>/usr/</code>下,需要root权限,因此除非特殊情况,不推荐这种安装方式,建议采用上文提供的<code>./get.sh __local__</code>方式来安装,这两种安装方式的安装路径是不同的,不要混用。</p>
 <p>通过make进行编译安装:</p>
 <pre><code class="lang-bash">make build; sudo make install
 </code></pre>

+ 86 - 86
mirror/zh-cn/guide/other_features.html

@@ -147,12 +147,12 @@ $ xmake
 <h3 id="-">实现快速交叉编译</h3>
 <p>众所周知,autotools维护的项目虽然很多都支持交叉编译,但是交叉编译的配置过程很复杂,不同的工具链处理方式还有很多的差异,中途会踩到很多的坑。</p>
 <p>即使跑通了一个工具链的交叉编译,如果切到另外一个工具链环境,可能又要折腾好久,而如果使用xmake,通常只需要两条简单的命令即可:</p>
-<p>!&gt; 目前就autotools对接支持了xmake的交叉编译,后期还会对cmake等其他构建系统加上支持。</p>
+<p>!> 目前就autotools对接支持了xmake的交叉编译,后期还会对cmake等其他构建系统加上支持。</p>
 <h4 id="-android-">交叉编译android平台</h4>
 <pre><code class="lang-bash">$ xmake f -p android --trybuild=autotools [--ndk=xxx]
 $ xmake
 </code></pre>
-<p>!&gt; 其中,--ndk参数配置是可选的,如果用户设置了ANDROID_NDK_HOME环境变量,或者ndk放置在~/Library/Android/sdk/ndk-bundle,xmake都能自动检测到。</p>
+<p>!> 其中,--ndk参数配置是可选的,如果用户设置了ANDROID_NDK_HOME环境变量,或者ndk放置在~/Library/Android/sdk/ndk-bundle,xmake都能自动检测到。</p>
 <p>是不是很简单?如果你觉得这没啥,那么可以对比下直接操作<code>./configure</code>去配置交叉编译,可以看下这篇文档对比下:<a href="https://developer.android.com/ndk/guides/other_build_systems#autoconf">将NDK 与其他编译系统配合使用</a></p>
 <p>说白了,你大概得这样,还不一定一次就能搞定:</p>
 <pre><code class="lang-bash">$ export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG
@@ -181,7 +181,7 @@ $ xmake
 <p>关于更多交叉编译的配置细节,请参考文档:<a href="https://xmake.io/#/zh-cn/guide/configuration?id=%e4%ba%a4%e5%8f%89%e7%bc%96%e8%af%91">交叉编译</a>,除了多了一个<code>--trybuild=</code>参数,其他交叉编译配置参数都是完全通用的。</p>
 <h3 id="-">传递用户配置参数</h3>
 <p>我们可以通过<code>--tryconfigs=</code>来传递用户额外的配置参数到对应的第三方构建系统,比如:autotools会传递给<code>./configure</code>,cmake会传递给<code>cmake</code>命令。</p>
-<pre><code class="lang-bash">$ xmake f --trybuild=autotools --tryconfigs=&quot;--enable-shared=no&quot;
+<pre><code class="lang-bash">$ xmake f --trybuild=autotools --tryconfigs="--enable-shared=no"
 $ xmake
 </code></pre>
 <p>比如上述命令,传递<code>--enable-shared=no</code>给<code>./configure</code>,来禁用动态库编译。</p>
@@ -192,7 +192,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f --trybuild=[autotools|cmake|meson|ninja|bazel|make|msbuild|xcodebuild]
 $ xmake
 </code></pre>
-<p>!&gt; 我们还需要确保--trybuild指定的构建工具已经安装能够正常使用。</p>
+<p>!> 我们还需要确保--trybuild指定的构建工具已经安装能够正常使用。</p>
 <h4 id="-android-jni-">构建Android jni程序</h4>
 <p>如果当前项目下存在<code>jni/Android.mk</code>,那么xmake可以直接调用ndk-build来构建jni库。</p>
 <pre><code class="lang-bash">$ xmake f -p android --trybuild=ndkbuild [--ndk=]
@@ -267,29 +267,29 @@ checking for the debugger (dd) ... xcrun -sdk macosx lldb
 checking for the golang compiler (go) ... go
 configure
 {
-    ex = &quot;xcrun -sdk macosx ar&quot;
-,   sh = &quot;xcrun -sdk macosx clang++&quot;
-,   host = &quot;macosx&quot;
-,   ar = &quot;xcrun -sdk macosx ar&quot;
-,   buildir = &quot;build&quot;
-,   as = &quot;xcrun -sdk macosx clang&quot;
-,   plat = &quot;macosx&quot;
-,   xcode_dir = &quot;/Applications/Xcode.app&quot;
-,   arch = &quot;x86_64&quot;
-,   mxx = &quot;xcrun -sdk macosx clang++&quot;
-,   go = &quot;go&quot;
-,   target_minver = &quot;10.12&quot;
-,   ccache = &quot;ccache&quot;
-,   mode = &quot;release&quot;
+    ex = "xcrun -sdk macosx ar"
+,   sh = "xcrun -sdk macosx clang++"
+,   host = "macosx"
+,   ar = "xcrun -sdk macosx ar"
+,   buildir = "build"
+,   as = "xcrun -sdk macosx clang"
+,   plat = "macosx"
+,   xcode_dir = "/Applications/Xcode.app"
+,   arch = "x86_64"
+,   mxx = "xcrun -sdk macosx clang++"
+,   go = "go"
+,   target_minver = "10.12"
+,   ccache = "ccache"
+,   mode = "release"
 ,   clean = true
-,   cxx = &quot;xcrun -sdk macosx clang&quot;
-,   cc = &quot;xcrun -sdk macosx clang&quot;
-,   dd = &quot;xcrun -sdk macosx lldb&quot;
-,   kind = &quot;static&quot;
-,   ld = &quot;xcrun -sdk macosx clang++&quot;
-,   xcode_sdkver = &quot;10.12&quot;
-,   sc = &quot;xcrun -sdk macosx swiftc&quot;
-,   mm = &quot;xcrun -sdk macosx clang&quot;
+,   cxx = "xcrun -sdk macosx clang"
+,   cc = "xcrun -sdk macosx clang"
+,   dd = "xcrun -sdk macosx lldb"
+,   kind = "static"
+,   ld = "xcrun -sdk macosx clang++"
+,   xcode_sdkver = "10.12"
+,   sc = "xcrun -sdk macosx swiftc"
+,   mm = "xcrun -sdk macosx clang"
 }
 configure ok!
 clean ok!
@@ -314,27 +314,27 @@ build ok!👌
 <p>连xmake.lua都没有编写,其实xmake在扫描完成后,会去自动在当前目录下生成一份xmake.lua,下次编译就不需要重新扫描检测了。</p>
 <p>自动生成的xmake.lua内容如下:</p>
 <pre><code class="lang-lua">-- define target
-target(&quot;zlib-1.2&quot;)
+target("zlib-1.2")
 
     -- set kind
-    set_kind(&quot;static&quot;)
+    set_kind("static")
 
     -- add files
-    add_files(&quot;./adler32.c&quot;)
-    add_files(&quot;./compress.c&quot;)
-    add_files(&quot;./crc32.c&quot;)
-    add_files(&quot;./deflate.c&quot;)
-    add_files(&quot;./gzclose.c&quot;)
-    add_files(&quot;./gzlib.c&quot;)
-    add_files(&quot;./gzread.c&quot;)
-    add_files(&quot;./gzwrite.c&quot;)
-    add_files(&quot;./infback.c&quot;)
-    add_files(&quot;./inffast.c&quot;)
-    add_files(&quot;./inflate.c&quot;)
-    add_files(&quot;./inftrees.c&quot;)
-    add_files(&quot;./trees.c&quot;)
-    add_files(&quot;./uncompr.c&quot;)
-    add_files(&quot;./zutil.c&quot;)
+    add_files("./adler32.c")
+    add_files("./compress.c")
+    add_files("./crc32.c")
+    add_files("./deflate.c")
+    add_files("./gzclose.c")
+    add_files("./gzlib.c")
+    add_files("./gzread.c")
+    add_files("./gzwrite.c")
+    add_files("./infback.c")
+    add_files("./inffast.c")
+    add_files("./inflate.c")
+    add_files("./inftrees.c")
+    add_files("./trees.c")
+    add_files("./uncompr.c")
+    add_files("./zutil.c")
 </code></pre>
 <p>也许你会说,像这种开源库,直接<code>configure; make</code>不就好了吗,他们自己也有提供makefile来直接编译的,的确是这样,我这里只是举个例子而已。。</p>
 <p>当然,很多开源库在交叉编译的时候,通过自带的<code>configure</code>,处理起来还是很繁琐的,用xmake进行交叉编译会更方便些。。</p>
@@ -395,27 +395,27 @@ checking for the shared library linker (sh) ... xcrun -sdk iphoneos clang++
 checking for the swift compiler (sc) ... xcrun -sdk iphoneos swiftc
 configure
 {
-    ex = &quot;xcrun -sdk iphoneos ar&quot;
-,   ccache = &quot;ccache&quot;
-,   host = &quot;macosx&quot;
-,   ar = &quot;xcrun -sdk iphoneos ar&quot;
-,   buildir = &quot;build&quot;
-,   as = &quot;/usr/local/share/xmake/tools/utils/gas-preprocessor.pl xcrun -sdk iphoneos clang&quot;
-,   arch = &quot;armv7&quot;
-,   mxx = &quot;xcrun -sdk iphoneos clang++&quot;
-,   cxx = &quot;xcrun -sdk iphoneos clang&quot;
-,   target_minver = &quot;10.1&quot;
-,   xcode_dir = &quot;/Applications/Xcode.app&quot;
+    ex = "xcrun -sdk iphoneos ar"
+,   ccache = "ccache"
+,   host = "macosx"
+,   ar = "xcrun -sdk iphoneos ar"
+,   buildir = "build"
+,   as = "/usr/local/share/xmake/tools/utils/gas-preprocessor.pl xcrun -sdk iphoneos clang"
+,   arch = "armv7"
+,   mxx = "xcrun -sdk iphoneos clang++"
+,   cxx = "xcrun -sdk iphoneos clang"
+,   target_minver = "10.1"
+,   xcode_dir = "/Applications/Xcode.app"
 ,   clean = true
-,   sh = &quot;xcrun -sdk iphoneos clang++&quot;
-,   cc = &quot;xcrun -sdk iphoneos clang&quot;
-,   ld = &quot;xcrun -sdk iphoneos clang++&quot;
-,   mode = &quot;release&quot;
-,   kind = &quot;static&quot;
-,   plat = &quot;iphoneos&quot;
-,   xcode_sdkver = &quot;10.1&quot;
-,   sc = &quot;xcrun -sdk iphoneos swiftc&quot;
-,   mm = &quot;xcrun -sdk iphoneos clang&quot;
+,   sh = "xcrun -sdk iphoneos clang++"
+,   cc = "xcrun -sdk iphoneos clang"
+,   ld = "xcrun -sdk iphoneos clang++"
+,   mode = "release"
+,   kind = "static"
+,   plat = "iphoneos"
+,   xcode_sdkver = "10.1"
+,   sc = "xcrun -sdk iphoneos swiftc"
+,   mm = "xcrun -sdk iphoneos clang"
 }
 configure ok!
 clean ok!
@@ -530,29 +530,29 @@ checking for the debugger (dd) ... xcrun -sdk macosx lldb
 checking for the golang compiler (go) ... go
 configure
 {
-    ex = &quot;xcrun -sdk macosx ar&quot;
-,   sh = &quot;xcrun -sdk macosx clang++&quot;
-,   host = &quot;macosx&quot;
-,   ar = &quot;xcrun -sdk macosx ar&quot;
-,   buildir = &quot;build&quot;
-,   as = &quot;xcrun -sdk macosx clang&quot;
-,   plat = &quot;macosx&quot;
-,   xcode_dir = &quot;/Applications/Xcode.app&quot;
-,   arch = &quot;x86_64&quot;
-,   mxx = &quot;xcrun -sdk macosx clang++&quot;
-,   go = &quot;go&quot;
-,   target_minver = &quot;10.12&quot;
-,   ccache = &quot;ccache&quot;
-,   mode = &quot;release&quot;
+    ex = "xcrun -sdk macosx ar"
+,   sh = "xcrun -sdk macosx clang++"
+,   host = "macosx"
+,   ar = "xcrun -sdk macosx ar"
+,   buildir = "build"
+,   as = "xcrun -sdk macosx clang"
+,   plat = "macosx"
+,   xcode_dir = "/Applications/Xcode.app"
+,   arch = "x86_64"
+,   mxx = "xcrun -sdk macosx clang++"
+,   go = "go"
+,   target_minver = "10.12"
+,   ccache = "ccache"
+,   mode = "release"
 ,   clean = true
-,   cxx = &quot;xcrun -sdk macosx clang&quot;
-,   cc = &quot;xcrun -sdk macosx clang&quot;
-,   dd = &quot;xcrun -sdk macosx lldb&quot;
-,   kind = &quot;static&quot;
-,   ld = &quot;xcrun -sdk macosx clang++&quot;
-,   xcode_sdkver = &quot;10.12&quot;
-,   sc = &quot;xcrun -sdk macosx swiftc&quot;
-,   mm = &quot;xcrun -sdk macosx clang&quot;
+,   cxx = "xcrun -sdk macosx clang"
+,   cc = "xcrun -sdk macosx clang"
+,   dd = "xcrun -sdk macosx lldb"
+,   kind = "static"
+,   ld = "xcrun -sdk macosx clang++"
+,   xcode_sdkver = "10.12"
+,   sc = "xcrun -sdk macosx swiftc"
+,   mm = "xcrun -sdk macosx clang"
 }
 configure ok!
 clean ok!
@@ -660,7 +660,7 @@ target(wrjpgcom): binary
 <li>需要多级目录支持的源码库</li>
 </ol>
 <p>以上这些情况,xmake暂时还没发自动化的智能处理,其中限制1,2还是可以解决的,通过半手动的方式,例如:</p>
-<pre><code class="lang-bash">$ xmake f --cxflags=&quot;&quot; --ldflags=&quot;&quot; --includedirs=&quot;&quot; --linkdirs=&quot;&quot;; xmake
+<pre><code class="lang-bash">$ xmake f --cxflags="" --ldflags="" --includedirs="" --linkdirs=""; xmake
 </code></pre>
 <p>在自动检测编译的时候,手动配置这个源码工程需要的特殊编译选项,就可以直接通过编译了</p>
 <p>而限制3,暂时只能通过删源代码来解决了,就像刚才编译jpeg的代码,其实它的目录下面同时存在了:</p>

+ 186 - 186
mirror/zh-cn/guide/project_examples.html

@@ -95,36 +95,36 @@
 <pre><code class="lang-bash">xmake create --help
 </code></pre>
 <h2 id="-">可执行程序</h2>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*c")
 </code></pre>
 <p>完整例子请执行下面的命令来创建:</p>
 <pre><code class="lang-bash">xmake create -l c -t console test
 </code></pre>
 <h2 id="-">静态库程序</h2>
-<pre><code class="lang-lua">target(&quot;library&quot;)
-    set_kind(&quot;static&quot;)
-    add_files(&quot;src/library/*.c&quot;)
+<pre><code class="lang-lua">target("library")
+    set_kind("static")
+    add_files("src/library/*.c")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
-    add_deps(&quot;library&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*c")
+    add_deps("library")
 </code></pre>
 <p>通过<code>add_deps</code>将一个静态库自动链接到test可执行程序。</p>
 <p>完整例子请执行下面的命令来创建:</p>
 <pre><code class="lang-bash">xmake create -l c -t static test
 </code></pre>
 <h2 id="-">动态库程序</h2>
-<pre><code class="lang-lua">target(&quot;library&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;src/library/*.c&quot;)
+<pre><code class="lang-lua">target("library")
+    set_kind("shared")
+    add_files("src/library/*.c")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
-    add_deps(&quot;library&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*c")
+    add_deps("library")
 </code></pre>
 <p>通过<code>add_deps</code>将一个动态库自动链接到test可执行程序。</p>
 <p>完整例子请执行下面的命令来创建:</p>
@@ -155,37 +155,37 @@ $ xmake create -l c++ -t quickapp_qt test
 <p>上述指定的mingw sdk用的是Qt下Tools目录自带的环境,当然如果有其他第三方mingw编译环境,也可以手动指定, 具体可以参考:<a href="#mingw">mingw编译配置</a>。</p>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/160">#160</a></p>
 <h3 id="-">静态库程序</h3>
-<pre><code class="lang-lua">target(&quot;qt_static_library&quot;)
-    add_rules(&quot;qt.static&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("qt_static_library")
+    add_rules("qt.static")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h3 id="-">动态库程序</h3>
-<pre><code class="lang-lua">target(&quot;qt_shared_library&quot;)
-    add_rules(&quot;qt.shared&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("qt_shared_library")
+    add_rules("qt.shared")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h3 id="-">控制台程序</h3>
-<pre><code class="lang-lua">target(&quot;qt_console&quot;)
-    add_rules(&quot;qt.console&quot;)
-    add_files(&quot;src/*.cpp&quot;)
+<pre><code class="lang-lua">target("qt_console")
+    add_rules("qt.console")
+    add_files("src/*.cpp")
 </code></pre>
 <h3 id="quick-">Quick应用程序</h3>
 <p>v2.2.9以上版本:</p>
-<pre><code class="lang-lua">target(&quot;qt_quickapp&quot;)
-    add_rules(&quot;qt.quickapp&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/qml.qrc&quot;)
-</code></pre>
-<p>!&gt; 新版本提供了<code>qt.quickapp</code>规则,内置了QtQuick的内建规则,使用更加简单,下面老版本的<code>qt.application</code>还是支持的,向下兼容:</p>
-<pre><code class="lang-lua">target(&quot;qt_quickapp&quot;)
-    add_rules(&quot;qt.application&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/qml.qrc&quot;)
-    add_frameworks(&quot;QtQuick&quot;)
-</code></pre>
-<p>!&gt; 如果使用的自己编译的static版本QT SDK,那么需要切换到<code>add_rules(&quot;qt.quickapp_static&quot;)</code>静态规则才行,因为链接的库是不同的,需要做静态链接。</p>
+<pre><code class="lang-lua">target("qt_quickapp")
+    add_rules("qt.quickapp")
+    add_files("src/*.cpp") 
+    add_files("src/qml.qrc")
+</code></pre>
+<p>!> 新版本提供了<code>qt.quickapp</code>规则,内置了QtQuick的内建规则,使用更加简单,下面老版本的<code>qt.application</code>还是支持的,向下兼容:</p>
+<pre><code class="lang-lua">target("qt_quickapp")
+    add_rules("qt.application")
+    add_files("src/*.cpp") 
+    add_files("src/qml.qrc")
+    add_frameworks("QtQuick")
+</code></pre>
+<p>!> 如果使用的自己编译的static版本QT SDK,那么需要切换到<code>add_rules("qt.quickapp_static")</code>静态规则才行,因为链接的库是不同的,需要做静态链接。</p>
 <p>接下来,我们尝试编译下,通常,如果是使用Qt的安装包默认安装,也没有修改安装路径,那么大部分情况下都是可以自动检测到QT SDK的根路径,例如:</p>
 <pre><code class="lang-bash">$ xmake
 checking for the architecture ... x86_64
@@ -205,21 +205,21 @@ build ok!
 <p><img src="/assets/img/guide/qt_quickapp.png" alt=""></p>
 <h3 id="widgets-">Widgets应用程序</h3>
 <p>v2.2.9以上版本:</p>
-<pre><code class="lang-lua">target(&quot;qt_widgetapp&quot;)
-    add_rules(&quot;qt.widgetapp&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;)  -- 添加带有 Q_OBJECT 的meta头文件
-</code></pre>
-<p>!&gt; 新版本提供了<code>qt.widgetapp</code>规则,内置了QtWidgets的内建规则,使用更加简单,下面老版本的<code>qt.application</code>还是支持的,向下兼容:</p>
-<pre><code class="lang-lua">target(&quot;qt_widgetapp&quot;)
-    add_rules(&quot;qt.application&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;)  -- 添加带有 Q_OBJECT 的meta头文件
-    add_frameworks(&quot;QtWidgets&quot;)
-</code></pre>
-<p>!&gt; 如果使用的自己编译的static版本QT SDK,那么需要切换到<code>add_rules(&quot;qt.widgetapp_static&quot;)</code>静态规则才行,因为链接的库是不同的,需要做静态链接。</p>
+<pre><code class="lang-lua">target("qt_widgetapp")
+    add_rules("qt.widgetapp")
+    add_files("src/*.cpp") 
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
+</code></pre>
+<p>!> 新版本提供了<code>qt.widgetapp</code>规则,内置了QtWidgets的内建规则,使用更加简单,下面老版本的<code>qt.application</code>还是支持的,向下兼容:</p>
+<pre><code class="lang-lua">target("qt_widgetapp")
+    add_rules("qt.application")
+    add_files("src/*.cpp") 
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
+    add_frameworks("QtWidgets")
+</code></pre>
+<p>!> 如果使用的自己编译的static版本QT SDK,那么需要切换到<code>add_rules("qt.widgetapp_static")</code>静态规则才行,因为链接的库是不同的,需要做静态链接。</p>
 <p>运行效果如下:</p>
 <p><img src="/assets/img/guide/qt_widgetapp.png" alt=""></p>
 <h3 id="android-">Android应用程序</h3>
@@ -247,15 +247,15 @@ $ cd test
 $ xmake
 </code></pre>
 <pre><code class="lang-lua">-- define target
-target(&quot;cuda_console&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.cu&quot;)
+target("cuda_console")
+    set_kind("binary")
+    add_files("src/*.cu")
     -- generate SASS code for SM architecture of current host
-    add_cugencodes(&quot;native&quot;)
+    add_cugencodes("native")
     -- generate PTX code for the virtual architecture to guarantee compatibility
-    add_cugencodes(&quot;compute_30&quot;)
+    add_cugencodes("compute_30")
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>从v2.2.7版本开始,默认构建会启用device-link。(参见 <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>如果要显示禁用device-link,可以通过<code>add_values(&quot;cuda.devlink&quot;, false)</code> 来设置。<br>&lt;/p&gt;
+<p><p class="tip"><br>从v2.2.7版本开始,默认构建会启用device-link。(参见 <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>如果要显示禁用device-link,可以通过<code>add_values("cuda.devlink", false)</code> 来设置。<br></p>
 
 </p>
 <p>默认会自动探测cuda环境,当然也可以指定Cuda SDK环境目录:</p>
@@ -265,50 +265,50 @@ $ xmake
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/158">#158</a></p>
 <h2 id="wdk-">WDK驱动程序</h2>
 <p>默认会自动探测wdk所在环境,当然也可以指定wdk sdk环境目录:</p>
-<pre><code class="lang-console">$ xmake f --wdk=&quot;G:\Program Files\Windows Kits\10&quot; -c 
+<pre><code class="lang-console">$ xmake f --wdk="G:\Program Files\Windows Kits\10" -c 
 $ xmake
 </code></pre>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/159">#159</a></p>
 <p>相关完整工程example见:<a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/wdk">WDK examples</a></p>
 <h3 id="umdf-">umdf驱动程序</h3>
-<pre><code class="lang-lua">target(&quot;echo&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;driver/*.c&quot;) 
-    add_files(&quot;driver/*.inx&quot;)
-    add_includedirs(&quot;exe&quot;)
+<pre><code class="lang-lua">target("echo")
+    add_rules("wdk.driver", "wdk.env.umdf")
+    add_files("driver/*.c") 
+    add_files("driver/*.inx")
+    add_includedirs("exe")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;exe/*.cpp&quot;) 
+target("app")
+    add_rules("wdk.binary", "wdk.env.umdf")
+    add_files("exe/*.cpp") 
 </code></pre>
 <h3 id="kmdf-">kmdf驱动程序</h3>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.kmdf&quot;)
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;driver/*.rc&quot;)
+<pre><code class="lang-lua">target("nonpnp")
+    add_rules("wdk.driver", "wdk.env.kmdf")
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
+    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.rc")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.kmdf&quot;)
-    add_files(&quot;exe/*.c&quot;) 
-    add_files(&quot;exe/*.inf&quot;)
+target("app")
+    add_rules("wdk.binary", "wdk.env.kmdf")
+    add_files("exe/*.c") 
+    add_files("exe/*.inf")
 </code></pre>
 <h3 id="wdm-">wdm驱动程序</h3>
-<pre><code class="lang-lua">target(&quot;kcs&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    add_values(&quot;wdk.man.flags&quot;, &quot;-prefix Kcs&quot;)
-    add_values(&quot;wdk.man.resource&quot;, &quot;kcsCounters.rc&quot;)
-    add_values(&quot;wdk.man.header&quot;, &quot;kcsCounters.h&quot;)
-    add_values(&quot;wdk.man.counter_header&quot;, &quot;kcsCounters_counters.h&quot;)
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;, &quot;*.man&quot;) 
-</code></pre>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TracePrint((LEVEL,FLAGS,MSG,...))&quot;)
-    add_files(&quot;*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;*.rc&quot;, &quot;*.inf&quot;)
-    add_files(&quot;*.mof|msdsm.mof&quot;)
-    add_files(&quot;msdsm.mof&quot;, {values = {wdk_mof_header = &quot;msdsmwmi.h&quot;}}) 
+<pre><code class="lang-lua">target("kcs")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    add_values("wdk.man.flags", "-prefix Kcs")
+    add_values("wdk.man.resource", "kcsCounters.rc")
+    add_values("wdk.man.header", "kcsCounters.h")
+    add_values("wdk.man.counter_header", "kcsCounters_counters.h")
+    add_files("*.c", "*.rc", "*.man") 
+</code></pre>
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
+    add_files("*.c", {rule = "wdk.tracewpp"}) 
+    add_files("*.rc", "*.inf")
+    add_files("*.mof|msdsm.mof")
+    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}}) 
 </code></pre>
 <h3 id="-">生成驱动包</h3>
 <p>可以通过以下命令生成.cab驱动包:</p>
@@ -323,87 +323,87 @@ $ xmake [p|package] -o outputdir
        - debug/x86/sampledsm.cab
        - release/x64/sampledsm.cab
 </code></pre><h3 id="-">驱动签名</h3>
-<p>默认编译禁用签名,可以通过<code>set_values(&quot;wdk.sign.mode&quot;, ...)</code>设置签名模式来启用签名。</p>
+<p>默认编译禁用签名,可以通过<code>set_values("wdk.sign.mode", ...)</code>设置签名模式来启用签名。</p>
 <h4 id="-">测试签名</h4>
 <p>测试签名一般本机调试时候用,可以使用xmake自带的test证书来进行签名,例如:</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
 </code></pre>
 <p>不过这种情况下,需要用户手动在管理员模式下,执行一遍:<code>$xmake l utils.wdk.testcert install</code>,来生成和注册test证书到本机环境。<br>这个只需要执行一次就行了,后续就可以正常编译和签名了。</p>
 <p>当然也可以使用本机已有的有效证书去签名。</p>
 <p>从sha1来选择合适的证书进行签名:</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
-    set_values(&quot;wdk.sign.thumbprint&quot;, &quot;032122545DCAA6167B1ADBE5F7FDF07AE2234AAA&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
+    set_values("wdk.sign.thumbprint", "032122545DCAA6167B1ADBE5F7FDF07AE2234AAA")
 </code></pre>
 <p>从store/company来选择合适的证书进行签名:</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
-    set_values(&quot;wdk.sign.store&quot;, &quot;PrivateCertStore&quot;)
-    set_values(&quot;wdk.sign.company&quot;, &quot;tboox.org(test)&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
+    set_values("wdk.sign.store", "PrivateCertStore")
+    set_values("wdk.sign.company", "tboox.org(test)")
 </code></pre>
 <h4 id="-">正式签名</h4>
 <p>通过指定对应的正式签名证书文件进行签名:</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;release&quot;)
-    set_values(&quot;wdk.sign.company&quot;, &quot;xxxx&quot;)
-    set_values(&quot;wdk.sign.certfile&quot;, path.join(os.projectdir(), &quot;xxxx.cer&quot;))
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "release")
+    set_values("wdk.sign.company", "xxxx")
+    set_values("wdk.sign.certfile", path.join(os.projectdir(), "xxxx.cer"))
 </code></pre>
 <h3 id="-">生成低版本驱动</h3>
 <p>如果想在wdk10环境编译生成win7, win8等低版本系统支持的驱动,可以通过设置<code>wdk.env.winver</code>来切换系统版本:</p>
-<pre><code class="lang-lua">set_values(&quot;wdk.env.winver&quot;, &quot;win10&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win10_rs3&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win81&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win8&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp1&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp2&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp3&quot;)
+<pre><code class="lang-lua">set_values("wdk.env.winver", "win10")
+set_values("wdk.env.winver", "win10_rs3")
+set_values("wdk.env.winver", "win81")
+set_values("wdk.env.winver", "win8")
+set_values("wdk.env.winver", "win7")
+set_values("wdk.env.winver", "win7_sp1")
+set_values("wdk.env.winver", "win7_sp2")
+set_values("wdk.env.winver", "win7_sp3")
 </code></pre>
 <p>我们也可以手动指定编译的目标程序支持的windows版本:</p>
 <pre><code class="lang-console">$ xmake f --wdk_winver=[win10_rs3|win8|win7|win7_sp1]
 $ xmake
 </code></pre>
 <h2 id="winsdk-">WinSDK程序</h2>
-<pre><code class="lang-lua">target(&quot;usbview&quot;)
-    add_rules(&quot;win.sdk.application&quot;)
+<pre><code class="lang-lua">target("usbview")
+    add_rules("win.sdk.application")
 
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;)
-    add_files(&quot;xmlhelper.cpp&quot;, {rule = &quot;win.sdk.dotnet&quot;})
+    add_files("*.c", "*.rc")
+    add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
 </code></pre>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/173">#173</a></p>
 <h2 id="mfc-">MFC程序</h2>
 <h3 id="mfc-">MFC静态库</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;win.sdk.mfc.static&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("win.sdk.mfc.static")
+    add_files("src/*.c")
 </code></pre>
 <h3 id="mfc-">MFC动态库</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;win.sdk.mfc.shared&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("win.sdk.mfc.shared")
+    add_files("src/*.c")
 </code></pre>
 <h3 id="mfc-">MFC应用程序(静态链接)</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;win.sdk.mfc.static_app&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("win.sdk.mfc.static_app")
+    add_files("src/*.c")
 </code></pre>
 <h3 id="mfc-">MFC应用程序(动态链接)</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;win.sdk.mfc.shared_app&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("win.sdk.mfc.shared_app")
+    add_files("src/*.c")
 </code></pre>
 <h2 id="ios-macos-">iOS/MacOS程序</h2>
 <h3 id="app-">App应用程序</h3>
 <p>用于生成<em>.app/</em>.ipa应用程序,同时支持iOS/MacOS。</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.application&quot;)
-    add_files(&quot;src/*.m&quot;, &quot;src/**.storyboard&quot;, &quot;src/*.xcassets&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.application")
+    add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
+    add_files("src/Info.plist")
 </code></pre>
 <h4 id="-">创建工程</h4>
 <p>我们也可以通过模板工程快速创建:</p>
@@ -431,32 +431,32 @@ $ xmake
 $ xmake
 </code></pre>
 <p>如果每次这么配置签名觉得繁琐的话,可以设置到<code>xmake global</code>全局配置中,也可以在xmake.lua中对每个target单独设置:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.application&quot;)
-    add_files(&quot;src/*.m&quot;, &quot;src/**.storyboard&quot;, &quot;src/*.xcassets&quot;)
-    add_files(&quot;src/Info.plist&quot;)
-    add_values(&quot;xcode.bundle_identifier&quot;, &quot;org.tboox.test&quot;)
-    add_values(&quot;xcode.codesign_identity&quot;, &quot;Apple Development: [email protected] (T3NA4MRVPU)&quot;)
-    add_values(&quot;xcode.mobile_provision&quot;, &quot;iOS Team Provisioning Profile: org.tboox.test&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.application")
+    add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
+    add_files("src/Info.plist")
+    add_values("xcode.bundle_identifier", "org.tboox.test")
+    add_values("xcode.codesign_identity", "Apple Development: [email protected] (T3NA4MRVPU)")
+    add_values("xcode.mobile_provision", "iOS Team Provisioning Profile: org.tboox.test")
 </code></pre>
 <p>那如何知道我们需要的签名配置呢?一种就是在xcode里面查看,另外xmake也提供了一些辅助工具可以dump出当前可用的所有签名配置:</p>
 <pre><code class="lang-console">$ xmake l private.tools.codesign.dump
 ==================================== codesign identities ====================================
 { 
-  &quot;Apple Development: [email protected] (T3NA4MRVPU)&quot; = &quot;AF73C231A0C35335B72761BD3759694739D34EB1&quot; 
+  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1" 
 }
 
 ===================================== mobile provisions =====================================
 { 
-  &quot;iOS Team Provisioning Profile: org.tboox.test&quot; = &quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
-&lt;plist version=&quot;1.0&quot;&gt;
-&lt;dict&gt;
-    &lt;key&gt;AppIDName&lt;/key&gt;
-    &lt;string&gt;XC org tboox test5&lt;/string&gt;
-    &lt;key&gt;ApplicationIdentifierPrefix&lt;/key&gt;
-    &lt;array&gt;
-    &lt;string&gt;43AAQM58X3&lt;/string&gt;
+  "iOS Team Provisioning Profile: org.tboox.test" = "<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>AppIDName</key>
+    <string>XC org tboox test5</string>
+    <key>ApplicationIdentifierPrefix</key>
+    <array>
+    <string>43AAQM58X3</string>
 ...
 </code></pre>
 <p>我们也提供了其他辅助工具来对已有的ipa/app程序进行重签名,例如:</p>
@@ -464,8 +464,8 @@ $ xmake
 </code></pre>
 <p>其中,后面的签名参数都是可选的,如果没设置,那么默认会探测使用一个有效的签名:</p>
 <pre><code class="lang-console">$ xmake l utils.ipa.resign test.ipa
-$ xmake l utils.ipa.resign test.app &quot;Apple Development: [email protected] (T3NA4MRVPU)&quot;
-$ xmake l utils.ipa.resign test.ipa &quot;Apple Development: [email protected] (T3NA4MRVPU)&quot; iOS Team Provisioning Profile: org.tboox.test&quot; org.tboox.test
+$ xmake l utils.ipa.resign test.app "Apple Development: [email protected] (T3NA4MRVPU)"
+$ xmake l utils.ipa.resign test.ipa "Apple Development: [email protected] (T3NA4MRVPU)" iOS Team Provisioning Profile: org.tboox.test" org.tboox.test
 </code></pre>
 <h4 id="-">运行应用程序</h4>
 <p>目前仅支持运行macos程序:</p>
@@ -491,55 +491,55 @@ package ok!
 $ xmake l utils.ipa.install test.ipa
 </code></pre>
 <h4 id="-">卸载</h4>
-<p>!&gt; 目前仅支持macos程序卸载</p>
+<p>!> 目前仅支持macos程序卸载</p>
 <pre><code class="lang-console">$ xmake uninstall
 </code></pre>
 <h3 id="framework-">Framework库程序</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.framework&quot;)
-    add_files(&quot;src/*.m&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.framework")
+    add_files("src/*.m")
+    add_files("src/Info.plist")
 </code></pre>
 <p>我们也可以通过模板工程快速创建:</p>
 <pre><code class="lang-console">$ xmake create -t xcode.framework -l objc test
 </code></pre>
 <h3 id="bundle-">Bundle程序</h3>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.bundle&quot;)
-    add_files(&quot;src/*.m&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.bundle")
+    add_files("src/*.m")
+    add_files("src/Info.plist")
 </code></pre>
 <p>我们也可以通过模板工程快速创建:</p>
 <pre><code class="lang-console">$ xmake create -t xcode.bundle -l objc test
 </code></pre>
 <h2 id="protobuf-">Protobuf程序</h2>
 <h3 id="-c-">使用c库</h3>
-<pre><code class="lang-lua">add_requires(&quot;protobuf-c&quot;)
+<pre><code class="lang-lua">add_requires("protobuf-c")
 
-target(&quot;console_c&quot;)
-    set_kind(&quot;binary&quot;)
-    add_packages(&quot;protobuf-c&quot;)
+target("console_c")
+    set_kind("binary")
+    add_packages("protobuf-c")
 
-    add_files(&quot;src/*.c&quot;)
-    add_files(&quot;src/*.proto&quot;, {rules = &quot;protobuf.c&quot;})
+    add_files("src/*.c")
+    add_files("src/*.proto", {rules = "protobuf.c"})
 </code></pre>
 <h3 id="-c-">使用c++库</h3>
-<pre><code class="lang-lua">add_requires(&quot;protobuf-cpp&quot;)
+<pre><code class="lang-lua">add_requires("protobuf-cpp")
 
-target(&quot;console_c++&quot;)
-    set_kind(&quot;binary&quot;)
-    set_languages(&quot;c++11&quot;)
+target("console_c++")
+    set_kind("binary")
+    set_languages("c++11")
 
-    add_packages(&quot;protobuf-cpp&quot;)
+    add_packages("protobuf-cpp")
 
-    add_files(&quot;src/*.cpp&quot;)
-    add_files(&quot;src/*.proto&quot;, {rules = &quot;protobuf.cpp&quot;})
+    add_files("src/*.cpp")
+    add_files("src/*.proto", {rules = "protobuf.cpp"})
 </code></pre>
 <h2 id="lexyacc-">Lex&amp;Yacc程序</h2>
-<pre><code class="lang-lua">target(&quot;calc&quot;)
-    set_kind(&quot;binary&quot;)
-    add_rules(&quot;lex&quot;, &quot;yacc&quot;)
-    add_files(&quot;src/*.l&quot;, &quot;src/*.y&quot;)
+<pre><code class="lang-lua">target("calc")
+    set_kind("binary")
+    add_rules("lex", "yacc")
+    add_files("src/*.l", "src/*.y")
 </code></pre>
 </article>
 </body>

+ 10 - 10
mirror/zh-cn/guide/quickstart.html

@@ -102,9 +102,9 @@
 │   └── main.c
 └── xmake.lua
 </code></pre><p>其中<code>xmake.lua</code>是工程描述文件,内容非常简单,告诉xmake添加<code>src</code>目录下的所有<code>.c</code>源文件:</p>
-<pre><code class="lang-lua">target(&quot;hello&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
+<pre><code class="lang-lua">target("hello")
+    set_kind("binary")
+    add_files("src/*.c") 
 </code></pre>
 <p>目前支持的语言如下:</p>
 <ul>
@@ -117,7 +117,7 @@
 <li>golang</li>
 <li>rust</li>
 </ul>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    如果你想了解更多参数选项,请运行: <code>xmake create --help</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    如果你想了解更多参数选项,请运行: <code>xmake create --help</code><br></p>
 
 </p>
 <h2 id="-">构建工程</h2>
@@ -130,7 +130,7 @@
 <pre><code class="lang-bash">$ xmake run -d hello 
 </code></pre>
 <p>xmake将会使用系统自带的调试器去加载程序运行,目前支持:lldb, gdb, windbg, vsjitdebugger, ollydbg 等各种调试器。</p>
-<pre><code class="lang-bash">[lldb]$target create &quot;build/hello&quot;
+<pre><code class="lang-bash">[lldb]$target create "build/hello"
 Current executable set to &#39;build/hello&#39; (x86_64).
 [lldb]$b main
 Breakpoint 1: where = hello`main, address = 0x0000000100000f50
@@ -140,13 +140,13 @@ Process 7509 stopped
 * thread #1: tid = 0x435a2, 0x0000000100000f50 hello`main, queue = &#39;com.apple.main-thread&#39;, stop reason = breakpoint 1.1
     frame #0: 0x0000000100000f50 hello`main
 hello`main:
--&gt;  0x100000f50 &lt;+0&gt;:  pushq  %rbp
-    0x100000f51 &lt;+1&gt;:  movq   %rsp, %rbp
-    0x100000f54 &lt;+4&gt;:  leaq   0x2b(%rip), %rdi          ; &quot;hello world!&quot;
-    0x100000f5b &lt;+11&gt;: callq  0x100000f64               ; symbol stub for: puts
+->  0x100000f50 <+0>:  pushq  %rbp
+    0x100000f51 <+1>:  movq   %rsp, %rbp
+    0x100000f54 <+4>:  leaq   0x2b(%rip), %rdi          ; "hello world!"
+    0x100000f5b <+11>: callq  0x100000f64               ; symbol stub for: puts
 [lldb]$
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    你也可以使用简写的命令行选项,例如: <code>xmake r</code> 或者 <code>xmake run</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    你也可以使用简写的命令行选项,例如: <code>xmake r</code> 或者 <code>xmake run</code><br></p>
 
 </p>
 </article>

+ 135 - 135
mirror/zh-cn/guide/syntax_description.html

@@ -92,9 +92,9 @@
 </style>
     <p>xmake的工程描述文件xmake.lua虽然基于lua语法,但是为了使得更加方便简洁得编写项目构建逻辑,xmake对其进行了一层封装,使得编写xmake.lua不会像些makefile那样繁琐</p>
 <p>基本上写个简单的工程构建描述,只需三行就能搞定,例如:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <h2 id="-">配置分离</h2>
 <p>xmake.lua采用二八原则实现了描述域、脚本域两层分离式配置。</p>
@@ -103,61 +103,61 @@
 <p>因此,xmake通过描述域、脚本域两种不同的配置方式,来隔离80%的简单配置以及20%的复杂配置,使得整个xmake.lua看起来非常的清晰直观,可读性和可维护性都达到最佳。</p>
 <h3 id="-">描述域</h3>
 <p>对于刚入门的新手用户,或者仅仅是维护一些简单的小项目,通过完全在描述配置就已经完全满足需求了,那什么是描述域呢?它长这样:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;DEBUG&quot;)
-    add_syslinks(&quot;pthread&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("DEBUG")
+    add_syslinks("pthread")
 </code></pre>
 <p>一眼望去,其实就是个 <code>set_xxx</code>/<code>add_xxx</code>的配置集,对于新手,完全可以不把它当做lua脚本,仅仅作为普通的,但有一些基础规则的配置文件就行了。</p>
 <p>如果因为,看着有括号,还是像脚本语言的函数调用,那我们也可以这么写(是否带括号看个人喜好):</p>
-<pre><code class="lang-lua">target &quot;test&quot;
-    set_kind &quot;binary&quot;
-    add_files &quot;src/*.c&quot;
-    add_defines &quot;DEBUG&quot;
-    add_syslinks &quot;pthread&quot;
+<pre><code class="lang-lua">target "test"
+    set_kind "binary"
+    add_files "src/*.c"
+    add_defines "DEBUG"
+    add_syslinks "pthread"
 </code></pre>
 <p>这是不是看着更像配置文件了?其实描述域就是配置文件,类似像json等key/values的配置而已,所以即使完全不会lua的新手,也是能很快上手的。</p>
 <p>而且,对于通常的项目,仅通过<code>set_xxx/add_xxx</code>去配置各种项目设置,已经完全满足需求了。</p>
 <p>这也就是开头说的:80%的情况下,可以用最简单的配置规则去简化项目的配置,提高可读性和可维护性,这样对用户和开发者都会非常的友好,也更加直观。</p>
 <p>如果我们要针对不同平台,架构做一些条件判断怎么办?没关系,描述域除了基础配置,也是支持条件判断,以及for循环的:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;DEBUG&quot;)
-    if is_plat(&quot;linux&quot;, &quot;macosx&quot;) then
-        add_links(&quot;pthread&quot;, &quot;m&quot;, &quot;dl&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("DEBUG")
+    if is_plat("linux", "macosx") then
+        add_links("pthread", "m", "dl")
     end
 </code></pre>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;DEBUG&quot;)
-    for _, name in ipairs({&quot;pthread&quot;, &quot;m&quot;, &quot;dl&quot;}) do
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("DEBUG")
+    for _, name in ipairs({"pthread", "m", "dl"}) do
         add_links(name)
     end
 </code></pre>
 <p>这是不是看着有点像lua了?虽说,平常可以把它当做普通配置问题,但是xmake毕竟基于lua,所以描述域还是支持lua的基础语言特性的。</p>
-<p>!&gt; 不过需要注意的是,描述域虽然支持lua的脚本语法,但在描述域尽量不要写太复杂的lua脚本,比如一些耗时的函数调用和for循环</p>
+<p>!> 不过需要注意的是,描述域虽然支持lua的脚本语法,但在描述域尽量不要写太复杂的lua脚本,比如一些耗时的函数调用和for循环</p>
 <p>并且在描述域,主要目的是为了设置配置项,因此xmake并没有完全开放所有的模块接口,很多接口在描述域是被禁止调用的,<br>即使开放出来的一些可调用接口,也是完全只读的,不耗时的安全接口,比如:<code>os.getenv()</code>等读取一些常规的系统信息,用于配置逻辑的控制。</p>
-<p>!&gt; 另外需要注意一点,xmake.lua是会被多次解析的,用于在不同阶段解析不同的配置域:比如:<code>option()</code>, <code>target()</code>等域。</p>
+<p>!> 另外需要注意一点,xmake.lua是会被多次解析的,用于在不同阶段解析不同的配置域:比如:<code>option()</code>, <code>target()</code>等域。</p>
 <p>因此,不要想着在xmake.lua的描述域,写复杂的lua脚本,也不要在描述域调用print去显示信息,因为会被执行多遍,记住:会被执行多遍!!!</p>
 <h3 id="-">脚本域</h3>
 <p>限制描述域写复杂的lua,各种lua模块和接口都用不了?怎么办?这个时候就是脚本域出场的时候了。</p>
 <p>如果用户已经完全熟悉了xmake的描述域配置,并且感觉有些满足不了项目上的一些特殊配置维护了,那么我们可以在脚本域做更加复杂的配置逻辑:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
     on_load(function (target)
-        if is_plat(&quot;linux&quot;, &quot;macosx&quot;) then
-            target:add(&quot;links&quot;, &quot;pthread&quot;, &quot;m&quot;, &quot;dl&quot;)
+        if is_plat("linux", "macosx") then
+            target:add("links", "pthread", "m", "dl")
         end
     end)
     after_build(function (target)
-        import(&quot;core.project.config&quot;)
+        import("core.project.config")
         local targetfile = target:targetfile()
         os.cp(targetfile, path.join(config.buildir(), path.filename(targetfile)))
-        print(&quot;build %s&quot;, targetfile)
+        print("build %s", targetfile)
     end)
 </code></pre>
 <p>只要是类似:<code>on_xxx</code>, <code>after_xxx</code>, <code>before_xxx</code>等字样的function body内部的脚本,都属于脚本域。</p>
@@ -165,11 +165,11 @@
 <p>我们可以在脚本域实现你想实现的任意功能,甚至写个独立项目出来都是可以的。</p>
 <p>对于一些脚本片段,不是很臃肿的话,像上面这么内置写写就足够了,如果需要实现更加复杂的脚本,不想充斥在一个xmake.lua里面,可以把脚本分离到独立的lua文件中去维护。</p>
 <p>例如:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    on_load(&quot;modules.test.load&quot;)
-    on_install(&quot;modules.test.install&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    on_load("modules.test.load")
+    on_install("modules.test.install")
 </code></pre>
 <p>我们可以吧自定义的脚本放置到xmake.lua对应目录下,<code>modules/test/load.lua</code>和<code>modules/test/install.lua</code>中独立维护。</p>
 <p>这些独立的lua脚本里面,我们还可以通过<a href="/zh-cn/manual/builtin_modules?id=import">import</a>导入各种内置模块和自定义模块进来使用,就跟平常写lua, java没啥区别。</p>
@@ -177,35 +177,35 @@
 <p>其他阶段,还有很多,比如:<code>on/after/before</code>_<code>build/install/package/run</code>等,具体看下后面的target api手册部分吧,这里就不细说了。</p>
 <h2 id="-">配置类型</h2>
 <p>在描述域配置中,分配置域和配置项,配置域里面可以通过<code>set_xxx</code>/<code>add_xxx</code>的接口,配置各种配置项。</p>
-<pre><code class="lang-lua">target(&quot;test1&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test1")
+    set_kind("binary")
+    add_files("src/*.c")
 
-target(&quot;test2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("test2")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <p>像上述配置中,target就属于配置域,它下面的所有<code>set_xx</code>/<code>add_xxx</code>接口配置都属于配置项,对这个target局部生效。</p>
 <p>我们可以把它理解成局部作用域,类似c里面的block块:</p>
-<pre><code>target(&quot;test1&quot;)
+<pre><code>target("test1")
 {
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+    set_kind("binary")
+    add_files("src/*.c")
 }
-target(&quot;test2&quot;)
+target("test2")
 {
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+    set_kind("binary")
+    add_files("src/*.c")
 }
 </code></pre><p>不过,为了简化写法,xmake约定每个新定义的target域开始,上一个配置域就自动结束了,当然,如果这样用户觉得有困扰,也可以手动配置离开域:</p>
-<pre><code class="lang-lua">target(&quot;test1&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test1")
+    set_kind("binary")
+    add_files("src/*.c")
 target_end()
 
-target(&quot;test2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("test2")
+    set_kind("binary")
+    add_files("src/*.c")
 target_end()
 </code></pre>
 <h3 id="-">配置域</h3>
@@ -223,11 +223,11 @@ target_end()
 </ul>
 <p>那哪些属于外部,哪些又属于内部呢,看看下面的注释,就知道个大概了:</p>
 <pre><code class="lang-lua">-- 外部作用域
-target(&quot;test&quot;)
+target("test")
 
     -- 外部作用域
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+    set_kind("binary")
+    add_files("src/*.c")
 
     on_run(function ()
         -- 内部作用域
@@ -238,7 +238,7 @@ target(&quot;test&quot;)
         end)
 
 -- 外部作用域
-task(&quot;hello&quot;)
+task("hello")
 
     -- 外部作用域
     on_run(function ()
@@ -249,15 +249,15 @@ task(&quot;hello&quot;)
 <h3 id="-">外部作用域</h3>
 <p>对于大部分工程来说,并不需要很复杂的工程描述,也不需要自定义脚本支持,只需要简单的 <code>set_xxx</code> 或者 <code>add_xxx</code> 就能满足需求了</p>
 <p>那么根据二八定律,80%的情况下,我们只需要这么写:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;static&quot;)
-    add_files(&quot;src/test/*.c&quot;)
-
-target(&quot;demo&quot;)
-    add_deps(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_links(&quot;test&quot;)
-    add_files(&quot;src/demo/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    add_files("src/test/*.c")
+
+target("demo")
+    add_deps("test")
+    set_kind("binary")
+    add_links("test")
+    add_files("src/demo/*.c")
 </code></pre>
 <p>不需要复杂的api调用,也不需要各种繁琐的变量定义,以及 if 判断 和 for 循环,要的就是简洁可读,一眼看过去,就算不懂lua语法也没关系</p>
 <p>就当做简单的描述语法,看上去有点像函数调用而已,会点编程的基本一看就知道怎么配置。</p>
@@ -275,12 +275,12 @@ target(&quot;demo&quot;)
 <p>还有些辅助api,例如:</p>
 <p>dirs:扫描获取当前指定路径中的所有目录<br>files:扫描获取当前指定路径中的所有文件<br>format: 格式化字符串,string.format的简写版本</p>
 <p>还有变量定义、逻辑操作也是可以使用的,毕竟是基于lua的,该有的基础语法,还是要有的,我们可以通过if来切换编译文件:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;static&quot;)
-    if is_plat(&quot;iphoneos&quot;) then
-        add_files(&quot;src/test/ios/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    if is_plat("iphoneos") then
+        add_files("src/test/ios/*.c")
     else
-        add_files(&quot;src/test/*.c&quot;)
+        add_files("src/test/*.c")
     end
 </code></pre>
 <p>需要注意的是,变量定义分全局变量和局部变量,局部变量只对当前xmake.lua有效,不影响子xmake.lua</p>
@@ -290,20 +290,20 @@ local var1 = 0
 -- 全局变量,影响所有之后 includes() 包含的子 xmake.lua 
 var2 = 1
 
-includes(&quot;src&quot;)
+includes("src")
 </code></pre>
 <h3 id="-">内部作用域</h3>
 <p>也称插件、脚本作用域,提供更加复杂、灵活的脚本支持,一般用于编写一些自定义脚本、插件开发、自定义task任务、自定义模块等等</p>
 <p>一般通过<code>function () end</code>包含,并且被传入到<code>on_xxx</code>, <code>before_xxx</code>和<code>after_xxx</code>接口内的,都属于自作用域。</p>
 <p>例如:</p>
 <pre><code class="lang-lua">-- 自定义脚本
-target(&quot;hello&quot;)
+target("hello")
     after_build(function ()
         -- 内部作用域
         end)
 
 -- 自定义任务、插件
-task(&quot;hello&quot;)
+task("hello")
     on_run(function ()
         -- 内部作用域
         end)
@@ -311,13 +311,13 @@ task(&quot;hello&quot;)
 <p>在此作用域中,不仅可以使用大部分lua的api,还可以使用很多xmake提供的扩展模块,所有扩展模块,通过import来导入</p>
 <p>具体可参考:<a href="/zh-cn/manual/builtin_modules?id=import">import模块导入文档</a></p>
 <p>这里我们给个简单的例子,在编译完成后,对ios目标程序进行ldid签名:</p>
-<pre><code class="lang-lua">target(&quot;iosdemo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.m&quot;)
+<pre><code class="lang-lua">target("iosdemo")
+    set_kind("binary")
+    add_files("*.m")
     after_build(function (target) 
 
         -- 执行签名,如果失败,自动中断,给出高亮错误信息
-        os.run(&quot;ldid -S$(projectdir)/entitlements.plist %s&quot;, target:targetfile())
+        os.run("ldid -S$(projectdir)/entitlements.plist %s", target:targetfile())
     end)
 </code></pre>
 <p>需要注意的是,在内部作用域中,所有的调用都是启用异常捕获机制的,如果运行出错,会自动中断xmake,并给出错误提示信息</p>
@@ -325,52 +325,52 @@ task(&quot;hello&quot;)
 <h3 id="-">接口作用域</h3>
 <p>在外部作用域中的所有描述api设置,本身也是有作用域之分的,在不同地方调用,影响范围也不相同,例如:</p>
 <pre><code class="lang-lua">-- 全局根作用域,影响所有target,包括includes() 中的子工程target设置
-add_defines(&quot;DEBUG&quot;)
+add_defines("DEBUG")
 
 -- 定义或者进入demo目标作用域(支持多次进入来追加设置)
-target(&quot;demo&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo")
+    set_kind("shared")
+    add_files("src/*.c")
     -- 当前target作用域,仅仅影响当前target
-    add_defines(&quot;DEBUG2&quot;)
+    add_defines("DEBUG2")
 
 -- 选项设置,仅支持局部设置,不受全局api设置所影响
-option(&quot;test&quot;)
+option("test")
     -- 当前选项的局部作用域
     set_default(false)
 
 -- 其他target设置,-DDEBUG 也会被设置上
-target(&quot;demo2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo2")
+    set_kind("binary")
+    add_files("src/*.c")
 
 -- 重新进入demo目标作用域
-target(&quot;demo&quot;)
+target("demo")
     -- 追加宏定义,只对当前demo目标有效
-    add_defines(&quot;DEBUG3&quot;)
+    add_defines("DEBUG3")
 </code></pre>
 <p>通常情况下,进入另一个target/option域设置,会自动离开上个target/option域,但是有时候为了比较一些作用域污染情况,我们可以显示离开某个域,例如:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_default(false)
 option_end()
 
-target(&quot;demo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo")
+    set_kind("binary")
+    add_files("src/*.c")
 target_end()
 </code></pre>
 <p>调用<code>option_end()</code>, <code>target_end()</code>即可显式的离开当前target/option域设置。</p>
 <h3 id="-">作用域缩进</h3>
 <p>xmake.lua里面缩进,只是个编写规范,用于更加清楚的区分,当前的设置 是针对 那个作用域的,虽然就算不缩进,也一样ok,但是可读性上 并不是很好。。</p>
 <p>例如:</p>
-<pre><code class="lang-lua">target(&quot;xxxx&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.c&quot;)
+<pre><code class="lang-lua">target("xxxx")
+    set_kind("binary")
+    add_files("*.c")
 </code></pre>
 <p>和</p>
-<pre><code class="lang-lua">target(&quot;xxxx&quot;)
-set_kind(&quot;binary&quot;)
-add_files(&quot;*.c&quot;)
+<pre><code class="lang-lua">target("xxxx")
+set_kind("binary")
+add_files("*.c")
 </code></pre>
 <p>上述两种方式,效果上都是一样的,但是理解上,第一种更加直观,一看就知道<code>add_files</code>仅仅只是针对 target 设置的,并不是全局设置</p>
 <p>因此,适当的进行缩进,有助于更好的维护xmake.lua</p>
@@ -385,61 +385,61 @@ add_files(&quot;*.c&quot;)
       - xmake.lua
 </code></pre><p><code>projectdir/xmake.lua</code>是项目的根xmake.lua配置,而<code>src/xmake.lua</code>是项目的子配置。</p>
 <p><code>projectdir/xmake.lua</code>内容:</p>
-<pre><code class="lang-lua">add_defines(&quot;ROOT&quot;)
+<pre><code class="lang-lua">add_defines("ROOT")
 
-target(&quot;test1&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;TEST1&quot;)
+target("test1")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST1")
 
-target(&quot;test2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;TEST2&quot;)
+target("test2")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST2")
 
-includes(&quot;src&quot;)
+includes("src")
 </code></pre>
-<p>里面全局根域配置了<code>add_defines(&quot;ROOT&quot;)</code>,会影响下面的所有target配置,包括includes里面子xmake.lua中的所有target配置,所以这个是全局总配置。</p>
-<p>而在test1/test2里面的<code>add_defines(&quot;TEST1&quot;)</code>和<code>add_defines(&quot;TEST2&quot;)</code>属于局部配置,只对当前target生效。</p>
+<p>里面全局根域配置了<code>add_defines("ROOT")</code>,会影响下面的所有target配置,包括includes里面子xmake.lua中的所有target配置,所以这个是全局总配置。</p>
+<p>而在test1/test2里面的<code>add_defines("TEST1")</code>和<code>add_defines("TEST2")</code>属于局部配置,只对当前target生效。</p>
 <p><code>src/xmake.lua</code>内容:</p>
-<pre><code class="lang-lua">add_defines(&quot;ROOT2&quot;)
+<pre><code class="lang-lua">add_defines("ROOT2")
 
-target(&quot;test3&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_defines(&quot;TEST3&quot;)
+target("test3")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST3")
 </code></pre>
-<p>在<code>src/xmake.lua</code>子配置中,也有个全局根域,配置了<code>add_defines(&quot;ROOT2&quot;)</code>,这个属于子配置根域,只对当前子xmake.lua里面所有target生效,也会对下级includes里面的子xmake.lua中target生效,因为之前说了,xmake是tree状结构的配置继承关系。</p>
+<p>在<code>src/xmake.lua</code>子配置中,也有个全局根域,配置了<code>add_defines("ROOT2")</code>,这个属于子配置根域,只对当前子xmake.lua里面所有target生效,也会对下级includes里面的子xmake.lua中target生效,因为之前说了,xmake是tree状结构的配置继承关系。</p>
 <p>所以,这几个target的最终配置结果依次是:</p>
-<pre><code>target(&quot;test1&quot;): -DROOT -DTEST1
-target(&quot;test2&quot;): -DROOT -DTEST2
-target(&quot;test3&quot;): -DROOT -DROOT2 -DTEST3
+<pre><code>target("test1"): -DROOT -DTEST1
+target("test2"): -DROOT -DTEST2
+target("test3"): -DROOT -DROOT2 -DTEST3
 </code></pre><h2 id="-">语法简化</h2>
 <p>xmake.lua的配置域语法,非常灵活,可以在相关域做各种复杂灵活的配置,但是对于许多精简的小块配置,这个时候就稍显冗余了:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;)
+<pre><code class="lang-lua">option("test1")
     set_default(true)
     set_showmenu(true)
-    set_description(&quot;test1 option&quot;)
+    set_description("test1 option")
 
-option(&quot;test2&quot;)
+option("test2")
     set_default(true)
     set_showmeu(true)
 
-option(&quot;test3&quot;)
-    set_default(&quot;hello&quot;)
+option("test3")
+    set_default("hello")
 </code></pre>
 <p>xmake 2.2.6以上版本,对于上面的这些小块option域设置,我们可以简化下成单行描述:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;, {default = true, showmenu = true, description = &quot;test1 option&quot;})
-option(&quot;test2&quot;, {default = true, showmenu = true})
-option(&quot;test3&quot;, {default = &quot;hello&quot;})
+<pre><code class="lang-lua">option("test1", {default = true, showmenu = true, description = "test1 option"})
+option("test2", {default = true, showmenu = true})
+option("test3", {default = "hello"})
 </code></pre>
 <p>除了option域,对于其他域也是支持这种简化写法的,例如:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("demo")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <p>简化为:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;, {kind = &quot;binary&quot;, files = &quot;src/*.c&quot;})
+<pre><code class="lang-lua">target("demo", {kind = "binary", files = "src/*.c"})
 </code></pre>
 <p>当然,如果配置需求比较复杂的,还是原有的多行设置方式更加方便,这个就看自己的需求来评估到底使用哪种方式了。</p>
 </article>

+ 270 - 270
mirror/zh-cn/index.html

@@ -99,10 +99,10 @@
 <h2 id="-">安装</h2>
 <h4 id="master-">Master版本</h4>
 <h4 id="-curl">使用curl</h4>
-<pre><code class="lang-bash">bash &lt;(curl -fsSL https://xmake.io/shget.text)
+<pre><code class="lang-bash">bash <(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h4 id="-wget">使用wget</h4>
-<pre><code class="lang-bash">bash &lt;(wget https://xmake.io/shget.text -O -)
+<pre><code class="lang-bash">bash <(wget https://xmake.io/shget.text -O -)
 </code></pre>
 <h4 id="-powershell">使用powershell</h4>
 <pre><code class="lang-powershell">Invoke-Expression (Invoke-Webrequest &#39;https://xmake.io/psget.text&#39; -UseBasicParsing).Content
@@ -117,7 +117,7 @@
 <pre><code class="lang-bash">scoop install xmake
 </code></pre>
 <h4 id="macos">MacOS</h4>
-<pre><code class="lang-bash">$ ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;
+<pre><code class="lang-bash">$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 $ brew install xmake
 </code></pre>
 <p>或者:</p>
@@ -130,7 +130,7 @@ $ brew install xmake
 $ brew install xmake --HEAD
 
 # 或者直接调用shell下载安装
-$ bash &lt;(curl -fsSL https://xmake.io/shget.text)
+$ bash <(curl -fsSL https://xmake.io/shget.text)
 </code></pre>
 <h4 id="linux">Linux</h4>
 <p>在archlinux上安装:</p>
@@ -200,9 +200,9 @@ $ xmake update dev
 │   └── main.c
 └── xmake.lua
 </code></pre><p>其中<code>xmake.lua</code>是工程描述文件,内容非常简单,告诉xmake添加<code>src</code>目录下的所有<code>.c</code>源文件:</p>
-<pre><code class="lang-lua">target(&quot;hello&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
+<pre><code class="lang-lua">target("hello")
+    set_kind("binary")
+    add_files("src/*.c") 
 </code></pre>
 <p>目前支持的语言如下:</p>
 <ul>
@@ -215,7 +215,7 @@ $ xmake update dev
 <li>golang</li>
 <li>rust</li>
 </ul>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    如果你想了解更多参数选项,请运行: <code>xmake create --help</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    如果你想了解更多参数选项,请运行: <code>xmake create --help</code><br></p>
 
 </p>
 <h4 id="-">构建工程</h4>
@@ -228,7 +228,7 @@ $ xmake update dev
 <pre><code class="lang-bash">$ xmake run -d hello 
 </code></pre>
 <p>xmake将会使用系统自带的调试器去加载程序运行,目前支持:lldb, gdb, windbg, vsjitdebugger, ollydbg 等各种调试器。</p>
-<pre><code class="lang-bash">[lldb]$target create &quot;build/hello&quot;
+<pre><code class="lang-bash">[lldb]$target create "build/hello"
 Current executable set to &#39;build/hello&#39; (x86_64).
 [lldb]$b main
 Breakpoint 1: where = hello`main, address = 0x0000000100000f50
@@ -238,41 +238,41 @@ Process 7509 stopped
 * thread #1: tid = 0x435a2, 0x0000000100000f50 hello`main, queue = &#39;com.apple.main-thread&#39;, stop reason = breakpoint 1.1
     frame #0: 0x0000000100000f50 hello`main
 hello`main:
--&gt;  0x100000f50 &lt;+0&gt;:  pushq  %rbp
-    0x100000f51 &lt;+1&gt;:  movq   %rsp, %rbp
-    0x100000f54 &lt;+4&gt;:  leaq   0x2b(%rip), %rdi          ; &quot;hello world!&quot;
-    0x100000f5b &lt;+11&gt;: callq  0x100000f64               ; symbol stub for: puts
+->  0x100000f50 <+0>:  pushq  %rbp
+    0x100000f51 <+1>:  movq   %rsp, %rbp
+    0x100000f54 <+4>:  leaq   0x2b(%rip), %rdi          ; "hello world!"
+    0x100000f5b <+11>: callq  0x100000f64               ; symbol stub for: puts
 [lldb]$
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    你也可以使用简写的命令行选项,例如: <code>xmake r</code> 或者 <code>xmake run</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    你也可以使用简写的命令行选项,例如: <code>xmake r</code> 或者 <code>xmake run</code><br></p>
 
 </p>
 <h2 id="-">工程实例</h2>
 <h4 id="-">可执行程序</h4>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*c")
 </code></pre>
 <h4 id="-">静态库程序</h4>
-<pre><code class="lang-lua">target(&quot;library&quot;)
-    set_kind(&quot;static&quot;)
-    add_files(&quot;src/library/*.c&quot;)
+<pre><code class="lang-lua">target("library")
+    set_kind("static")
+    add_files("src/library/*.c")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
-    add_deps(&quot;library&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*c")
+    add_deps("library")
 </code></pre>
 <p>通过<code>add_deps</code>将一个静态库自动链接到test可执行程序。</p>
 <h4 id="-">动态库程序</h4>
-<pre><code class="lang-lua">target(&quot;library&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;src/library/*.c&quot;)
+<pre><code class="lang-lua">target("library")
+    set_kind("shared")
+    add_files("src/library/*.c")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*c&quot;)
-    add_deps(&quot;library&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*c")
+    add_deps("library")
 </code></pre>
 <p>通过<code>add_deps</code>将一个动态库自动链接到test可执行程序。</p>
 <h4 id="qt-">Qt程序</h4>
@@ -291,36 +291,36 @@ $ xmake create -l c++ -t quickapp_qt test
 <p>上述指定的mingw sdk用的是Qt下Tools目录自带的环境,当然如果有其他第三方mingw编译环境,也可以手动指定, 具体可以参考:<a href="#mingw">mingw编译配置</a>。</p>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/160">#160</a></p>
 <h5 id="-">静态库程序</h5>
-<pre><code class="lang-lua">target(&quot;qt_static_library&quot;)
-    add_rules(&quot;qt.static&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("qt_static_library")
+    add_rules("qt.static")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h5 id="-">动态库程序</h5>
-<pre><code class="lang-lua">target(&quot;qt_shared_library&quot;)
-    add_rules(&quot;qt.shared&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("qt_shared_library")
+    add_rules("qt.shared")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h5 id="-">控制台程序</h5>
-<pre><code class="lang-lua">target(&quot;qt_console&quot;)
-    add_rules(&quot;qt.console&quot;)
-    add_files(&quot;src/*.cpp&quot;)
+<pre><code class="lang-lua">target("qt_console")
+    add_rules("qt.console")
+    add_files("src/*.cpp")
 </code></pre>
 <h5 id="quick-">Quick应用程序</h5>
-<pre><code class="lang-lua">target(&quot;qt_quickapp&quot;)
-    add_rules(&quot;qt.application&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/qml.qrc&quot;)
-    add_frameworks(&quot;QtQuick&quot;)
+<pre><code class="lang-lua">target("qt_quickapp")
+    add_rules("qt.application")
+    add_files("src/*.cpp") 
+    add_files("src/qml.qrc")
+    add_frameworks("QtQuick")
 </code></pre>
 <h5 id="widgets-">Widgets应用程序</h5>
-<pre><code class="lang-lua">target(&quot;qt_widgetapp&quot;)
-    add_rules(&quot;qt.application&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;)  -- 添加带有 Q_OBJECT 的meta头文件
-    add_frameworks(&quot;QtWidgets&quot;)
+<pre><code class="lang-lua">target("qt_widgetapp")
+    add_rules("qt.application")
+    add_files("src/*.cpp") 
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
+    add_frameworks("QtWidgets")
 </code></pre>
 <h5 id="android-">Android应用程序</h5>
 <p>2.2.6之后版本,可以直接切到android平台编译Quick/Widgets应用程序,生成apk包,并且可通过<code>xmake install</code>命令安装到设备。</p>
@@ -347,15 +347,15 @@ $ cd test
 $ xmake
 </code></pre>
 <pre><code class="lang-lua">-- define target
-target(&quot;cuda_console&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.cu&quot;)
+target("cuda_console")
+    set_kind("binary")
+    add_files("src/*.cu")
     -- generate SASS code for SM architecture of current host
-    add_cugencodes(&quot;native&quot;)
+    add_cugencodes("native")
     -- generate PTX code for the virtual architecture to guarantee compatibility
-    add_cugencodes(&quot;compute_30&quot;)
+    add_cugencodes("compute_30")
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>从v2.2.7版本开始,默认构建会启用device-link。(参见 <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>如果要显示禁用device-link,可以通过<code>add_values(&quot;cuda.devlink&quot;, false)</code> 来设置。<br>&lt;/p&gt;
+<p><p class="tip"><br>从v2.2.7版本开始,默认构建会启用device-link。(参见 <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>如果要显示禁用device-link,可以通过<code>add_values("cuda.devlink", false)</code> 来设置。<br></p>
 
 </p>
 <p>默认会自动探测cuda环境,当然也可以指定Cuda SDK环境目录:</p>
@@ -365,49 +365,49 @@ $ xmake
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/158">#158</a></p>
 <h4 id="wdk-">WDK驱动程序</h4>
 <p>默认会自动探测wdk所在环境,当然也可以指定wdk sdk环境目录:</p>
-<pre><code class="lang-console">$ xmake f --wdk=&quot;G:\Program Files\Windows Kits\10&quot; -c 
+<pre><code class="lang-console">$ xmake f --wdk="G:\Program Files\Windows Kits\10" -c 
 $ xmake
 </code></pre>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/159">#159</a></p>
 <h5 id="umdf-">umdf驱动程序</h5>
-<pre><code class="lang-lua">target(&quot;echo&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;driver/*.c&quot;) 
-    add_files(&quot;driver/*.inx&quot;)
-    add_includedirs(&quot;exe&quot;)
+<pre><code class="lang-lua">target("echo")
+    add_rules("wdk.driver", "wdk.env.umdf")
+    add_files("driver/*.c") 
+    add_files("driver/*.inx")
+    add_includedirs("exe")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.umdf&quot;)
-    add_files(&quot;exe/*.cpp&quot;) 
+target("app")
+    add_rules("wdk.binary", "wdk.env.umdf")
+    add_files("exe/*.cpp") 
 </code></pre>
 <h5 id="kmdf-">kmdf驱动程序</h5>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.kmdf&quot;)
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;driver/*.rc&quot;)
+<pre><code class="lang-lua">target("nonpnp")
+    add_rules("wdk.driver", "wdk.env.kmdf")
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
+    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.rc")
 
-target(&quot;app&quot;)
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.kmdf&quot;)
-    add_files(&quot;exe/*.c&quot;) 
-    add_files(&quot;exe/*.inf&quot;)
+target("app")
+    add_rules("wdk.binary", "wdk.env.kmdf")
+    add_files("exe/*.c") 
+    add_files("exe/*.inf")
 </code></pre>
 <h5 id="wdm-">wdm驱动程序</h5>
-<pre><code class="lang-lua">target(&quot;kcs&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    add_values(&quot;wdk.man.flags&quot;, &quot;-prefix Kcs&quot;)
-    add_values(&quot;wdk.man.resource&quot;, &quot;kcsCounters.rc&quot;)
-    add_values(&quot;wdk.man.header&quot;, &quot;kcsCounters.h&quot;)
-    add_values(&quot;wdk.man.counter_header&quot;, &quot;kcsCounters_counters.h&quot;)
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;, &quot;*.man&quot;) 
-</code></pre>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TracePrint((LEVEL,FLAGS,MSG,...))&quot;)
-    add_files(&quot;*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;*.rc&quot;, &quot;*.inf&quot;)
-    add_files(&quot;*.mof|msdsm.mof&quot;)
-    add_files(&quot;msdsm.mof&quot;, {values = {wdk_mof_header = &quot;msdsmwmi.h&quot;}}) 
+<pre><code class="lang-lua">target("kcs")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    add_values("wdk.man.flags", "-prefix Kcs")
+    add_values("wdk.man.resource", "kcsCounters.rc")
+    add_values("wdk.man.header", "kcsCounters.h")
+    add_values("wdk.man.counter_header", "kcsCounters_counters.h")
+    add_files("*.c", "*.rc", "*.man") 
+</code></pre>
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
+    add_files("*.c", {rule = "wdk.tracewpp"}) 
+    add_files("*.rc", "*.inf")
+    add_files("*.mof|msdsm.mof")
+    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}}) 
 </code></pre>
 <h5 id="-">生成驱动包</h5>
 <p>可以通过以下命令生成.cab驱动包:</p>
@@ -422,69 +422,69 @@ $ xmake [p|package] -o outputdir
        - debug/x86/sampledsm.cab
        - release/x64/sampledsm.cab
 </code></pre><h5 id="-">驱动签名</h5>
-<p>默认编译禁用签名,可以通过<code>set_values(&quot;wdk.sign.mode&quot;, ...)</code>设置签名模式来启用签名。</p>
+<p>默认编译禁用签名,可以通过<code>set_values("wdk.sign.mode", ...)</code>设置签名模式来启用签名。</p>
 <h6 id="-">测试签名</h6>
 <p>测试签名一般本机调试时候用,可以使用xmake自带的test证书来进行签名,例如:</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
 </code></pre>
 <p>不过这种情况下,需要用户手动在管理员模式下,执行一遍:<code>$xmake l utils.wdk.testcert install</code>,来生成和注册test证书到本机环境。<br>这个只需要执行一次就行了,后续就可以正常编译和签名了。</p>
 <p>当然也可以使用本机已有的有效证书去签名。</p>
 <p>从sha1来选择合适的证书进行签名:</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
-    set_values(&quot;wdk.sign.thumbprint&quot;, &quot;032122545DCAA6167B1ADBE5F7FDF07AE2234AAA&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
+    set_values("wdk.sign.thumbprint", "032122545DCAA6167B1ADBE5F7FDF07AE2234AAA")
 </code></pre>
 <p>从store/company来选择合适的证书进行签名:</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;test&quot;)
-    set_values(&quot;wdk.sign.store&quot;, &quot;PrivateCertStore&quot;)
-    set_values(&quot;wdk.sign.company&quot;, &quot;tboox.org(test)&quot;)
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "test")
+    set_values("wdk.sign.store", "PrivateCertStore")
+    set_values("wdk.sign.company", "tboox.org(test)")
 </code></pre>
 <h6 id="-">正式签名</h6>
 <p>通过指定对应的正式签名证书文件进行签名:</p>
-<pre><code class="lang-lua">target(&quot;msdsm&quot;)
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.wdm&quot;)
-    set_values(&quot;wdk.sign.mode&quot;, &quot;release&quot;)
-    set_values(&quot;wdk.sign.company&quot;, &quot;xxxx&quot;)
-    set_values(&quot;wdk.sign.certfile&quot;, path.join(os.projectdir(), &quot;xxxx.cer&quot;))
+<pre><code class="lang-lua">target("msdsm")
+    add_rules("wdk.driver", "wdk.env.wdm")
+    set_values("wdk.sign.mode", "release")
+    set_values("wdk.sign.company", "xxxx")
+    set_values("wdk.sign.certfile", path.join(os.projectdir(), "xxxx.cer"))
 </code></pre>
 <h5 id="-">生成低版本驱动</h5>
 <p>如果想在wdk10环境编译生成win7, win8等低版本系统支持的驱动,可以通过设置<code>wdk.env.winver</code>来切换系统版本:</p>
-<pre><code class="lang-lua">set_values(&quot;wdk.env.winver&quot;, &quot;win10&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win10_rs3&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win81&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win8&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp1&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp2&quot;)
-set_values(&quot;wdk.env.winver&quot;, &quot;win7_sp3&quot;)
+<pre><code class="lang-lua">set_values("wdk.env.winver", "win10")
+set_values("wdk.env.winver", "win10_rs3")
+set_values("wdk.env.winver", "win81")
+set_values("wdk.env.winver", "win8")
+set_values("wdk.env.winver", "win7")
+set_values("wdk.env.winver", "win7_sp1")
+set_values("wdk.env.winver", "win7_sp2")
+set_values("wdk.env.winver", "win7_sp3")
 </code></pre>
 <p>我们也可以手动指定编译的目标程序支持的windows版本:</p>
 <pre><code class="lang-console">$ xmake f --wdk_winver=[win10_rs3|win8|win7|win7_sp1]
 $ xmake
 </code></pre>
 <h4 id="winsdk-">WinSDK程序</h4>
-<pre><code class="lang-lua">target(&quot;usbview&quot;)
-    add_rules(&quot;win.sdk.application&quot;)
+<pre><code class="lang-lua">target("usbview")
+    add_rules("win.sdk.application")
 
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;)
-    add_files(&quot;xmlhelper.cpp&quot;, {rule = &quot;win.sdk.dotnet&quot;})
+    add_files("*.c", "*.rc")
+    add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
 </code></pre>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/173">#173</a></p>
 <h2 id="-">编译配置</h2>
 <p>通过<code>xmake f|config</code>配置命令,设置构建前的相关配置信息,详细参数选项,请运行: <code>xmake f --help</code>。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    你可以使用命令行缩写来简化输入,也可以使用全名,例如: &lt;br&gt;<br>    <code>xmake f</code> 或者 <code>xmake config</code>.&lt;br&gt;<br>    <code>xmake f -p linux</code> 或者 <code>xmake config --plat=linux</code>.<br>&lt;/p&gt;
+<p><p class="tip"><br>    你可以使用命令行缩写来简化输入,也可以使用全名,例如: <br><br>    <code>xmake f</code> 或者 <code>xmake config</code>.<br><br>    <code>xmake f -p linux</code> 或者 <code>xmake config --plat=linux</code>.<br></p>
 
 </p>
 <h4 id="-">目标平台</h4>
 <h5 id="-">主机平台</h5>
 <pre><code class="lang-bash">$ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    xmake将会自动探测当前主机平台,默认自动生成对应的目标程序。<br>&lt;/p&gt;
+<p><p class="tip"><br>    xmake将会自动探测当前主机平台,默认自动生成对应的目标程序。<br></p>
 
 </p>
 <h5 id="linux">Linux</h5>
@@ -499,7 +499,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p android --ndk=~/files/android-ndk-r10e/ -a arm64-v8a --bin=~/files/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin
 </code></pre>
 <p><a href="#-bin">--bin</a>主要用于设置选择编译工具的具体bin目录,这个的使用跟<a href="#交叉编译">交叉编译</a>中的<a href="#-bin">--bin</a>的行为是一致的。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果手动设置了bin目录,没有通过检测,可以看下是否<code>--arch=</code>参数没有匹配对。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果手动设置了bin目录,没有通过检测,可以看下是否<code>--arch=</code>参数没有匹配对。<br></p>
 
 </p>
 <h5 id="iphoneos">iPhoneOS</h5>
@@ -527,7 +527,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p cross --sdk=/usr/local/arm-xxx-gcc/ [--bin=/sdk/bin] [--cross=arm-linux-]
 $ xmake
 </code></pre>
-<p>如果不关心实际的平台名,只想交叉编译,可以直接用上面的命令,如果需要通过<code>is_plat(&quot;myplat&quot;)</code>判断自己的平台逻辑,则:</p>
+<p>如果不关心实际的平台名,只想交叉编译,可以直接用上面的命令,如果需要通过<code>is_plat("myplat")</code>判断自己的平台逻辑,则:</p>
 <pre><code class="lang-bash">$ xmake f -p myplat --sdk=/usr/local/arm-xxx-gcc/ [--bin=/sdk/bin] [--cross=arm-linux-]
 $ xmake
 </code></pre>
@@ -714,7 +714,7 @@ $ xmake
 </tr>
 </tbody>
 </table>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果你想要了解更多参数选项,请运行: <code>xmake f --help</code>。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果你想要了解更多参数选项,请运行: <code>xmake f --help</code>。<br></p>
 
 </p>
 <h6 id="-sdk">--sdk</h6>
@@ -748,7 +748,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/home/toolchains_sdkdir --bin=/usr/opt/bin
 $ xmake
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>v2.2.1版本之前,这个参数名是<code>--toolchains</code>,比较有歧义,因此新版本中,统一改成<code>--bin=</code>来设置bin目录。<br>&lt;/p&gt;
+<p><p class="tip"><br>v2.2.1版本之前,这个参数名是<code>--toolchains</code>,比较有歧义,因此新版本中,统一改成<code>--bin=</code>来设置bin目录。<br></p>
 
 </p>
 <h6 id="-cross">--cross</h6>
@@ -772,7 +772,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --as=armv7-linux-as
 </code></pre>
 <p>如果存在<code>AS</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --as=gcc@/home/xxx/asmips.exe</code> 设置ccmips.exe编译器作为类gcc的使用方式来编译。<br>也就是说,在指定编译器为<code>asmips.exe</code>的同时,告诉xmake,它跟gcc用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --as=gcc@/home/xxx/asmips.exe</code> 设置ccmips.exe编译器作为类gcc的使用方式来编译。<br>也就是说,在指定编译器为<code>asmips.exe</code>的同时,告诉xmake,它跟gcc用法和参数选项基本相同。<br></p>
 
 </p>
 <h6 id="-cc">--cc</h6>
@@ -783,7 +783,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --cc=armv7-linux-clang
 </code></pre>
 <p>如果存在<code>CC</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --cc=gcc@/home/xxx/ccmips.exe</code> 设置ccmips.exe编译器作为类gcc的使用方式来编译。<br>也就是说,在指定编译器为<code>ccmips.exe</code>的同时,告诉xmake,它跟gcc用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --cc=gcc@/home/xxx/ccmips.exe</code> 设置ccmips.exe编译器作为类gcc的使用方式来编译。<br>也就是说,在指定编译器为<code>ccmips.exe</code>的同时,告诉xmake,它跟gcc用法和参数选项基本相同。<br></p>
 
 </p>
 <h6 id="-cxx">--cxx</h6>
@@ -794,7 +794,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --cxx=armv7-linux-clang++
 </code></pre>
 <p>如果存在<code>CXX</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --cxx=clang++@/home/xxx/c++mips.exe</code> 设置c++mips.exe编译器作为类clang++的使用方式来编译。<br>也就是说,在指定编译器为<code>c++mips.exe</code>的同时,告诉xmake,它跟clang++用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么编译器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --cxx=clang++@/home/xxx/c++mips.exe</code> 设置c++mips.exe编译器作为类clang++的使用方式来编译。<br>也就是说,在指定编译器为<code>c++mips.exe</code>的同时,告诉xmake,它跟clang++用法和参数选项基本相同。<br></p>
 
 </p>
 <h6 id="-ld">--ld</h6>
@@ -805,7 +805,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --ld=armv7-linux-clang++
 </code></pre>
 <p>如果存在<code>LD</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --ld=g++@/home/xxx/c++mips.exe</code> 设置c++mips.exe链接器作为类g++的使用方式来编译。<br>也就是说,在指定链接器为<code>c++mips.exe</code>的同时,告诉xmake,它跟g++用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --ld=g++@/home/xxx/c++mips.exe</code> 设置c++mips.exe链接器作为类g++的使用方式来编译。<br>也就是说,在指定链接器为<code>c++mips.exe</code>的同时,告诉xmake,它跟g++用法和参数选项基本相同。<br></p>
 
 </p>
 <h6 id="-sh">--sh</h6>
@@ -815,7 +815,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --sh=armv7-linux-clang++
 </code></pre>
 <p>如果存在<code>SH</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --sh=g++@/home/xxx/c++mips.exe</code> 设置c++mips.exe链接器作为类g++的使用方式来编译。<br>也就是说,在指定链接器为<code>c++mips.exe</code>的同时,告诉xmake,它跟g++用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有gcc, clang等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --sh=g++@/home/xxx/c++mips.exe</code> 设置c++mips.exe链接器作为类g++的使用方式来编译。<br>也就是说,在指定链接器为<code>c++mips.exe</code>的同时,告诉xmake,它跟g++用法和参数选项基本相同。<br></p>
 
 </p>
 <h6 id="-ar">--ar</h6>
@@ -825,7 +825,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p linux --sdk=/user/toolsdk --ar=armv7-linux-ar
 </code></pre>
 <p>如果存在<code>AR</code>环境变量的话,会优先使用当前环境变量中指定的值。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>如果指定的编译器名不是那些xmake内置可识别的名字(带有ar等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --ar=ar@/home/xxx/armips.exe</code> 设置armips.exe链接器作为类ar的使用方式来编译。<br>也就是说,在指定链接器为<code>armips.exe</code>的同时,告诉xmake,它跟ar用法和参数选项基本相同。<br>&lt;/p&gt;
+<p><p class="tip"><br>如果指定的编译器名不是那些xmake内置可识别的名字(带有ar等字样),那么链接器工具检测就会失败。<br>这个时候我们可以通过:<code>xmake f --ar=ar@/home/xxx/armips.exe</code> 设置armips.exe链接器作为类ar的使用方式来编译。<br>也就是说,在指定链接器为<code>armips.exe</code>的同时,告诉xmake,它跟ar用法和参数选项基本相同。<br></p>
 
 </p>
 <h4 id="-">全局配置</h4>
@@ -838,7 +838,7 @@ $ xmake
 $ xmake
 </code></pre>
 <p>以后,就不需要每次重复配置<code>--ndk=</code>参数了。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    每个命令都有其简写,例如: <code>xmake g</code> 或者 <code>xmake global</code>.&lt;br&gt;<br>&lt;/p&gt;
+<p><p class="tip"><br>    每个命令都有其简写,例如: <code>xmake g</code> 或者 <code>xmake global</code>.<br><br></p>
 
 </p>
 <h4 id="-">清除配置</h4>
@@ -853,9 +853,9 @@ $ xmake
 <h2 id="-">语法说明</h2>
 <p>xmake的工程描述文件xmake.lua虽然基于lua语法,但是为了使得更加方便简洁得编写项目构建逻辑,xmake对其进行了一层封装,使得编写xmake.lua不会像些makefile那样繁琐</p>
 <p>基本上写个简单的工程构建描述,只需三行就能搞定,例如:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <h4 id="-">作用域</h4>
 <p>xmake的描述语法是按作用域划分的,主要分为:</p>
@@ -866,11 +866,11 @@ $ xmake
 </ul>
 <p>那哪些属于外部,哪些又属于内部呢,看看下面的注释,就知道个大概了:</p>
 <pre><code class="lang-lua">-- 外部作用域
-target(&quot;test&quot;)
+target("test")
 
     -- 外部作用域
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+    set_kind("binary")
+    add_files("src/*.c")
 
     on_run(function ()
         -- 内部作用域
@@ -881,7 +881,7 @@ target(&quot;test&quot;)
         end)
 
 -- 外部作用域
-task(&quot;hello&quot;)
+task("hello")
 
     -- 外部作用域
     on_run(function ()
@@ -892,15 +892,15 @@ task(&quot;hello&quot;)
 <h5 id="-">外部作用域</h5>
 <p>对于大部分工程来说,并不需要很复杂的工程描述,也不需要自定义脚本支持,只需要简单的 <code>set_xxx</code> 或者 <code>add_xxx</code> 就能满足需求了</p>
 <p>那么根据二八定律,80%的情况下,我们只需要这么写:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;static&quot;)
-    add_files(&quot;src/test/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    add_files("src/test/*.c")
 
-target(&quot;demo&quot;)
-    add_deps(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_links(&quot;test&quot;)
-    add_files(&quot;src/demo/*.c&quot;)
+target("demo")
+    add_deps("test")
+    set_kind("binary")
+    add_links("test")
+    add_files("src/demo/*.c")
 </code></pre>
 <p>不需要复杂的api调用,也不需要各种繁琐的变量定义,以及 if 判断 和 for 循环,要的就是简洁可读,一眼看过去,就算不懂lua语法也没关系</p>
 <p>就当做简单的描述语法,看上去有点像函数调用而已,会点编程的基本一看就知道怎么配置。</p>
@@ -918,12 +918,12 @@ target(&quot;demo&quot;)
 <p>还有些辅助api,例如:</p>
 <p>dirs:扫描获取当前指定路径中的所有目录<br>files:扫描获取当前指定路径中的所有文件<br>format: 格式化字符串,string.format的简写版本</p>
 <p>还有变量定义、逻辑操作也是可以使用的,毕竟是基于lua的,该有的基础语法,还是要有的,我们可以通过if来切换编译文件:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;static&quot;)
-    if is_plat(&quot;iphoneos&quot;) then
-        add_files(&quot;src/test/ios/*.c&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    if is_plat("iphoneos") then
+        add_files("src/test/ios/*.c")
     else
-        add_files(&quot;src/test/*.c&quot;)
+        add_files("src/test/*.c")
     end
 </code></pre>
 <p>需要注意的是,变量定义分全局变量和局部变量,局部变量只对当前xmake.lua有效,不影响子xmake.lua</p>
@@ -933,20 +933,20 @@ local var1 = 0
 -- 全局变量,影响所有之后 includes() 包含的子 xmake.lua 
 var2 = 1
 
-includes(&quot;src&quot;)
+includes("src")
 </code></pre>
 <h5 id="-">内部作用域</h5>
 <p>也称插件、脚本作用域,提供更加复杂、灵活的脚本支持,一般用于编写一些自定义脚本、插件开发、自定义task任务、自定义模块等等</p>
 <p>一般通过<code>function () end</code>包含,并且被传入到<code>on_xxx</code>, <code>before_xxx</code>和<code>after_xxx</code>接口内的,都属于自作用域。</p>
 <p>例如:</p>
 <pre><code class="lang-lua">-- 自定义脚本
-target(&quot;hello&quot;)
+target("hello")
     after_build(function ()
         -- 内部作用域
         end)
 
 -- 自定义任务、插件
-task(&quot;hello&quot;)
+task("hello")
     on_run(function ()
         -- 内部作用域
         end)
@@ -954,13 +954,13 @@ task(&quot;hello&quot;)
 <p>在此作用域中,不仅可以使用大部分lua的api,还可以使用很多xmake提供的扩展模块,所有扩展模块,通过import来导入</p>
 <p>具体可参考:<a href="https://xmake.io/#/zh/manual?id=import">import模块导入文档</a></p>
 <p>这里我们给个简单的例子,在编译完成后,对ios目标程序进行ldid签名:</p>
-<pre><code class="lang-lua">target(&quot;iosdemo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.m&quot;)
+<pre><code class="lang-lua">target("iosdemo")
+    set_kind("binary")
+    add_files("*.m")
     after_build(function (target) 
 
         -- 执行签名,如果失败,自动中断,给出高亮错误信息
-        os.run(&quot;ldid -S$(projectdir)/entitlements.plist %s&quot;, target:targetfile())
+        os.run("ldid -S$(projectdir)/entitlements.plist %s", target:targetfile())
     end)
 </code></pre>
 <p>需要注意的是,在内部作用域中,所有的调用都是启用异常捕获机制的,如果运行出错,会自动中断xmake,并给出错误提示信息</p>
@@ -968,82 +968,82 @@ task(&quot;hello&quot;)
 <h5 id="-">接口作用域</h5>
 <p>在外部作用域中的所有描述api设置,本身也是有作用域之分的,在不同地方调用,影响范围也不相同,例如:</p>
 <pre><code class="lang-lua">-- 全局根作用域,影响所有target,包括includes() 中的子工程target设置
-add_defines(&quot;DEBUG&quot;)
+add_defines("DEBUG")
 
 -- 定义或者进入demo目标作用域(支持多次进入来追加设置)
-target(&quot;demo&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo")
+    set_kind("shared")
+    add_files("src/*.c")
     -- 当前target作用域,仅仅影响当前target
-    add_defines(&quot;DEBUG2&quot;)
+    add_defines("DEBUG2")
 
 -- 选项设置,仅支持局部设置,不受全局api设置所影响
-option(&quot;test&quot;)
+option("test")
     -- 当前选项的局部作用域
     set_default(false)
 
 -- 其他target设置,-DDEBUG 也会被设置上
-target(&quot;demo2&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo2")
+    set_kind("binary")
+    add_files("src/*.c")
 
 -- 重新进入demo目标作用域
-target(&quot;demo&quot;)
+target("demo")
     -- 追加宏定义,只对当前demo目标有效
-    add_defines(&quot;DEBUG3&quot;)
+    add_defines("DEBUG3")
 </code></pre>
 <p>通常情况下,进入另一个target/option域设置,会自动离开上个target/option域,但是有时候为了比较一些作用域污染情况,我们可以显示离开某个域,例如:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_default(false)
 option_end()
 
-target(&quot;demo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+target("demo")
+    set_kind("binary")
+    add_files("src/*.c")
 target_end()
 </code></pre>
 <p>调用<code>option_end()</code>, <code>target_end()</code>即可显式的离开当前target/option域设置。</p>
 <h5 id="-">作用域缩进</h5>
 <p>xmake.lua里面缩进,只是个编写规范,用于更加清楚的区分,当前的设置 是针对 那个作用域的,虽然就算不缩进,也一样ok,但是可读性上 并不是很好。。</p>
 <p>例如:</p>
-<pre><code class="lang-lua">target(&quot;xxxx&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.c&quot;)
+<pre><code class="lang-lua">target("xxxx")
+    set_kind("binary")
+    add_files("*.c")
 </code></pre>
 <p>和</p>
-<pre><code class="lang-lua">target(&quot;xxxx&quot;)
-set_kind(&quot;binary&quot;)
-add_files(&quot;*.c&quot;)
+<pre><code class="lang-lua">target("xxxx")
+set_kind("binary")
+add_files("*.c")
 </code></pre>
 <p>上述两种方式,效果上都是一样的,但是理解上,第一种更加直观,一看就知道<code>add_files</code>仅仅只是针对 target 设置的,并不是全局设置</p>
 <p>因此,适当的进行缩进,有助于更好的维护xmake.lua</p>
 <p>最后附上,tbox的<a href="https://github.com/tboox/tbox/blob/master/src/tbox/xmake.lua">xmake.lua</a>描述,仅供参考。。</p>
 <h4 id="-">语法简化</h4>
 <p>xmake.lua的配置域语法,非常灵活,可以在相关域做各种复杂灵活的配置,但是对于许多精简的小块配置,这个时候就稍显冗余了:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;)
+<pre><code class="lang-lua">option("test1")
     set_default(true)
     set_showmenu(true)
-    set_description(&quot;test1 option&quot;)
+    set_description("test1 option")
 
-option(&quot;test2&quot;)
+option("test2")
     set_default(true)
     set_showmeu(true)
 
-option(&quot;test3&quot;)
-    set_default(&quot;hello&quot;)
+option("test3")
+    set_default("hello")
 </code></pre>
 <p>xmake 2.2.6以上版本,对于上面的这些小块option域设置,我们可以简化下成单行描述:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;, {default = true, showmenu = true, description = &quot;test1 option&quot;})
-option(&quot;test2&quot;, {default = true, showmenu = true})
-option(&quot;test3&quot;, {default = &quot;hello&quot;})
+<pre><code class="lang-lua">option("test1", {default = true, showmenu = true, description = "test1 option"})
+option("test2", {default = true, showmenu = true})
+option("test3", {default = "hello"})
 </code></pre>
 <p>除了option域,对于其他域也是支持这种简化写法的,例如:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
+<pre><code class="lang-lua">target("demo")
+    set_kind("binary")
+    add_files("src/*.c")
 </code></pre>
 <p>简化为:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;, {kind = &quot;binary&quot;, files = &quot;src/*.c&quot;})
+<pre><code class="lang-lua">target("demo", {kind = "binary", files = "src/*.c"})
 </code></pre>
 <p>当然,如果配置需求比较复杂的,还是原有的多行设置方式更加方便,这个就看自己的需求来评估到底使用哪种方式了。</p>
 <h2 id="-">依赖包管理</h2>
@@ -1058,11 +1058,11 @@ option(&quot;test3&quot;, {default = &quot;hello&quot;})
 - pcre.pkg
 - ...
 </code></pre><p>如果要让当前工程识别加载这些包,首先要指定包目录路径,例如:</p>
-<pre><code class="lang-lua">add_packagedirs(&quot;packages&quot;)
+<pre><code class="lang-lua">add_packagedirs("packages")
 </code></pre>
 <p>指定好后,就可以在target作用域中,通过<a href="https://xmake.io/#/zh/manual?id=targetadd_packages">add_packages</a>接口,来添加集成包依赖了,例如:</p>
-<pre><code class="lang-lua">target(&quot;tbox&quot;)
-    add_packages(&quot;zlib&quot;, &quot;polarssl&quot;, &quot;pcre&quot;, &quot;mysql&quot;)
+<pre><code class="lang-lua">target("tbox")
+    add_packages("zlib", "polarssl", "pcre", "mysql")
 </code></pre>
 <p>那么如何去生成一个*.pkg的包呢,如果是基于xmake的工程,生成方式很简单,只需要:</p>
 <pre><code class="lang-console">$ cd tbox
@@ -1083,25 +1083,25 @@ $ xmake package -o ../test/packages
 <li>pkg-config</li>
 </ul>
 <p>并且通过系统和第三方包管理工具进行依赖包的安装,然后与xmake进行集成使用,例如我们查找一个openssl包:</p>
-<pre><code class="lang-lua">local packages = find_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">local packages = find_packages("openssl", "zlib")
 </code></pre>
 <p>返回的结果如下:</p>
 <pre><code class="lang-lua">{
-    {links = {&quot;ssl&quot;, &quot;crypto&quot;}, linkdirs = {&quot;/usr/local/lib&quot;}, includedirs = {&quot;/usr/local/include&quot;}},
-    {links = {&quot;z&quot;}, linkdirs = {&quot;/usr/local/lib&quot;}, includedirs = {&quot;/usr/local/include&quot;}}
+    {links = {"ssl", "crypto"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}},
+    {links = {"z"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}}
 }
 </code></pre>
 <p>如果查找成功,则返回一个包含所有包信息的table,如果失败返回nil</p>
 <p>这里的返回结果可以直接作为<code>target:add</code>, <code>option:add</code>的参数传入,用于动态增加<code>target/option</code>的配置:</p>
-<pre><code class="lang-lua">option(&quot;zlib&quot;)
+<pre><code class="lang-lua">option("zlib")
     set_showmenu(true)
     before_check(function (option)
-        option:add(find_packages(&quot;openssl&quot;, &quot;zlib&quot;))
+        option:add(find_packages("openssl", "zlib"))
     end)
 </code></pre>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
     on_load(function (target)
-        target:add(find_package(&quot;openssl&quot;, &quot;zlib&quot;))
+        target:add(find_package("openssl", "zlib"))
     end)
 </code></pre>
 <p>如果系统上装有<code>homebrew</code>, <code>pkg-config</code>等第三方工具,那么此接口会尝试使用它们去改进查找结果。</p>
@@ -1118,30 +1118,30 @@ $ xmake package -o ../test/packages
 </code></pre>
 <h4 id="-">远程依赖模式</h4>
 <p>这个在2.2.2版本后已经初步支持,用法上更加的简单,只需要设置对应的依赖包就行了,例如:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;libpng ~1.16&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "libpng ~1.16", "zlib")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("tbox", "libpng", "zlib")
 </code></pre>
 <p>上面的<code>add_requires</code>用于描述当前项目需要的依赖包,而<code>add_packages</code>用于应用依赖包到test目标,只有设置这个才会自动追加links, linkdirs, includedirs等设置。</p>
 <p>然后直接执行编译即可:</p>
 <pre><code class="lang-console">$ xmake 
 </code></pre>
 <p>xmake会去远程拉取相关源码包,然后自动编译安装,最后编译项目,进行依赖包的链接,具体效果见下图:</p>
-<p>&lt;img src=&quot;/assets/img/index/package_manage.png&quot; width=&quot;80%&quot; /&gt;</p>
+<p><img src="/assets/img/index/package_manage.png" width="80%" /></p>
 <p>关于包依赖管理的更多相关信息和进展见相关issues:<a href="https://github.com/xmake-io/xmake/issues/69">Remote package management</a> </p>
 <h5 id="-">目前支持的特性</h5>
 <ul>
-<li>语义版本支持,例如:&quot;&gt;= 1.1.0 &lt; 1.2&quot;, &quot;~1.6&quot;, &quot;1.2.x&quot;, &quot;1.*&quot;</li>
+<li>语义版本支持,例如:">= 1.1.0 < 1.2", "~1.6", "1.2.x", "1.*"</li>
 <li>提供官方包仓库、自建私有仓库、项目内置仓库等多仓库管理支持</li>
 <li>跨平台包编译集成支持(不同平台、不同架构的包可同时安装,快速切换使用)</li>
 <li>debug依赖包支持,实现源码调试</li>
 </ul>
 <h5 id="-">依赖包处理机制</h5>
 <p>这里我们简单介绍下整个依赖包的处理机制:</p>
-<p>&lt;img src=&quot;/assets/img/index/package_arch.png&quot; width=&quot;80%&quot; /&gt;</p>
+<p><img src="/assets/img/index/package_arch.png" width="80%" /></p>
 <ol>
 <li>优先检测当前系统目录、第三方包管理下有没有存在指定的包,如果有匹配的包,那么就不需要下载安装了 (当然也可以设置不使用系统包)</li>
 <li>检索匹配对应版本的包,然后下载、编译、安装(注:安装在特定xmake目录,不会干扰系统库环境)</li>
@@ -1164,73 +1164,73 @@ $ xmake
 $ xmake
 </code></pre>
 <h5 id="-">语义版本设置</h5>
-<p>xmake的依赖包管理是完全支持语义版本选择的,例如:&quot;~1.6.1&quot;,对于语义版本的具体描述见:<a href="https://semver.org/">https://semver.org/</a></p>
+<p>xmake的依赖包管理是完全支持语义版本选择的,例如:"~1.6.1",对于语义版本的具体描述见:<a href="https://semver.org/">https://semver.org/</a></p>
 <p>一些语义版本写法:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;pcre 1.3.x&quot;, &quot;libpng ^1.18&quot;)
-add_requires(&quot;libpng ~1.16&quot;, &quot;zlib 1.1.2 || &gt;=1.2.11 &lt;1.3.0&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "pcre 1.3.x", "libpng ^1.18")
+add_requires("libpng ~1.16", "zlib 1.1.2 || >=1.2.11 <1.3.0")
 </code></pre>
 <p>目前xmake使用的语义版本解析器是<a href="https://github.com/uael">uael</a>贡献的<a href="https://github.com/uael/sv">sv</a>库,里面也有对版本描述写法的详细说明,可以参考下:<a href="https://github.com/uael/sv#versions">版本描述说明</a></p>
 <p>当然,如果我们对当前的依赖包的版本没有特殊要求,那么可以直接这么写:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox", "libpng", "zlib")
 </code></pre>
 <p>这会使用已知的最新版本包,或者是master分支的源码编译的包,如果当前包有git repo地址,我们也能指定特定分支版本:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox master&quot;)
-add_requires(&quot;tbox dev&quot;)
+<pre><code class="lang-lua">add_requires("tbox master")
+add_requires("tbox dev")
 </code></pre>
 <h5 id="-">额外的包信息设置</h5>
 <h6 id="-">可选包设置</h6>
 <p>如果指定的依赖包当前平台不支持,或者编译安装失败了,那么xmake会编译报错,这对于有些必须要依赖某些包才能工作的项目,这是合理的。<br>但是如果有些包是可选的依赖,即使没有也可以正常编译使用的话,可以设置为可选包:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {optional = true})
+<pre><code class="lang-lua">add_requires("tbox", {optional = true})
 </code></pre>
 <h6 id="-">禁用系统库</h6>
 <p>默认的设置,xmake会去优先检测系统库是否存在(如果没设置版本要求),如果用户完全不想使用系统库以及第三方包管理提供的库,那么可以设置:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {system = false})
+<pre><code class="lang-lua">add_requires("tbox", {system = false})
 </code></pre>
 <h6 id="-">使用调试版本的包</h6>
 <p>如果我们想同时源码调试依赖包,那么可以设置为使用debug版本的包(当然前提是这个包支持debug编译):</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {debug = true})
+<pre><code class="lang-lua">add_requires("tbox", {debug = true})
 </code></pre>
 <p>如果当前包还不支持debug编译,可在仓库中提交修改编译规则,对debug进行支持,例如:</p>
-<pre><code class="lang-lua">package(&quot;openssl&quot;)
-    on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
-        os.vrun(&quot;./config %s --prefix=\&quot;%s\&quot;&quot;, package:debug() and &quot;--debug&quot; or &quot;&quot;, package:installdir())
-        os.vrun(&quot;make -j4&quot;)
-        os.vrun(&quot;make install&quot;)
+<pre><code class="lang-lua">package("openssl")
+    on_install("linux", "macosx", function (package)
+        os.vrun("./config %s --prefix=\"%s\"", package:debug() and "--debug" or "", package:installdir())
+        os.vrun("make -j4")
+        os.vrun("make install")
     end)
 </code></pre>
 <h6 id="-">传递额外的编译信息到包</h6>
 <p>某些包在编译时候有各种编译选项,我们也可以传递进来,当然包本身得支持:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {configs = {small=true}})
+<pre><code class="lang-lua">add_requires("tbox", {configs = {small=true}})
 </code></pre>
 <p>传递<code>--small=true</code>给tbox包,使得编译安装的tbox包是启用此选项的。</p>
 <h5 id="-">第三方依赖包安装</h5>
 <p>2.2.5版本之后,xmake支持对对第三方包管理器里面的依赖库安装支持,例如:conan,brew, vcpkg等</p>
 <p>添加homebrew的依赖包:</p>
-<pre><code class="lang-lua">add_requires(&quot;brew::zlib&quot;, {alias = &quot;zlib&quot;}})
-add_requires(&quot;brew::pcre2/libpcre2-8&quot;, {alias = &quot;pcre2&quot;}})
+<pre><code class="lang-lua">add_requires("brew::zlib", {alias = "zlib"}})
+add_requires("brew::pcre2/libpcre2-8", {alias = "pcre2"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;pcre2&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("pcre2", "zlib")
 </code></pre>
 <p>添加vcpkg的依赖包:</p>
-<pre><code class="lang-lua">add_requires(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+<pre><code class="lang-lua">add_requires("vcpkg::zlib", "vcpkg::pcre2")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("vcpkg::zlib", "vcpkg::pcre2")
 </code></pre>
 <p>添加conan的依赖包:</p>
-<pre><code class="lang-lua">add_requires(&quot;CONAN::zlib/1.2.11@conan/stable&quot;, {alias = &quot;zlib&quot;, debug = true})
-add_requires(&quot;CONAN::OpenSSL/1.0.2n@conan/stable&quot;, {alias = &quot;openssl&quot;, 
-    configs = {options = &quot;OpenSSL:shared=True&quot;}})
+<pre><code class="lang-lua">add_requires("CONAN::zlib/1.2.11@conan/stable", {alias = "zlib", debug = true})
+add_requires("CONAN::OpenSSL/1.0.2n@conan/stable", {alias = "openssl", 
+    configs = {options = "OpenSSL:shared=True"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("openssl", "zlib")
 </code></pre>
 <p>执行xmake进行编译后:</p>
 <pre><code class="lang-console">ruki:test_package ruki$ xmake
@@ -1238,12 +1238,12 @@ checking for the architecture ... x86_64
 checking for the Xcode directory ... /Applications/Xcode.app
 checking for the SDK version of Xcode ... 10.14
 note: try installing these packages (pass -y to skip confirm)?
-  -&gt; CONAN::zlib/1.2.11@conan/stable  (debug)
-  -&gt; CONAN::OpenSSL/1.0.2n@conan/stable  
+  -> CONAN::zlib/1.2.11@conan/stable  (debug)
+  -> CONAN::OpenSSL/1.0.2n@conan/stable  
 please input: y (y/n)
 
-  =&gt; installing CONAN::zlib/1.2.11@conan/stable .. ok
-  =&gt; installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
+  => installing CONAN::zlib/1.2.11@conan/stable .. ok
+  => installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
 
 [  0%]: ccache compiling.release src/main.c
 [100%]: linking.release test
@@ -1255,7 +1255,7 @@ please input: y (y/n)
 <pre><code class="lang-console">$ xmake repo --add myrepo [email protected]:myrepo/xmake-repo.git
 </code></pre>
 <p>或者我们直接写在xmake.lua中:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo [email protected]:myrepo/xmake-repo.git")
 </code></pre>
 <p>如果我们只是想添加一两个私有包,这个时候特定去建立一个git repo太小题大做了,我们可以直接把包仓库放置项目里面,例如:</p>
 <pre><code>projectdir
@@ -1267,35 +1267,35 @@ please input: y (y/n)
     - main.c
   - xmake.lua
 </code></pre><p>上面myrepo目录就是自己的私有包仓库,内置在自己的项目里面,然后在xmake.lua里面添加一下这个仓库位置:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo myrepo&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo myrepo")
 </code></pre>
 <p>这个可以参考<a href="https://github.com/tboox/benchbox">benchbox</a>项目,里面就内置了一个私有仓库。</p>
 <p>我们甚至可以连仓库也不用建,直接定义包描述到项目xmake.lua中,这对依赖一两个包的情况还是很有用的,例如:</p>
-<pre><code class="lang-lua">package(&quot;libjpeg&quot;)
+<pre><code class="lang-lua">package("libjpeg")
 
-    set_urls(&quot;http://www.ijg.org/files/jpegsrc.$(version).tar.gz&quot;)
+    set_urls("http://www.ijg.org/files/jpegsrc.$(version).tar.gz")
 
-    add_versions(&quot;v9c&quot;, &quot;650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122&quot;)
+    add_versions("v9c", "650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122")
 
-    on_install(&quot;windows&quot;, function (package)
-        os.mv(&quot;jconfig.vc&quot;, &quot;jconfig.h&quot;)
-        os.vrun(&quot;nmake -f makefile.vc&quot;)
-        os.cp(&quot;*.h&quot;, package:installdir(&quot;include&quot;))
-        os.cp(&quot;libjpeg.lib&quot;, package:installdir(&quot;lib&quot;))
+    on_install("windows", function (package)
+        os.mv("jconfig.vc", "jconfig.h")
+        os.vrun("nmake -f makefile.vc")
+        os.cp("*.h", package:installdir("include"))
+        os.cp("libjpeg.lib", package:installdir("lib"))
     end)
 
-    on_install(&quot;macosx&quot;, &quot;linux&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).install(package)
+    on_install("macosx", "linux", function (package)
+        import("package.tools.autoconf").install(package)
     end)
 
 package_end()
 
-add_requires(&quot;libjpeg&quot;)
+add_requires("libjpeg")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;libjpeg&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("libjpeg")
 </code></pre>
 <h5 id="-">包管理命令使用</h5>
 <p>包管理命令<code>$ xmake require</code> 可用于手动显示的下载编译安装、卸载、检索、查看包信息。</p>
@@ -1303,13 +1303,13 @@ target(&quot;test&quot;)
 <pre><code class="lang-console">$ xmake require tbox
 </code></pre>
 <p>安装指定版本包:</p>
-<pre><code class="lang-console">$ xmake require tbox &quot;~1.6&quot;
+<pre><code class="lang-console">$ xmake require tbox "~1.6"
 </code></pre>
 <p>强制重新下载安装,并且显示详细安装信息:</p>
-<pre><code class="lang-console">$ xmake require -f -v tbox &quot;1.5.x&quot;
+<pre><code class="lang-console">$ xmake require -f -v tbox "1.5.x"
 </code></pre>
 <p>传递额外的设置信息:</p>
-<pre><code class="lang-console">$ xmake require --extra=&quot;debug=true,config={small=true}&quot; tbox
+<pre><code class="lang-console">$ xmake require --extra="debug=true,config={small=true}" tbox
 </code></pre>
 <p>安装debug包,并且传递<code>small=true</code>的编译配置信息到包中去。</p>
 <h6 id="-">卸载指定包</h6>

File diff suppressed because it is too large
+ 173 - 173
mirror/zh-cn/manual/builtin_modules.html


+ 29 - 29
mirror/zh-cn/manual/builtin_variables.html

@@ -91,23 +91,23 @@
 }
 </style>
     <p>xmake提供了 <code>$(varname)</code> 的语法,来支持内置变量的获取,例如:</p>
-<pre><code class="lang-lua">add_cxflags(&quot;-I$(buildir)&quot;)
+<pre><code class="lang-lua">add_cxflags("-I$(buildir)")
 </code></pre>
 <p>它将会在在实际编译的时候,将内置的 <code>buildir</code> 变量转换为实际的构建输出目录:<code>-I./build</code></p>
 <p>一般内置变量可用于在传参时快速获取和拼接变量字符串,例如:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
 
     -- 添加工程源码目录下的源文件
-    add_files(&quot;$(projectdir)/src/*.c&quot;)
+    add_files("$(projectdir)/src/*.c")
 
     -- 添加构建目录下的头文件搜索路径
-    add_includedirs(&quot;$(buildir)/inc&quot;)
+    add_includedirs("$(buildir)/inc")
 </code></pre>
 <p>也可以在自定义脚本的模块接口中使用,例如:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
     on_run(function (target)
         -- 复制当前脚本目录下的头文件到输出目录
-        os.cp(&quot;$(scriptdir)/xxx.h&quot;, &quot;$(buildir)/inc&quot;)
+        os.cp("$(scriptdir)/xxx.h", "$(buildir)/inc")
     end)
 </code></pre>
 <p>所有的内置变量,也可以通过<a href="#val">val</a>接口,来获取他们的值。</p>
@@ -124,75 +124,75 @@
 <tr>
 <td><a href="#varos">$(os)</a></td>
 <td>获取当前编译平台的操作系统</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varhost">$(host)</a></td>
 <td>获取本机操作系统</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#vartmpdir">$(tmpdir)</a></td>
 <td>获取临时目录</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varcurdir">$(curdir)</a></td>
 <td>获取当前目录</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varbuildir">$(buildir)</a></td>
 <td>获取构建输出目录</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varscriptdir">$(scriptdir)</a></td>
 <td>获取工程描述脚本目录</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="#varglobaldir">$(globaldir)</a></td>
 <td>获取全局配置目录</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varconfigdir">$(configdir)</a></td>
 <td>获取本地工程配置目录</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varprogramdir">$(programdir)</a></td>
 <td>xmake安装脚本目录</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#varprojectdir">$(projectdir)</a></td>
 <td>获取工程根目录</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varshell">$(shell)</a></td>
 <td>执行外部shell命令</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#varenv">$(env)</a></td>
 <td>获取外部环境变量</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#varreg">$(reg)</a></td>
 <td>获取windows注册表配置项的值</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 </tbody>
 </table>
 <p>当然这种变量模式,也是可以扩展的,默认通过<code>xmake f --var=val</code>命令,配置的参数都是可以直接获取,例如:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_defines(&quot;-DTEST=$(var)&quot;)
+<pre><code class="lang-lua">target("test")
+    add_defines("-DTEST=$(var)")
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>所有<code>xmake f --xxx=...</code>配置的参数值,都是可以通过内置变量获取到,例如:<code>xmake f --arch=x86</code>对应<code>$(arch)</code>,其他的还有<code>$(plat)</code>, <code>$(mode)</code>等等。<br>具体有哪些参数,可以通过:<code>xmake f -h</code>才查看。<br>&lt;/p&gt;
+<p><p class="tip"><br>所有<code>xmake f --xxx=...</code>配置的参数值,都是可以通过内置变量获取到,例如:<code>xmake f --arch=x86</code>对应<code>$(arch)</code>,其他的还有<code>$(plat)</code>, <code>$(mode)</code>等等。<br>具体有哪些参数,可以通过:<code>xmake f -h</code>才查看。<br></p>
 
 </p>
 <p>既然支持直接从配置选项中获取,那么当然也就能很方便的扩展自定义的选项,来获取自定义的变量了,具体如何自定义选项见:<a href="#option">option</a></p>
@@ -231,10 +231,10 @@
 <h4 id="-shell-">执行外部shell命令</h4>
 <p>除了内置的变量处理,xmake还支持原生shell的运行,来处理一些xmake内置不支持的功能</p>
 <p>例如,现在有个需求,我想用在编译linux程序时,调用<code>pkg-config</code>获取到实际的第三方链接库名,可以这么做:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    if is_plat(&quot;linux&quot;) then
-        add_ldflags(&quot;$(shell pkg-config --libs sqlite3)&quot;)
+<pre><code class="lang-lua">target("test")
+    set_kind("binary")
+    if is_plat("linux") then
+        add_ldflags("$(shell pkg-config --libs sqlite3)")
     end
 </code></pre>
 <p>当然,xmake有自己的自动化第三库检测机制,一般情况下不需要这么麻烦,而且lua自身的脚本化已经很不错了。。</p>
@@ -242,13 +242,13 @@
 <h3 id="var-env-">var.$(env)</h3>
 <h4 id="-">获取外部环境变量</h4>
 <p>例如,可以通过获取环境变量中的路径:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_includedirs(&quot;$(env PROGRAMFILES)/OpenSSL/inc&quot;)
+<pre><code class="lang-lua">target("test")
+    add_includedirs("$(env PROGRAMFILES)/OpenSSL/inc")
 </code></pre>
 <h3 id="var-reg-">var.$(reg)</h3>
 <h4 id="-windows-">获取windows注册表配置项的值</h4>
 <p>通过 <code>regpath; name</code> 的方式获取注册表中某个项的值:</p>
-<pre><code class="lang-lua">print(&quot;$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\XXXX;Name)&quot;)
+<pre><code class="lang-lua">print("$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\XXXX;Name)")
 </code></pre>
 </article>
 </body>

+ 63 - 63
mirror/zh-cn/manual/conditions.html

@@ -103,60 +103,60 @@
 <tr>
 <td><a href="#is_os">is_os</a></td>
 <td>判断当前构建目标的操作系统</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_arch">is_arch</a></td>
 <td>判断当前编译架构</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_plat">is_plat</a></td>
 <td>判断当前编译平台</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_host">is_host</a></td>
 <td>判断当前主机环境操作系统</td>
-<td>&gt;= 2.1.4</td>
+<td>>= 2.1.4</td>
 </tr>
 <tr>
 <td><a href="#is_mode">is_mode</a></td>
 <td>判断当前编译模式</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_kind">is_kind</a></td>
 <td>判断当前编译类型</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#is_option">is_option</a></td>
 <td>判断选项是否启用</td>
-<td>&gt;= 2.0.1 &lt; 2.2.2 已废弃</td>
+<td>>= 2.0.1 < 2.2.2 已废弃</td>
 </tr>
 <tr>
 <td><a href="#is_config">is_config</a></td>
 <td>判断指定配置是否为给定的值</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#has_config">has_config</a></td>
 <td>判断配置是否启用或者存在</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#has_package">has_package</a></td>
 <td>判断依赖包是否被启用或者存在</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 </tbody>
 </table>
 <h3 id="is_os">is_os</h3>
 <h4 id="-">判断当前构建目标的操作系统</h4>
 <pre><code class="lang-lua">-- 如果当前操作系统是ios
-if is_os(&quot;ios&quot;) then
-    add_files(&quot;src/xxx/*.m&quot;)
+if is_os("ios") then
+    add_files("src/xxx/*.m")
 end
 </code></pre>
 <p>目前支持的操作系统有:</p>
@@ -171,18 +171,18 @@ end
 <h4 id="-">判断当前编译架构</h4>
 <p>用于检测编译配置:<code>xmake f -a armv7</code></p>
 <pre><code class="lang-lua">-- 如果当前架构是x86_64或者i386
-if is_arch(&quot;x86_64&quot;, &quot;i386&quot;) then
-    add_files(&quot;src/xxx/*.c&quot;)
+if is_arch("x86_64", "i386") then
+    add_files("src/xxx/*.c")
 end
 
 -- 如果当前平台是armv7, arm64, armv7s, armv7-a
-if is_arch(&quot;armv7&quot;, &quot;arm64&quot;, &quot;armv7s&quot;, &quot;armv7-a&quot;) then
+if is_arch("armv7", "arm64", "armv7s", "armv7-a") then
     -- ...
 end
 </code></pre>
 <p>如果像上面那样一个个去判断所有arm架构,也许会很繁琐,毕竟每个平台的架构类型很多,xmake提供了类似<a href="#targetadd_files">add_files</a>中的通配符匹配模式,来更加简洁的进行判断:</p>
 <pre><code class="lang-lua">--如果当前平台是arm平台
-if is_arch(&quot;arm*&quot;) then
+if is_arch("arm*") then
     -- ...
 end
 </code></pre>
@@ -191,13 +191,13 @@ end
 <h4 id="-">判断当前编译平台</h4>
 <p>用于检测编译配置:<code>xmake f -p iphoneos</code></p>
 <pre><code class="lang-lua">-- 如果当前平台是android
-if is_plat(&quot;android&quot;) then
-    add_files(&quot;src/xxx/*.c&quot;)
+if is_plat("android") then
+    add_files("src/xxx/*.c")
 end
 
 -- 如果当前平台是macosx或者iphoneos
-if is_plat(&quot;macosx&quot;, &quot;iphoneos&quot;) then
-    add_frameworks(&quot;Foundation&quot;)
+if is_plat("macosx", "iphoneos") then
+    add_frameworks("Foundation")
 end
 </code></pre>
 <p>目前支持的平台有:</p>
@@ -213,16 +213,16 @@ end
 <p>当然你也可以自己扩展添加自己的平台,甚至直接指定自己的平台名:</p>
 <pre><code class="lang-bash">$ xmake f -p other --sdk=...
 </code></pre>
-<p>如果指定的平台名不存在,就会自动切到<code>cross</code>平台进行交叉编译,但是缺可以通过<code>is_plat(&quot;other&quot;)</code>来判断自己的平台逻辑。</p>
+<p>如果指定的平台名不存在,就会自动切到<code>cross</code>平台进行交叉编译,但是缺可以通过<code>is_plat("other")</code>来判断自己的平台逻辑。</p>
 <h3 id="is_host">is_host</h3>
 <h4 id="-">判断当前主机环境的操作系统</h4>
 <p>有些编译平台是可以在多个不同的操作系统进行构建的,例如:android的ndk就支持linux,macOS还有windows环境。</p>
 <p>这个时候就可以通过这个接口,区分当前是在哪个系统环境下进行的构建。</p>
 <pre><code class="lang-lua">-- 如果当前主机环境是windows
-if is_host(&quot;windows&quot;) then
-    add_includedirs(&quot;C:\\includes&quot;)
+if is_host("windows") then
+    add_includedirs("C:\\includes")
 else
-    add_includedirs(&quot;/usr/includess&quot;)
+    add_includedirs("/usr/includess")
 end
 </code></pre>
 <p>目前支持的主机环境有:</p>
@@ -237,60 +237,60 @@ end
 <p>用于检测编译配置:<code>xmake f -m debug</code></p>
 <p>编译模式的类型并不是内置的,可以自由指定,一般指定:<code>debug</code>, <code>release</code>, <code>profile</code> 这些就够用了,当然你也可以在xmake.lua使用其他模式名来判断。</p>
 <pre><code class="lang-lua">-- 如果当前编译模式是debug
-if is_mode(&quot;debug&quot;) then
+if is_mode("debug") then
 
     -- 添加DEBUG编译宏
-    add_defines(&quot;DEBUG&quot;)
+    add_defines("DEBUG")
 
     -- 启用调试符号
-    set_symbols(&quot;debug&quot;)
+    set_symbols("debug")
 
     -- 禁用优化
-    set_optimize(&quot;none&quot;)
+    set_optimize("none")
 
 end
 
 -- 如果是release或者profile模式
-if is_mode(&quot;release&quot;, &quot;profile&quot;) then
+if is_mode("release", "profile") then
 
     -- 如果是release模式
-    if is_mode(&quot;release&quot;) then
+    if is_mode("release") then
 
         -- 隐藏符号
-        set_symbols(&quot;hidden&quot;)
+        set_symbols("hidden")
 
         -- strip所有符号
-        set_strip(&quot;all&quot;)
+        set_strip("all")
 
         -- 忽略帧指针
-        add_cxflags(&quot;-fomit-frame-pointer&quot;)
-        add_mxflags(&quot;-fomit-frame-pointer&quot;)
+        add_cxflags("-fomit-frame-pointer")
+        add_mxflags("-fomit-frame-pointer")
 
     -- 如果是profile模式
     else
 
         -- 启用调试符号
-        set_symbols(&quot;debug&quot;)
+        set_symbols("debug")
 
     end
 
     -- 添加扩展指令集
-    add_vectorexts(&quot;sse2&quot;, &quot;sse3&quot;, &quot;ssse3&quot;, &quot;mmx&quot;)
+    add_vectorexts("sse2", "sse3", "ssse3", "mmx")
 end
 </code></pre>
 <h3 id="is_kind">is_kind</h3>
 <h4 id="-">判断当前编译类型</h4>
 <p>判断当前是否编译的是动态库还是静态库,用于检测编译配置:<code>xmake f -k [static|shared]</code></p>
 <p>一般用于如下场景:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
 
     -- 通过配置设置目标的kind
-    set_kind(&quot;$(kind)&quot;)
-    add_files(&quot;src/*c&quot;)
+    set_kind("$(kind)")
+    add_files("src/*c")
 
     -- 如果当前编译的是静态库,那么添加指定文件
-    if is_kind(&quot;static&quot;) then
-        add_files(&quot;src/xxx.c&quot;)
+    if is_kind("static") then
+        add_files("src/xxx.c")
     end
 </code></pre>
 <p>编译配置的时候,可手动切换,编译类型:</p>
@@ -304,16 +304,16 @@ $ xmake
 </code></pre>
 <h3 id="is_option">is_option</h3>
 <h4 id="-">判断选项是否启用</h4>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>此接口在2.2.2版本之后已经弃用,请使用<a href="#has_config">has_config</a>来代替。<br>&lt;/p&gt;
+<p><p class="tip"><br>此接口在2.2.2版本之后已经弃用,请使用<a href="#has_config">has_config</a>来代替。<br></p>
 
 </p>
 <p>用于检测自定义的编译配置选型:<code>xmake f --xxxx=y</code></p>
 <p>如果某个自动检测选项、手动设置选项被启用,那么可以通过<code>is_option</code>接口来判断,例如:</p>
 <pre><code class="lang-lua">-- 如果手动启用了xmake f --demo=y 选项
-if is_option(&quot;demo&quot;) then
+if is_option("demo") then
 
     -- 编译demo目录下的代码
-    add_subdirs(&quot;src/demo&quot;)
+    add_subdirs("src/demo")
 end
 </code></pre>
 <h3 id="is_config">is_config</h3>
@@ -323,23 +323,23 @@ end
 <pre><code class="lang-console">$ xmake f --test=hello1
 </code></pre>
 <pre><code class="lang-lua">-- 自定义一个配置选项到命令行菜单
-option(&quot;test&quot;)
-    set_showmenu(&quot;true&quot;)
-    set_description(&quot;The test config option&quot;)
+option("test")
+    set_showmenu("true")
+    set_description("The test config option")
 option_end()
 
 -- 如果自定义的test配置值是hello1或者hello2
-if is_config(&quot;test&quot;, &quot;hello1&quot;, &quot;hello2&quot;) then
-    add_defines(&quot;HELLO&quot;)
+if is_config("test", "hello1", "hello2") then
+    add_defines("HELLO")
 end
 </code></pre>
 <p>不仅如此,我们还可以设置模式匹配规则去判断值,例如:</p>
 <pre><code class="lang-lua">-- 如果自定义的test配置值带有hello前缀
-if is_config(&quot;test&quot;, &quot;hello.*&quot;) then
-    add_defines(&quot;HELLO&quot;)
+if is_config("test", "hello.*") then
+    add_defines("HELLO")
 end
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>此接口不仅能够判断通过<a href="#option">option</a>定义的自定义配置选项,同时还能判断内置的全局配置、本地配置。<br>&lt;/p&gt;
+<p><p class="tip"><br>此接口不仅能够判断通过<a href="#option">option</a>定义的自定义配置选项,同时还能判断内置的全局配置、本地配置。<br></p>
 
 </p>
 <h3 id="has_config">has_config</h3>
@@ -355,8 +355,8 @@ $ xmake f --test1=true
 $ xmake f --test2=value
 </code></pre>
 <pre><code class="lang-lua">-- 如果test1或者test2被设置或者启用
-if has_config(&quot;test1&quot;, &quot;test2&quot;) then
-    add_defines(&quot;TEST&quot;)
+if has_config("test1", "test2") then
+    add_defines("TEST")
 end
 </code></pre>
 <p>而下面的情况则会禁用配置,返回false:</p>
@@ -365,7 +365,7 @@ $ xmake f --test1=n
 $ xmake f --test1=no
 $ xmake f --test1=false
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>此接口不仅能够判断内置的全局配置、本地配置,同时还可以判断通过<a href="#option">option</a>定义的自定义配置选项。<br>&lt;/p&gt;
+<p><p class="tip"><br>此接口不仅能够判断内置的全局配置、本地配置,同时还可以判断通过<a href="#option">option</a>定义的自定义配置选项。<br></p>
 
 
 </p>
@@ -373,19 +373,19 @@ $ xmake f --test1=false
 <h4 id="-">判断依赖包是否启用或者存在</h4>
 <p>此接口从2.2.3版本开始引入,用于检测远程依赖包是否存在或启用,可用于描述域。</p>
 <p>一般配合<a href="/zh-cn/manual/global_interfaces?id=add_requires">add_requires</a>一起使用,例如:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {optional = true})
+<pre><code class="lang-lua">add_requires("tbox", {optional = true})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;)
-    add_packages(&quot;tbox&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_packages("tbox")
 
-    if has_package(&quot;tbox&quot;) then
-        add_defines(&quot;HAVE_TBOX&quot;)
+    if has_package("tbox") then
+        add_defines("HAVE_TBOX")
     end
 </code></pre>
 <p>如果通过<code>add_requires</code>添加的可选依赖包,远程下载安装失败,或者当前平台不支持导致实际上没有被正常安装上,那么<code>has_package</code>就会返回false,<br>表示不存在,然后对其他flags定义甚至源文件编译控制做一些特殊处理。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>此接口跟<a href="#has_config">has_config</a>的区别在于,<a href="#has_config">has_config</a>用于<a href="#option">option</a>,而它用于<a href="#add_requires">add_requires</a>。<br>&lt;/p&gt;
+<p><p class="tip"><br>此接口跟<a href="#has_config">has_config</a>的区别在于,<a href="#has_config">has_config</a>用于<a href="#option">option</a>,而它用于<a href="#add_requires">add_requires</a>。<br></p>
 
 </p>
 </article>

+ 127 - 127
mirror/zh-cn/manual/configuration_option.html

@@ -91,22 +91,22 @@
 }
 </style>
     <p>定义和设置选项开关,每个<code>option</code>对应一个选项,可用于自定义编译配置选项、开关设置。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>除了<code>target</code>以外的所有域接口,例如<code>option</code>,<code>task</code>等的接口,默认不能放置在外面的全局作用域中的(除非部分跟target共用的接口除外)。<br>如果要设置值影响所有<code>option</code>,<code>task</code>等选项,可以通过匿名全局域来设置。<br>&lt;/p&gt;
+<p><p class="tip"><br>除了<code>target</code>以外的所有域接口,例如<code>option</code>,<code>task</code>等的接口,默认不能放置在外面的全局作用域中的(除非部分跟target共用的接口除外)。<br>如果要设置值影响所有<code>option</code>,<code>task</code>等选项,可以通过匿名全局域来设置。<br></p>
 
 </p>
 <p>例如:</p>
 <pre><code class="lang-lua">-- 进入option的匿名全局域,里面的设置会同时影响test和test2选项
 option()
-    add_defines(&quot;DEBUG&quot;)
+    add_defines("DEBUG")
 
-option(&quot;test&quot;)
+option("test")
     -- ... 
     -- 尽量保持缩进,因为这个之后的所有设置,都是针对test选项的
 
-option(&quot;test2&quot;)
+option("test2")
     -- ... 
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br><code>option</code>域是可以重复进入来实现分离设置的,如果要显示离开当前选项的作用域设置,可以手动调用<a href="#option_end">option_end</a>接口。<br>&lt;/p&gt;
+<p><p class="tip"><br><code>option</code>域是可以重复进入来实现分离设置的,如果要显示离开当前选项的作用域设置,可以手动调用<a href="#option_end">option_end</a>接口。<br></p>
 
 
 </p>
@@ -122,232 +122,232 @@ option(&quot;test2&quot;)
 <tr>
 <td><a href="#option">option</a></td>
 <td>定义选项</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#option_end">option_end</a></td>
 <td>结束定义选项</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_deps">add_deps</a></td>
 <td>添加选项依赖</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionbefore_check">before_check</a></td>
 <td>选项检测之前执行此脚本</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionon_check">on_check</a></td>
 <td>自定义选项检测脚本</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionafter_check">after_check</a></td>
 <td>选项检测之后执行此脚本</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionset_values">set_values</a></td>
 <td>设置选项值列表</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#optionset_default">set_default</a></td>
 <td>设置默认值</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionset_showmenu">set_showmenu</a></td>
 <td>设置是否启用菜单显示</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionset_category">set_category</a></td>
 <td>设置选项分类,仅用于菜单显示</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionset_description">set_description</a></td>
 <td>设置菜单显示描述</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_links">add_links</a></td>
 <td>添加链接库检测</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_linkdirs">add_linkdirs</a></td>
 <td>添加链接库检测需要的搜索目录</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_rpathdirs">add_rpathdirs</a></td>
 <td>添加运行时候动态链接库搜索目录</td>
-<td>&gt;= 2.1.3</td>
+<td>>= 2.1.3</td>
 </tr>
 <tr>
 <td><a href="#optionadd_cincludes">add_cincludes</a></td>
 <td>添加c头文件检测</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_cxxincludes">add_cxxincludes</a></td>
 <td>添加c++头文件检测</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_ctypes">add_ctypes</a></td>
 <td>添加c类型检测</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_cxxtypes">add_cxxtypes</a></td>
 <td>添加c++类型检测</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#optionadd_csnippet">add_csnippet</a></td>
 <td>添加c代码片段检测</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#optionadd_cxxsnippet">add_cxxsnippet</a></td>
 <td>添加c++代码片段检测</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetset_warnings">set_warnings</a></td>
 <td>设置警告级别</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetset_optimize">set_optimize</a></td>
 <td>设置优化级别</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetset_languages">set_languages</a></td>
 <td>设置代码语言标准</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_includedirs">add_includedirs</a></td>
 <td>添加头文件搜索目录</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_defines">add_defines</a></td>
 <td>添加宏定义</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_undefines">add_undefines</a></td>
 <td>取消宏定义</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_cflags">add_cflags</a></td>
 <td>添加c编译选项</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_cxflags">add_cxflags</a></td>
 <td>添加c/c++编译选项</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_cxxflags">add_cxxflags</a></td>
 <td>添加c++编译选项</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_mflags">add_mflags</a></td>
 <td>添加objc编译选项</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_mxflags">add_mxflags</a></td>
 <td>添加objc/objc++编译选项</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_mxxflags">add_mxxflags</a></td>
 <td>添加objc++编译选项</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_scflags">add_scflags</a></td>
 <td>添加swift编译选项</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_asflags">add_asflags</a></td>
 <td>添加汇编编译选项</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_gcflags">add_gcflags</a></td>
 <td>添加go编译选项</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_dcflags">add_dcflags</a></td>
 <td>添加dlang编译选项</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_rcflags">add_rcflags</a></td>
 <td>添加rust编译选项</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_cuflags">add_cuflags</a></td>
 <td>添加cuda编译选项</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_culdflags">add_culdflags</a></td>
 <td>添加cuda设备链接选项</td>
-<td>&gt;= 2.2.7</td>
+<td>>= 2.2.7</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_ldflags">add_ldflags</a></td>
 <td>添加链接选项</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_arflags">add_arflags</a></td>
 <td>添加静态库归档选项</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_shflags">add_shflags</a></td>
 <td>添加动态库链接选项</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_languages">add_languages</a></td>
 <td>添加语言标准</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_vectorexts">add_vectorexts</a></td>
 <td>添加向量扩展指令</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_frameworks">add_frameworks</a></td>
 <td>添加链接框架</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_frameworkdirs">add_frameworkdirs</a></td>
 <td>添加链接框架</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 </tbody>
 </table>
@@ -355,14 +355,14 @@ option(&quot;test2&quot;)
 <h4 id="-">定义选项</h4>
 <p>定义和设置选项开关,可用于自定义编译配置选项、开关设置。</p>
 <p>例如,定义一个是否启用test的选项:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_default(false)
     set_showmenu(true)
-    add_defines(&quot;TEST&quot;)
+    add_defines("TEST")
 </code></pre>
 <p>然后关联到指定的target中去:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;)
-    add_options(&quot;test&quot;)
+<pre><code class="lang-lua">target("demo")
+    add_options("test")
 </code></pre>
 <p>这样,一个选项就算定义好了,如果这个选项被启用,那么编译这个target的时候,就会自动加上<code>-DTEST</code>的宏定义。</p>
 <pre><code class="lang-lua"># 手动启用这个选项
@@ -375,17 +375,17 @@ $ xmake
 <h3 id="option-add_deps">option:add_deps</h3>
 <h4 id="-">添加选项依赖</h4>
 <p>通过设置依赖,可以调整选项的检测顺序,一般用于<a href="#optionon_check">on_check</a>等检测脚本的调用时机。</p>
-<pre><code class="lang-lua">option(&quot;small&quot;)
+<pre><code class="lang-lua">option("small")
     set_default(true)
     on_check(function (option)
         -- ...
     end)
 
-option(&quot;test&quot;)
-    add_deps(&quot;small&quot;)
+option("test")
+    add_deps("small")
     set_default(true)
     on_check(function (option)
-        if option:dep(&quot;small&quot;):enabled() then
+        if option:dep("small"):enabled() then
             option:enable(false)
         end
     end)
@@ -394,20 +394,20 @@ option(&quot;test&quot;)
 <h3 id="option-before_check">option:before_check</h3>
 <h4 id="-">选项检测之前执行此脚本</h4>
 <p>例如:在检测之前,通过<a href="#detect-find_package">find_package</a>来查找包,将<code>links</code>, <code>includedirs</code>和<code>linkdirs</code>等信息添加到option中去,<br>然后开始选项检测,通过后就会自动链接到target上。</p>
-<pre><code class="lang-lua">option(&quot;zlib&quot;)
+<pre><code class="lang-lua">option("zlib")
     before_check(function (option)
-        import(&quot;lib.detect.find_package&quot;)
-        option:add(find_package(&quot;zlib&quot;))
+        import("lib.detect.find_package")
+        option:add(find_package("zlib"))
     end)
 </code></pre>
 <h3 id="option-on_check">option:on_check</h3>
 <h4 id="-">自定义选项检测脚本</h4>
 <p>此脚本会覆盖内置的选项检测逻辑。</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    add_deps(&quot;small&quot;)
+<pre><code class="lang-lua">option("test")
+    add_deps("small")
     set_default(true)
     on_check(function (option)
-        if option:dep(&quot;small&quot;):enabled() then
+        if option:dep("small"):enabled() then
             option:enable(false)
         end
     end)
@@ -416,9 +416,9 @@ option(&quot;test&quot;)
 <h3 id="option-after_check">option:after_check</h3>
 <h4 id="-">选项检测之后执行此脚本</h4>
 <p>在选项检测完成后,执行此脚本做一些后期处理,也可以在此时重新禁用选项:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    add_deps(&quot;small&quot;)
-    add_links(&quot;pthread&quot;)
+<pre><code class="lang-lua">option("test")
+    add_deps("small")
+    add_links("pthread")
     after_check(function (option)
         option:enable(false)
     end)
@@ -426,23 +426,23 @@ option(&quot;test&quot;)
 <h3 id="option-set_values">option:set_values</h3>
 <h4 id="-">设置选项值列表</h4>
 <p>仅用于<code>xmake f --menu</code>的图形菜单配置时,提供选项值列表供用户快速选择使用,例如:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    set_default(&quot;b&quot;)
+<pre><code class="lang-lua">option("test")
+    set_default("b")
     set_showmenu(true)
-    set_values(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)
+    set_values("a", "b", "c")
 </code></pre>
 <p>效果图如下:</p>
-<p>&lt;img src=&quot;/assets/img/manual/option_set_values.png&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/manual/option_set_values.png" width="60%" /></p>
 <h3 id="option-set_default">option:set_default</h3>
 <h4 id="-">设置选项默认值</h4>
 <p>在没有通过<code>xmake f --option=[y|n}</code>等命令修改选项值的时候,这个选项本身也是有个默认值的,可以通过这个接口来设置:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     -- 默认禁用这个选项
     set_default(false)
 </code></pre>
 <p>选项的值不仅支持boolean类型,也可以是字符串类型,例如:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
-    set_default(&quot;value&quot;)
+<pre><code class="lang-lua">option("test")
+    set_default("value")
 </code></pre>
 <table>
 <thead>
@@ -468,13 +468,13 @@ option(&quot;test&quot;)
 <p>如果是<code>boolean</code>值的选项,可以通过<a href="#is_option">is_option</a>来进行判断,选项是否被启用。</p>
 <p>如果是<code>string</code>类型的选项,可以在内建变量中直接使用,例如:</p>
 <pre><code class="lang-lua">-- 定义一个路径配置选项,默认使用临时目录
-option(&quot;rootdir&quot;)
-    set_default(&quot;$(tmpdir)&quot;)
+option("rootdir")
+    set_default("$(tmpdir)")
     set_showmenu(true)
 
-target(&quot;test&quot;)
+target("test")
     -- 添加指定选项目录中的源文件
-    add_files(&quot;$(rootdir)/*.c&quot;)
+    add_files("$(rootdir)/*.c")
 </code></pre>
 <p>其中,<code>$(rootdir)</code> 就是自定义的选项内建变量,通过手动配置,可以动态修改它的值:</p>
 <pre><code class="lang-bash">$ xmake f --rootdir=~/projectdir/src
@@ -511,7 +511,7 @@ $ xmake
 <h3 id="option-set_showmenu">option:set_showmenu</h3>
 <h4 id="-">设置是否启用菜单显示</h4>
 <p>如果设置为<code>true</code>,那么在<code>xmake f --help</code>里面就会出现这个选项,也就能通过<code>xmake f --optionname=xxx</code>进行配置,否则只能在<code>xmake.lua</code>内部使用,无法手动配置修改。</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_showmenu(true)
 </code></pre>
 <p>设置为启用菜单后,执行<code>xmake f --help</code>可以看到,帮助菜单里面多了一项:</p>
@@ -523,21 +523,21 @@ $ xmake
 <h4 id="-">设置选项分类,仅用于菜单显示</h4>
 <p>这个是个可选配置,仅用于在帮助菜单中,进行分类显示选项,同一类别的选项,会在同一个分组里面显示,这样菜单看起来更加的美观。</p>
 <p>例如:</p>
-<pre><code class="lang-lua">option(&quot;test1&quot;)
+<pre><code class="lang-lua">option("test1")
     set_showmenu(true)
-    set_category(&quot;test&quot;)
+    set_category("test")
 
-option(&quot;test2&quot;)
+option("test2")
     set_showmenu(true)
-    set_category(&quot;test&quot;)
+    set_category("test")
 
-option(&quot;demo1&quot;)
+option("demo1")
     set_showmenu(true)
-    set_category(&quot;demo&quot;)
+    set_category("demo")
 
-option(&quot;demo2&quot;)
+option("demo2")
     set_showmenu(true)
-    set_category(&quot;demo&quot;)
+    set_category("demo")
 </code></pre>
 <p>这里四个选项分别归类于两个分组:<code>test</code>和<code>demo</code>,那么显示的布局类似这样:</p>
 <pre><code class="lang-bash">Options:
@@ -550,31 +550,31 @@ option(&quot;demo2&quot;)
     --demo2=DEMO2
 </code></pre>
 <p>这个接口,仅仅是为了调整显示布局,更加美观而已,没其他用途。</p>
-<p>在2.1.9版本中,可以通过category设置分级路径名<code>set_category(&quot;root/submenu/submenu2&quot;)</code>,来配置<code>xmake f --menu</code>的图形菜单界面,例如:</p>
+<p>在2.1.9版本中,可以通过category设置分级路径名<code>set_category("root/submenu/submenu2")</code>,来配置<code>xmake f --menu</code>的图形菜单界面,例如:</p>
 <pre><code class="lang-lua">-- &#39;boolean&#39; option
-option(&quot;test1&quot;)
+option("test1")
     set_default(true)
     set_showmenu(true)
-    set_category(&quot;root menu/test1&quot;)
+    set_category("root menu/test1")
 
--- &#39;choice&#39; option with values: &quot;a&quot;, &quot;b&quot;, &quot;c&quot;
-option(&quot;test2&quot;)
-    set_default(&quot;a&quot;)
-    set_values(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)
+-- &#39;choice&#39; option with values: "a", "b", "c"
+option("test2")
+    set_default("a")
+    set_values("a", "b", "c")
     set_showmenu(true)
-    set_category(&quot;root menu/test2&quot;)
+    set_category("root menu/test2")
 
 -- &#39;string&#39; option
-option(&quot;test3&quot;)
-    set_default(&quot;xx&quot;)
+option("test3")
+    set_default("xx")
     set_showmenu(true)
-    set_category(&quot;root menu/test3/test3&quot;)
+    set_category("root menu/test3/test3")
 
 -- &#39;number&#39; option
-option(&quot;test4&quot;)
+option("test4")
     set_default(6)
     set_showmenu(true)
-    set_category(&quot;root menu/test4&quot;)
+    set_category("root menu/test4")
 </code></pre>
 <p>上述配置最后显示的菜单界面路径结构:</p>
 <ul>
@@ -590,14 +590,14 @@ option(&quot;test4&quot;)
 </li>
 </ul>
 <p>效果图如下:</p>
-<p>&lt;img src=&quot;/assets/img/manual/option_set_category.gif&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/manual/option_set_category.gif" width="60%" /></p>
 <h3 id="option-set_description">option:set_description</h3>
 <h4 id="-">设置菜单显示描述</h4>
 <p>设置选项菜单显示时,右边的描述信息,用于帮助用户更加清楚的知道这个选项的用途,例如:</p>
-<pre><code class="lang-lua">option(&quot;test&quot;)
+<pre><code class="lang-lua">option("test")
     set_default(false)
     set_showmenu(true)
-    set_description(&quot;Enable or disable test&quot;)
+    set_description("Enable or disable test")
 </code></pre>
 <p>生成的菜单内容如下:</p>
 <pre><code>Options:
@@ -605,13 +605,13 @@ option(&quot;test4&quot;)
 
     --test=TEST                       Enable or disable test (default: false)
 </code></pre><p>这个接口也支持多行显示,输出更加详细的描述信息,例如:</p>
-<pre><code class="lang-lua">option(&quot;mode&quot;)
-    set_default(&quot;debug&quot;)
+<pre><code class="lang-lua">option("mode")
+    set_default("debug")
     set_showmenu(true)
-    set_description(&quot;Set build mode&quot;,
-                    &quot;    - debug&quot;,
-                    &quot;    - release&quot;,
-                    &quot;    - profile&quot;)
+    set_description("Set build mode",
+                    "    - debug",
+                    "    - release",
+                    "    - profile")
 </code></pre>
 <p>生成的菜单内容如下:</p>
 <pre><code>Options:
@@ -627,13 +627,13 @@ option(&quot;test4&quot;)
 <h3 id="option-add_links">option:add_links</h3>
 <h4 id="-">添加链接库检测</h4>
 <p>如果指定的链接库检测通过,此选项将被启用,并且对应关联的target会自动加上此链接,例如:</p>
-<pre><code class="lang-lua">option(&quot;pthread&quot;)
+<pre><code class="lang-lua">option("pthread")
     set_default(false)
-    add_links(&quot;pthread&quot;)
-    add_linkdirs(&quot;/usr/local/lib&quot;)
+    add_links("pthread")
+    add_linkdirs("/usr/local/lib")
 
-target(&quot;test&quot;)
-    add_options(&quot;pthread&quot;)
+target("test")
+    add_options("pthread")
 </code></pre>
 <p>如果检测通过,<code>test</code>目标编译的时候就会自动加上:<code>-L/usr/local/lib -lpthread</code> 编译选项</p>
 <h3 id="option-add_linkdirs">option:add_linkdirs</h3>
@@ -645,13 +645,13 @@ target(&quot;test&quot;)
 <h3 id="option-add_cincludes">option:add_cincludes</h3>
 <h4 id="-c-">添加c头文件检测</h4>
 <p>如果c头文件检测通过,此选项将被启用,例如:</p>
-<pre><code class="lang-lua">option(&quot;pthread&quot;)
+<pre><code class="lang-lua">option("pthread")
     set_default(false)
-    add_cincludes(&quot;pthread.h&quot;)
-    add_defines(&quot;ENABLE_PTHREAD&quot;)
+    add_cincludes("pthread.h")
+    add_defines("ENABLE_PTHREAD")
 
-target(&quot;test&quot;)
-    add_options(&quot;pthread&quot;)
+target("test")
+    add_options("pthread")
 </code></pre>
 <p>此选项检测是否存在<code>pthread.h</code>的头文件,如果检测通过那么<code>test</code>目标程序将会加上<code>ENABLE_PTHREAD</code>的宏定义。</p>
 <p>如果想要更加灵活的检测,可以通过<a href="#detect-has_cincludes">lib.detect.has_cincludes</a>在<a href="#optionon_check">option.on_check</a>中去实现。</p>
@@ -661,13 +661,13 @@ target(&quot;test&quot;)
 <h3 id="option-add_ctypes">option:add_ctypes</h3>
 <h4 id="-c-">添加c类型检测</h4>
 <p>如果c类型检测通过,此选项将被启用,例如:</p>
-<pre><code class="lang-lua">option(&quot;wchar&quot;)
+<pre><code class="lang-lua">option("wchar")
     set_default(false)
-    add_cincludes(&quot;wchar_t&quot;)
-    add_defines(&quot;HAVE_WCHAR&quot;)
+    add_cincludes("wchar_t")
+    add_defines("HAVE_WCHAR")
 
-target(&quot;test&quot;)
-    add_options(&quot;wchar&quot;)
+target("test")
+    add_options("wchar")
 </code></pre>
 <p>此选项检测是否存在<code>wchar_t</code>的类型,如果检测通过那么<code>test</code>目标程序将会加上<code>HAVE_WCHAR</code>的宏定义。</p>
 <p>如果想要更加灵活的检测,可以通过<a href="#detect-has_ctypes">lib.detect.has_ctypes</a>在<a href="#optionon_check">option.on_check</a>中去实现。</p>
@@ -680,8 +680,8 @@ target(&quot;test&quot;)
 <h3 id="option-add_cxxsnippet">option:add_cxxsnippet</h3>
 <h4 id="-c-">添加c++代码片段检测</h4>
 <p>可以用这个接口实现更加定制化检测一些编译器特性检测,尤其是c++的各种特性的检测支持,例如:</p>
-<pre><code class="lang-lua">option(&quot;constexpr&quot;)
-    add_cxxsnippet(&quot;constexpr&quot;, &quot;constexpr int f(int x) { int sum=0; for (int i=0; i&lt;=x; ++i) sum += i; return sum; } constexpr int x = f(5);  static_assert(x == 15);&quot;)
+<pre><code class="lang-lua">option("constexpr")
+    add_cxxsnippet("constexpr", "constexpr int f(int x) { int sum=0; for (int i=0; i<=x; ++i) sum += i; return sum; } constexpr int x = f(5);  static_assert(x == 15);")
 </code></pre>
 <p>第一个参数设置代码片段的名字作为标示,检测输出信息时候会有显示。</p>
 <p>上述代码,实现对c++的constexpr特性的检测,如果检测通过,则启用constexpr选项,当然这里只是个例子。</p>

+ 217 - 217
mirror/zh-cn/manual/custom_rule.html

@@ -93,29 +93,29 @@
     <p>在2.2.1版本之后,xmake不仅原生内置支持多种语言文件的构建,而且还可以通过自定义构建规则,让用户自己来实现复杂的未知文件构建。</p>
 <p>我们可以通过预先设置规则支持的文件后缀,来扩展其他文件的构建支持:</p>
 <pre><code class="lang-lua">-- 定义一个markdown文件的构建规则
-rule(&quot;markdown&quot;)
-    set_extensions(&quot;.md&quot;, &quot;.markdown&quot;)
+rule("markdown")
+    set_extensions(".md", ".markdown")
     on_build_file(function (target, sourcefile, opt)
-        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. &quot;.html&quot;))
+        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
     end)
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
+target("test")
+    set_kind("binary")
 
     -- 使test目标支持markdown文件的构建规则
-    add_rules(&quot;markdown&quot;)
+    add_rules("markdown")
 
     -- 添加markdown文件的构建
-    add_files(&quot;src/*.md&quot;)
-    add_files(&quot;src/*.markdown&quot;)
+    add_files("src/*.md")
+    add_files("src/*.markdown")
 </code></pre>
 <p>我们也可以指定某些零散的其他文件作为markdown规则来处理:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
     -- ...
-    add_files(&quot;src/test/*.md.in&quot;, {rule = &quot;markdown&quot;})
+    add_files("src/test/*.md.in", {rule = "markdown"})
 </code></pre>
 <p>一个target可以叠加应用多个rules去更加定制化实现自己的构建行为,甚至支持不同的构建环境。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>通过<code>add_files(&quot;*.md&quot;, {rule = &quot;markdown&quot;})</code>方式指定的规则,优先级高于<code>add_rules(&quot;markdown&quot;)</code>设置的规则。<br>&lt;/p&gt;
+<p><p class="tip"><br>通过<code>add_files("*.md", {rule = "markdown"})</code>方式指定的规则,优先级高于<code>add_rules("markdown")</code>设置的规则。<br></p>
 
 </p>
 <table>
@@ -130,157 +130,157 @@ target(&quot;test&quot;)
 <tr>
 <td><a href="#rule">rule</a></td>
 <td>定义规则</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleadd_imports">add_imports</a></td>
 <td>为所有自定义脚本预先导入扩展模块</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleset_extensions">set_extensions</a></td>
 <td>设置规则支持的文件扩展类型</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_load">on_load</a></td>
 <td>自定义加载脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleon_link">on_link</a></td>
 <td>自定义链接脚本</td>
-<td>&gt;= 2.2.7</td>
+<td>>= 2.2.7</td>
 </tr>
 <tr>
 <td><a href="#ruleon_build">on_build</a></td>
 <td>自定义编译脚本</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_clean">on_clean</a></td>
 <td>自定义清理脚本</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_package">on_package</a></td>
 <td>自定义打包脚本</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_install">on_install</a></td>
 <td>自定义安装脚本</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_uninstall">on_uninstall</a></td>
 <td>自定义卸载脚本</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 <tr>
 <td><a href="#ruleon_build_file">on_build_file</a></td>
 <td>自定义编译脚本, 实现单文件构建</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleon_build_files">on_build_files</a></td>
 <td>自定义编译脚本, 实现多文件构建</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_load">before_load</a></td>
 <td>自定义加载前的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_link">before_link</a></td>
 <td>自定义链接前的脚本</td>
-<td>&gt;= 2.2.7</td>
+<td>>= 2.2.7</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_build">before_build</a></td>
 <td>自定义编译前的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_clean">before_clean</a></td>
 <td>自定义清理前的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_package">before_package</a></td>
 <td>自定义打包前的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_install">before_install</a></td>
 <td>自定义安装前的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_uninstall">before_uninstall</a></td>
 <td>自定义卸载前的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_build_file">before_build_file</a></td>
 <td>自定义编译前的脚本, 实现单文件构建</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rulebefore_build_files">before_build_files</a></td>
 <td>自定义编译前的脚本, 实现多文件构建</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_load">after_load</a></td>
 <td>自定义加载后的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_link">after_link</a></td>
 <td>自定义链接后的脚本</td>
-<td>&gt;= 2.2.7</td>
+<td>>= 2.2.7</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_build">after_build</a></td>
 <td>自定义编译后的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_clean">after_clean</a></td>
 <td>自定义清理后的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_package">after_package</a></td>
 <td>自定义打包后的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_install">after_install</a></td>
 <td>自定义安装后的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_uninstall">after_uninstall</a></td>
 <td>自定义卸载后的脚本</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_build_file">after_build_file</a></td>
 <td>自定义编译后的脚本, 实现单文件构建</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#ruleafter_build_files">after_build_files</a></td>
 <td>自定义编译后的脚本, 实现多文件构建</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#rule_end">rule_end</a></td>
 <td>结束定义规则</td>
-<td>&gt;= 2.1.9</td>
+<td>>= 2.1.9</td>
 </tr>
 </tbody>
 </table>
@@ -298,142 +298,142 @@ target(&quot;test&quot;)
 <tr>
 <td><a href="#mode-debug">mode.debug</a></td>
 <td>调试模式编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-release">mode.release</a></td>
 <td>发布模式编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-releasedbg">mode.releasedbg</a></td>
 <td>发布模式编译规则(带调试符号)</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#mode-minsizerel">mode.minsizerel</a></td>
 <td>发布模式编译规则(最小编译)</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#mode-check">mode.check</a></td>
 <td>检测模式编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-profile">mode.profile</a></td>
 <td>性能分析模式编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-coverage">mode.coverage</a></td>
 <td>覆盖分析编译模式规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#mode-valgrind">mode.valgrind</a></td>
 <td>Valgrind分析检测模式规则</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#mode-asan">mode.asan</a></td>
 <td>AddressSanitizer分析检测模式规则</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#mode-tsan">mode.tsan</a></td>
 <td>ThreadSanitizer分析检测模式规则</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#mode-lsan">mode.lsan</a></td>
 <td>LeakSanitizer分析检测模式规则</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#mode-ubsan">mode.ubsan</a></td>
 <td>UndefinedBehaviorSanitizer分析检测模式规则</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#qt-static">qt.static</a></td>
 <td>Qt静态库编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#qt-shared">qt.shared</a></td>
 <td>Qt动态库编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#qt-console">qt.console</a></td>
 <td>Qt控制台编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#qt-quickapp">qt.quickapp</a></td>
 <td>Qt QuickApp应用程序编译规则</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 <tr>
 <td><a href="#qt-quickapp_static">qt.quickapp_static</a></td>
 <td>Qt QuickApp应用程序编译规则(静态链接)</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 <tr>
 <td><a href="#qt-widgetapp">qt.widgetapp</a></td>
 <td>Qt WidgetApp应用程序编译规则</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 <tr>
 <td><a href="#qt-widgetapp_static">qt.widgetapp_static</a></td>
 <td>Qt WidgetApp应用程序编译规则(静态链接)</td>
-<td>&gt;= 2.2.3</td>
+<td>>= 2.2.3</td>
 </tr>
 <tr>
 <td><a href="#xcode-bundle">xcode.bundle</a></td>
 <td>Xcode Bundle编译规则</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#xcode-framework">xcode.framework</a></td>
 <td>Xcode Framework编译规则</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#xcode-application">xcode.application</a></td>
 <td>Xcode iOS/MacOS App编译规则</td>
-<td>&gt;= 2.3.3</td>
+<td>>= 2.3.3</td>
 </tr>
 <tr>
 <td><a href="#wdk-umdf-driver">wdk.umdf.driver</a></td>
 <td>WDK环境umdf驱动编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-umdf-binary">wdk.umdf.binary</a></td>
 <td>WDK环境umdf驱动应用编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-kmdf-driver">wdk.kmdf.driver</a></td>
 <td>WDK环境kmdf驱动编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-kmdf-binary">wdk.kmdf.binary</a></td>
 <td>WDK环境kmdf驱动应用编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-wdm-driver">wdk.wdm.driver</a></td>
 <td>WDK环境wdm驱动编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 <tr>
 <td><a href="#wdk-wdm-binary">wdk.wdm.binary</a></td>
 <td>WDK环境wdm驱动应用编译规则</td>
-<td>&gt;= 2.2.1</td>
+<td>>= 2.2.1</td>
 </tr>
 </tbody>
 </table>
@@ -442,190 +442,190 @@ target(&quot;test&quot;)
 </code></pre>
 <h4 id="mode-debug">mode.debug</h4>
 <p>为当前工程xmake.lua添加debug编译模式的配置规则,例如:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.debug&quot;)
+<pre><code class="lang-lua">add_rules("mode.debug")
 </code></pre>
 <p>相当于:</p>
-<pre><code class="lang-lua">if is_mode(&quot;debug&quot;) then
-    set_symbols(&quot;debug&quot;)
-    set_optimize(&quot;none&quot;)
+<pre><code class="lang-lua">if is_mode("debug") then
+    set_symbols("debug")
+    set_optimize("none")
 end
 </code></pre>
 <p>我们可以通过:<code>xmake f -m debug</code>来切换到此编译模式。</p>
 <h4 id="mode-release">mode.release</h4>
 <p>为当前工程xmake.lua添加release编译模式的配置规则,例如:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.release&quot;)
+<pre><code class="lang-lua">add_rules("mode.release")
 </code></pre>
-<p>!&gt; 此模式默认不会带调试符号。</p>
+<p>!> 此模式默认不会带调试符号。</p>
 <p>相当于:</p>
-<pre><code class="lang-lua">if is_mode(&quot;release&quot;) then
-    set_symbols(&quot;hidden&quot;)
-    set_optimize(&quot;fastest&quot;)
-    set_strip(&quot;all&quot;)
+<pre><code class="lang-lua">if is_mode("release") then
+    set_symbols("hidden")
+    set_optimize("fastest")
+    set_strip("all")
 end
 </code></pre>
 <p>我们可以通过:<code>xmake f -m release</code>来切换到此编译模式。</p>
 <h4 id="mode-releasedbg">mode.releasedbg</h4>
 <p>为当前工程xmake.lua添加releasedbg编译模式的配置规则,例如:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.releasedbg&quot;)
+<pre><code class="lang-lua">add_rules("mode.releasedbg")
 </code></pre>
-<p>!&gt; 与release模式相比,此模式还会额外开启调试符号,这通常是非常有用的。</p>
+<p>!> 与release模式相比,此模式还会额外开启调试符号,这通常是非常有用的。</p>
 <p>相当于:</p>
-<pre><code class="lang-lua">if is_mode(&quot;releasedbg&quot;) then
-    set_symbols(&quot;debug&quot;)
-    set_optimize(&quot;fastest&quot;)
-    set_strip(&quot;all&quot;)
+<pre><code class="lang-lua">if is_mode("releasedbg") then
+    set_symbols("debug")
+    set_optimize("fastest")
+    set_strip("all")
 end
 </code></pre>
 <p>我们可以通过:<code>xmake f -m releasedbg</code>来切换到此编译模式。</p>
 <h4 id="mode-minsizerel">mode.minsizerel</h4>
 <p>为当前工程xmake.lua添加minsizerel编译模式的配置规则,例如:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.minsizerel&quot;)
+<pre><code class="lang-lua">add_rules("mode.minsizerel")
 </code></pre>
-<p>!&gt; 与release模式相比,此模式更加倾向于最小代码编译优化,而不是速度优先。</p>
+<p>!> 与release模式相比,此模式更加倾向于最小代码编译优化,而不是速度优先。</p>
 <p>相当于:</p>
-<pre><code class="lang-lua">if is_mode(&quot;minsizerel&quot;) then
-    set_symbols(&quot;hidden&quot;)
-    set_optimize(&quot;smallest&quot;)
-    set_strip(&quot;all&quot;)
+<pre><code class="lang-lua">if is_mode("minsizerel") then
+    set_symbols("hidden")
+    set_optimize("smallest")
+    set_strip("all")
 end
 </code></pre>
 <p>我们可以通过:<code>xmake f -m minsizerel</code>来切换到此编译模式。</p>
 <h4 id="mode-check">mode.check</h4>
 <p>为当前工程xmake.lua添加check编译模式的配置规则,一般用于内存检测,例如:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.check&quot;)
+<pre><code class="lang-lua">add_rules("mode.check")
 </code></pre>
 <p>相当于:</p>
-<pre><code class="lang-lua">if is_mode(&quot;check&quot;) then
-    set_symbols(&quot;debug&quot;)
-    set_optimize(&quot;none&quot;)
-    add_cxflags(&quot;-fsanitize=address&quot;, &quot;-ftrapv&quot;)
-    add_mxflags(&quot;-fsanitize=address&quot;, &quot;-ftrapv&quot;)
-    add_ldflags(&quot;-fsanitize=address&quot;)
+<pre><code class="lang-lua">if is_mode("check") then
+    set_symbols("debug")
+    set_optimize("none")
+    add_cxflags("-fsanitize=address", "-ftrapv")
+    add_mxflags("-fsanitize=address", "-ftrapv")
+    add_ldflags("-fsanitize=address")
 end
 </code></pre>
 <p>我们可以通过:<code>xmake f -m check</code>来切换到此编译模式。</p>
 <h4 id="mode-profile">mode.profile</h4>
 <p>为当前工程xmake.lua添加profile编译模式的配置规则,一般用于性能分析,例如:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.profile&quot;)
+<pre><code class="lang-lua">add_rules("mode.profile")
 </code></pre>
 <p>相当于:</p>
-<pre><code class="lang-lua">if is_mode(&quot;profile&quot;) then
-    set_symbols(&quot;debug&quot;)
-    add_cxflags(&quot;-pg&quot;)
-    add_ldflags(&quot;-pg&quot;)
+<pre><code class="lang-lua">if is_mode("profile") then
+    set_symbols("debug")
+    add_cxflags("-pg")
+    add_ldflags("-pg")
 end
 </code></pre>
 <p>我们可以通过:<code>xmake f -m profile</code>来切换到此编译模式。</p>
 <h4 id="mode-coverage">mode.coverage</h4>
 <p>为当前工程xmake.lua添加coverage编译模式的配置规则,一般用于覆盖分析,例如:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.coverage&quot;)
+<pre><code class="lang-lua">add_rules("mode.coverage")
 </code></pre>
 <p>相当于:</p>
-<pre><code class="lang-lua">if is_mode(&quot;coverage&quot;) then
-    add_cxflags(&quot;--coverage&quot;)
-    add_mxflags(&quot;--coverage&quot;)
-    add_ldflags(&quot;--coverage&quot;)
+<pre><code class="lang-lua">if is_mode("coverage") then
+    add_cxflags("--coverage")
+    add_mxflags("--coverage")
+    add_ldflags("--coverage")
 end
 </code></pre>
 <p>我们可以通过:<code>xmake f -m coverage</code>来切换到此编译模式。</p>
 <h4 id="mode-valgrind">mode.valgrind</h4>
 <p>此模式提供valgrind内存分析检测支持。</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.valgrind&quot;)
+<pre><code class="lang-lua">add_rules("mode.valgrind")
 </code></pre>
 <p>我们可以通过:<code>xmake f -m valgrind</code>来切换到此编译模式。</p>
 <h4 id="mode-asan">mode.asan</h4>
 <p>此模式提供AddressSanitizer内存分析检测支持。</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.asan&quot;)
+<pre><code class="lang-lua">add_rules("mode.asan")
 </code></pre>
 <p>我们可以通过:<code>xmake f -m asan</code>来切换到此编译模式。</p>
 <h4 id="mode-tsan">mode.tsan</h4>
 <p>此模式提供ThreadSanitizer内存分析检测支持。</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.tsan&quot;)
+<pre><code class="lang-lua">add_rules("mode.tsan")
 </code></pre>
 <p>我们可以通过:<code>xmake f -m tsan</code>来切换到此编译模式。</p>
 <h4 id="mode-lsan">mode.lsan</h4>
 <p>此模式提供LeakSanitizer内存分析检测支持。</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.lsan&quot;)
+<pre><code class="lang-lua">add_rules("mode.lsan")
 </code></pre>
 <p>我们可以通过:<code>xmake f -m lsan</code>来切换到此编译模式。</p>
 <h4 id="mode-ubsan">mode.ubsan</h4>
 <p>此模式提供UndefinedBehaviorSanitizer内存分析检测支持。</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.ubsan&quot;)
+<pre><code class="lang-lua">add_rules("mode.ubsan")
 </code></pre>
 <p>我们可以通过:<code>xmake f -m ubsan</code>来切换到此编译模式。</p>
 <h4 id="qt-static">qt.static</h4>
 <p>用于编译生成Qt环境的静态库程序:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.static&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.static")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h4 id="qt-shared">qt.shared</h4>
 <p>用于编译生成Qt环境的动态库程序:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.shared&quot;)
-    add_files(&quot;src/*.cpp&quot;)
-    add_frameworks(&quot;QtNetwork&quot;, &quot;QtGui&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.shared")
+    add_files("src/*.cpp")
+    add_frameworks("QtNetwork", "QtGui")
 </code></pre>
 <h4 id="qt-console">qt.console</h4>
 <p>用于编译生成Qt环境的控制台程序:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.console&quot;)
-    add_files(&quot;src/*.cpp&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.console")
+    add_files("src/*.cpp")
 </code></pre>
 <h4 id="qt-quickapp">qt.quickapp</h4>
 <p>用于编译生成Qt环境的Quick(qml) ui应用程序。</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.quickapp&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/qml.qrc&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.quickapp")
+    add_files("src/*.cpp") 
+    add_files("src/qml.qrc")
 </code></pre>
 <h4 id="qt-quickapp_static">qt.quickapp_static</h4>
 <p>用于编译生成Qt环境的Quick(qml) ui应用程序(静态链接版本)。</p>
-<p>!&gt; 需要切换到静态库版本Qt SDK</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.quickapp_static&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/qml.qrc&quot;)
+<p>!> 需要切换到静态库版本Qt SDK</p>
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.quickapp_static")
+    add_files("src/*.cpp") 
+    add_files("src/qml.qrc")
 </code></pre>
 <h4 id="qt-widgetapp">qt.widgetapp</h4>
 <p>用于编译Qt Widgets(ui/moc)应用程序</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.widgetapp&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;)  -- 添加带有 Q_OBJECT 的meta头文件
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.widgetapp")
+    add_files("src/*.cpp") 
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
 </code></pre>
 <h4 id="qt-widgetapp_static">qt.widgetapp_static</h4>
 <p>用于编译Qt Widgets(ui/moc)应用程序(静态库版本)</p>
-<p>!&gt; 需要切换到静态库版本Qt SDK</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;qt.widgetapp_static&quot;)
-    add_files(&quot;src/*.cpp&quot;) 
-    add_files(&quot;src/mainwindow.ui&quot;)
-    add_files(&quot;src/mainwindow.h&quot;)  -- 添加带有 Q_OBJECT 的meta头文件
+<p>!> 需要切换到静态库版本Qt SDK</p>
+<pre><code class="lang-lua">target("test")
+    add_rules("qt.widgetapp_static")
+    add_files("src/*.cpp") 
+    add_files("src/mainwindow.ui")
+    add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
 </code></pre>
 <p>更多Qt相关描述见:<a href="https://github.com/xmake-io/xmake/issues/160">#160</a></p>
 <h4 id="xcode-bundle">xcode.bundle</h4>
 <p>用于编译生成ios/macos bundle程序</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.bundle&quot;)
-    add_files(&quot;src/*.m&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.bundle")
+    add_files("src/*.m")
+    add_files("src/Info.plist")
 </code></pre>
 <h4 id="xcode-framework">xcode.framework</h4>
 <p>用于编译生成ios/macos framework程序</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.framework&quot;)
-    add_files(&quot;src/*.m&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.framework")
+    add_files("src/*.m")
+    add_files("src/Info.plist")
 </code></pre>
 <h4 id="xcode-application">xcode.application</h4>
 <p>用于编译生成ios/macos应用程序</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
-    add_rules(&quot;xcode.application&quot;)
-    add_files(&quot;src/*.m&quot;, &quot;src/**.storyboard&quot;, &quot;src/*.xcassets&quot;)
-    add_files(&quot;src/Info.plist&quot;)
+<pre><code class="lang-lua">target("test")
+    add_rules("xcode.application")
+    add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
+    add_files("src/Info.plist")
 </code></pre>
 <h4 id="wdk-env-kmdf">wdk.env.kmdf</h4>
 <p>应用WDK下kmdf的编译环境设置,需要配合:<code>wdk.[driver|binary|static|shared]</code>等规则来使用。</p>
@@ -637,98 +637,98 @@ end
 <p>编译生成windows下基于WDK环境的驱动程序,目前仅支持WDK10环境。</p>
 <p>注:需要配合:<code>wdk.env.[umdf|kmdf|wdm]</code>等环境规则使用。</p>
 <pre><code class="lang-lua">-- add target
-target(&quot;echo&quot;)
+target("echo")
 
     -- add rules
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.kmdf&quot;)
+    add_rules("wdk.driver", "wdk.env.kmdf")
 
     -- add files
-    add_files(&quot;driver/*.c&quot;) 
-    add_files(&quot;driver/*.inx&quot;)
+    add_files("driver/*.c") 
+    add_files("driver/*.inx")
 
     -- add includedirs
-    add_includedirs(&quot;exe&quot;)
+    add_includedirs("exe")
 </code></pre>
 <h4 id="wdk-binary">wdk.binary</h4>
 <p>编译生成windows下基于WDK环境的可执行程序,目前仅支持WDK10环境。</p>
 <p>注:需要配合:<code>wdk.env.[umdf|kmdf|wdm]</code>等环境规则使用。</p>
 <pre><code class="lang-lua">-- add target
-target(&quot;app&quot;)
+target("app")
 
     -- add rules
-    add_rules(&quot;wdk.binary&quot;, &quot;wdk.env.umdf&quot;)
+    add_rules("wdk.binary", "wdk.env.umdf")
 
     -- add files
-    add_files(&quot;exe/*.cpp&quot;) 
+    add_files("exe/*.cpp") 
 </code></pre>
 <h4 id="wdk-static">wdk.static</h4>
 <p>编译生成windows下基于WDK环境的静态库程序,目前仅支持WDK10环境。</p>
 <p>注:需要配合:<code>wdk.env.[umdf|kmdf|wdm]</code>等环境规则使用。</p>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
+<pre><code class="lang-lua">target("nonpnp")
 
     -- add rules
-    add_rules(&quot;wdk.static&quot;, &quot;wdk.env.kmdf&quot;)
+    add_rules("wdk.static", "wdk.env.kmdf")
 
     -- add flags for rule: wdk.tracewpp
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
 
     -- add files
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
+    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
 </code></pre>
 <h4 id="wdk-shared">wdk.shared</h4>
 <p>编译生成windows下基于WDK环境的动态库程序,目前仅支持WDK10环境。</p>
 <p>注:需要配合:<code>wdk.env.[umdf|kmdf|wdm]</code>等环境规则使用。</p>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
+<pre><code class="lang-lua">target("nonpnp")
 
     -- add rules
-    add_rules(&quot;wdk.shared&quot;, &quot;wdk.env.wdm&quot;)
+    add_rules("wdk.shared", "wdk.env.wdm")
 
     -- add flags for rule: wdk.tracewpp
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
 
     -- add files
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
+    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
 </code></pre>
 <h4 id="wdk-tracewpp">wdk.tracewpp</h4>
 <p>用于启用tracewpp预处理源文件:</p>
-<pre><code class="lang-lua">target(&quot;nonpnp&quot;)
+<pre><code class="lang-lua">target("nonpnp")
 
     -- add rules
-    add_rules(&quot;wdk.driver&quot;, &quot;wdk.env.kmdf&quot;)
+    add_rules("wdk.driver", "wdk.env.kmdf")
 
     -- add flags for rule: wdk.tracewpp
-    add_values(&quot;wdk.tracewpp.flags&quot;, &quot;-func:TraceEvents(LEVEL,FLAGS,MSG,...)&quot;, &quot;-func:Hexdump((LEVEL,FLAGS,MSG,...))&quot;)
+    add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
 
     -- add files
-    add_files(&quot;driver/*.c&quot;, {rule = &quot;wdk.tracewpp&quot;}) 
-    add_files(&quot;driver/*.rc&quot;)
+    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.rc")
 </code></pre>
 <p>更多WDK规则描述见:<a href="https://github.com/xmake-io/xmake/issues/159">#159</a></p>
 <h4 id="win-sdk-application">win.sdk.application</h4>
 <p>编译生成winsdk应用程序。</p>
 <pre><code class="lang-lua">-- add rules
-add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)
+add_rules("mode.debug", "mode.release")
 
 -- define target
-target(&quot;usbview&quot;)
+target("usbview")
 
     -- windows application
-    add_rules(&quot;win.sdk.application&quot;)
+    add_rules("win.sdk.application")
 
     -- add files
-    add_files(&quot;*.c&quot;, &quot;*.rc&quot;)
-    add_files(&quot;xmlhelper.cpp&quot;, {rule = &quot;win.sdk.dotnet&quot;})
+    add_files("*.c", "*.rc")
+    add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
 </code></pre>
 <h4 id="wdk-sdk-dotnet">wdk.sdk.dotnet</h4>
 <p>用于指定某些c++源文件作为c++.net来编译。</p>
-<pre><code class="lang-lua">add_files(&quot;xmlhelper.cpp&quot;, {rule = &quot;win.sdk.dotnet&quot;})
+<pre><code class="lang-lua">add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
 </code></pre>
 <h3 id="rule">rule</h3>
 <h4 id="-">定义规则</h4>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
-    set_extensions(&quot;.md&quot;, &quot;.markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
+    set_extensions(".md", ".markdown")
     on_build_file(function (target, sourcefile, opt)
-        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. &quot;.html&quot;))
+        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
     end)
 </code></pre>
 <h3 id="rule-add_imports">rule:add_imports</h3>
@@ -738,48 +738,48 @@ target(&quot;usbview&quot;)
 <h4 id="-">设置规则支持的文件扩展类型</h4>
 <p>通过设置支持的扩展文件类型,将规则应用于带这些后缀的文件上,例如:</p>
 <pre><code class="lang-lua">-- 定义一个markdown文件的构建规则
-rule(&quot;markdown&quot;)
-    set_extensions(&quot;.md&quot;, &quot;.markdown&quot;)
+rule("markdown")
+    set_extensions(".md", ".markdown")
     on_build_file(function (target, sourcefile, opt)
-        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. &quot;.html&quot;))
+        os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
     end)
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
+target("test")
+    set_kind("binary")
 
     -- 使test目标支持markdown文件的构建规则
-    add_rules(&quot;markdown&quot;)
+    add_rules("markdown")
 
     -- 添加markdown文件的构建
-    add_files(&quot;src/*.md&quot;)
-    add_files(&quot;src/*.markdown&quot;)
+    add_files("src/*.md")
+    add_files("src/*.markdown")
 </code></pre>
 <h3 id="rule-on_load">rule:on_load</h3>
 <h4 id="-">自定义加载脚本</h4>
 <p>用于实现自定规则的加载脚本,当加载target的时候,会被执行,可在里面自定义设置一些target配置,例如:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     on_load(function (target)
-        target:add(&quot;defines&quot;, &quot;-DTEST&quot;)
+        target:add("defines", "-DTEST")
     end)
 </code></pre>
 <h3 id="rule-on_link">rule:on_link</h3>
 <h4 id="-">自定义链接脚本</h4>
 <p>用于实现自定规则的链接脚本,会覆盖被应用的target的默认链接行为,例如:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     on_link(function (target)
     end)
 </code></pre>
 <h3 id="rule-on_build">rule:on_build</h3>
 <h4 id="-">自定义编译脚本</h4>
 <p>用于实现自定规则的构建脚本,会覆盖被应用的target的默认构建行为,例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_build(function (target)
     end)
 </code></pre>
 <h3 id="rule-on_clean">rule:on_clean</h3>
 <h4 id="-">自定义清理脚本</h4>
 <p>用于实现自定规则的清理脚本会,覆盖被应用的target的默认清理行为,例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_clean(function (target)
         -- remove sourcefile.html
     end)
@@ -787,7 +787,7 @@ target(&quot;test&quot;)
 <h3 id="rule-on_package">rule:on_package</h3>
 <h4 id="-">自定义打包脚本</h4>
 <p>用于实现自定规则的打包脚本,覆盖被应用的target的默认打包行为, 例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_package(function (target)
         -- package sourcefile.html
     end)
@@ -795,31 +795,31 @@ target(&quot;test&quot;)
 <h3 id="rule-on_install">rule:on_install</h3>
 <h4 id="-">自定义安装脚本</h4>
 <p>用于实现自定规则的安装脚本,覆盖被应用的target的默认安装行为, 例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_install(function (target)
     end)
 </code></pre>
 <h3 id="rule-on_uninstall">rule:on_uninstall</h3>
 <h4 id="-">自定义卸载脚本</h4>
 <p>用于实现自定规则的卸载脚本,覆盖被应用的target的默认卸载行为, 例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_uninstall(function (target)
     end)
 </code></pre>
 <h3 id="rule-on_build_file">rule:on_build_file</h3>
 <h4 id="-">自定义编译脚本,一次处理一个源文件</h4>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_build_file(function (target, sourcefile, opt)
-        print(&quot;%%%d: %s&quot;, opt.progress, sourcefile)
+        print("%%%d: %s", opt.progress, sourcefile)
     end)
 </code></pre>
 <p>其中第三个参数opt是可选参数,用于获取一些编译过程中的信息状态,例如:opt.progress 为当期的编译进度。</p>
 <h3 id="rule-on_build_files">rule:on_build_files</h3>
 <h4 id="-">自定义编译脚本,一次处理多个源文件</h4>
-<p>大部分的自定义构建规则,每次都是处理单独一个文件,输出一个目标文件,例如:a.c =&gt; a.o</p>
-<p>但是,有些情况下,我们需要同时输入多个源文件一起构建生成一个目标文件,例如:a.c b.c d.c =&gt; x.o</p>
+<p>大部分的自定义构建规则,每次都是处理单独一个文件,输出一个目标文件,例如:a.c => a.o</p>
+<p>但是,有些情况下,我们需要同时输入多个源文件一起构建生成一个目标文件,例如:a.c b.c d.c => x.o</p>
 <p>对于这种情况,我们可以通过自定义这个脚本来实现:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     on_build_files(function (target, sourcebatch, opt)
         -- build some source files
         for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
@@ -830,50 +830,50 @@ target(&quot;test&quot;)
 <h3 id="rule-before_load">rule:before_load</h3>
 <h4 id="-">自定义加载前脚本</h4>
 <p>用于实现自定义target加载前的执行脚本,例如:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     before_load(function (target)
-        target:add(&quot;defines&quot;, &quot;-DTEST&quot;)
+        target:add("defines", "-DTEST")
     end)
 </code></pre>
 <h3 id="rule-before_link">rule:before_link</h3>
 <h4 id="-">自定义链接前脚本</h4>
 <p>用于实现自定义target链接前的执行脚本,例如:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     before_link(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_build">rule:before_build</h3>
 <h4 id="-">自定义编译前脚本</h4>
 <p>用于实现自定义target构建前的执行脚本,例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_build(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_clean">rule:before_clean</h3>
 <h4 id="-">自定义清理前脚本</h4>
 <p>用于实现自定义target清理前的执行脚本,例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_clean(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_package">rule:before_package</h3>
 <h4 id="-">自定义打包前脚本</h4>
 <p>用于实现自定义target打包前的执行脚本, 例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_package(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_install">rule:before_install</h3>
 <h4 id="-">自定义安装前脚本</h4>
 <p>用于实现自定义target安装前的执行脚本,例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_install(function (target)
     end)
 </code></pre>
 <h3 id="rule-before_uninstall">rule:before_uninstall</h3>
 <h4 id="-">自定义卸载前脚本</h4>
 <p>用于实现自定义target卸载前的执行脚本,例如:</p>
-<pre><code class="lang-lua">rule(&quot;markdown&quot;)
+<pre><code class="lang-lua">rule("markdown")
     before_uninstall(function (target)
     end)
 </code></pre>
@@ -913,7 +913,7 @@ target(&quot;test&quot;)
 <h3 id="rule_end">rule_end</h3>
 <h4 id="-">结束定义规则</h4>
 <p>这个是可选的,如果想要手动结束rule的定义,可以调用它:</p>
-<pre><code class="lang-lua">rule(&quot;test&quot;)
+<pre><code class="lang-lua">rule("test")
     -- ..
 rule_end()
 </code></pre>

+ 97 - 97
mirror/zh-cn/manual/custom_toolchain.html

@@ -92,58 +92,58 @@
 </style>
     <p>在2.3.4版本之后,xmake已经支持在用户的项目xmake.lua中自定义工具链,例如:</p>
 <pre><code class="lang-lua">-- define toolchain
-toolchain(&quot;myclang&quot;)
+toolchain("myclang")
 
     -- mark as standalone toolchain
-    set_kind(&quot;standalone&quot;)
+    set_kind("standalone")
 
     -- set toolset
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;ld&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;sh&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;ar&quot;, &quot;ar&quot;)
-    set_toolset(&quot;ex&quot;, &quot;ar&quot;)
-    set_toolset(&quot;strip&quot;, &quot;strip&quot;)
-    set_toolset(&quot;mm&quot;, &quot;clang&quot;)
-    set_toolset(&quot;mxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;as&quot;, &quot;clang&quot;)
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
-    add_defines(&quot;MYCLANG&quot;)
+    add_defines("MYCLANG")
 
     -- check toolchain
     on_check(function (toolchain)
-        return import(&quot;lib.detect.find_tool&quot;)(&quot;clang&quot;)
+        return import("lib.detect.find_tool")("clang")
     end)
 
     -- on load
     on_load(function (toolchain)
 
         -- get march
-        local march = is_arch(&quot;x86_64&quot;, &quot;x64&quot;) and &quot;-m64&quot; or &quot;-m32&quot;
+        local march = is_arch("x86_64", "x64") and "-m64" or "-m32"
 
         -- init flags for c/c++
-        toolchain:add(&quot;cxflags&quot;, march)
-        toolchain:add(&quot;ldflags&quot;, march)
-        toolchain:add(&quot;shflags&quot;, march)
-        if not is_plat(&quot;windows&quot;) and os.isdir(&quot;/usr&quot;) then
-            for _, includedir in ipairs({&quot;/usr/local/include&quot;, &quot;/usr/include&quot;}) do
+        toolchain:add("cxflags", march)
+        toolchain:add("ldflags", march)
+        toolchain:add("shflags", march)
+        if not is_plat("windows") and os.isdir("/usr") then
+            for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do
                 if os.isdir(includedir) then
-                    toolchain:add(&quot;includedirs&quot;, includedir)
+                    toolchain:add("includedirs", includedir)
                 end
             end
-            for _, linkdir in ipairs({&quot;/usr/local/lib&quot;, &quot;/usr/lib&quot;}) do
+            for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do
                 if os.isdir(linkdir) then
-                    toolchain:add(&quot;linkdirs&quot;, linkdir)
+                    toolchain:add("linkdirs", linkdir)
                 end
             end
         end
 
         -- init flags for objc/c++  (with ldflags and shflags)
-        toolchain:add(&quot;mxflags&quot;, march)
+        toolchain:add("mxflags", march)
 
         -- init flags for asm
-        toolchain:add(&quot;asflags&quot;, march)
+        toolchain:add("asflags", march)
     end)
 </code></pre>
 <p>然后通过下面的命令切到自己定义的工具链就行了:</p>
@@ -166,161 +166,161 @@ toolchain(&quot;myclang&quot;)
 <tr>
 <td><a href="#toolchain">toolchain</a></td>
 <td>定义工具链</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainset_kind">set_kind</a></td>
 <td>设置工具链类型</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainset_toolset">set_toolset</a></td>
 <td>设置工具集</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainset_sdkdir">set_sdkdir</a></td>
 <td>设置工具链sdk目录路径</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainset_bindir">set_bindir</a></td>
 <td>设置工具链bin目录路径</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainon_check">on_check</a></td>
 <td>检测工具链</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchainonon_load">on_load</a></td>
 <td>加载工具链</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="#toolchain_end">toolchain_end</a></td>
 <td>结束定义工具链</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_includedirs">add_includedirs</a></td>
 <td>添加头文件搜索目录</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_defines">add_defines</a></td>
 <td>添加宏定义</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_undefines">add_undefines</a></td>
 <td>取消宏定义</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_cflags">add_cflags</a></td>
 <td>添加c编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_cxflags">add_cxflags</a></td>
 <td>添加c/c++编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_cxxflags">add_cxxflags</a></td>
 <td>添加c++编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_mflags">add_mflags</a></td>
 <td>添加objc编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_mxflags">add_mxflags</a></td>
 <td>添加objc/objc++编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_mxxflags">add_mxxflags</a></td>
 <td>添加objc++编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_scflags">add_scflags</a></td>
 <td>添加swift编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_asflags">add_asflags</a></td>
 <td>添加汇编编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_gcflags">add_gcflags</a></td>
 <td>添加go编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_dcflags">add_dcflags</a></td>
 <td>添加dlang编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_rcflags">add_rcflags</a></td>
 <td>添加rust编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_cuflags">add_cuflags</a></td>
 <td>添加cuda编译选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_culdflags">add_culdflags</a></td>
 <td>添加cuda设备链接选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_ldflags">add_ldflags</a></td>
 <td>添加链接选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_arflags">add_arflags</a></td>
 <td>添加静态库归档选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_shflags">add_shflags</a></td>
 <td>添加动态库链接选项</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_languages">add_languages</a></td>
 <td>添加语言标准</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_frameworks">add_frameworks</a></td>
 <td>添加链接框架</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 <tr>
 <td><a href="/zh-cn/manual/project_target?id=targetadd_frameworkdirs">add_frameworkdirs</a></td>
 <td>添加链接框架</td>
-<td>&gt;= 2.3.4</td>
+<td>>= 2.3.4</td>
 </tr>
 </tbody>
 </table>
 <h3 id="toolchain">toolchain</h3>
 <h4 id="-">定义工具链</h4>
 <p>可以在用户项目xmake.lua中定义,也可以通过includes独立到单独的xmake.lua去专门定义各种工具链</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
 toolchain_end()
 </code></pre>
 <h3 id="toolchain-set_kind">toolchain:set_kind</h3>
@@ -328,92 +328,92 @@ toolchain_end()
 <p>目前仅支持设置为<code>standalone</code>类型,表示当前工具链是独立完整的工具链,包括cc/cxx/ld/sh/ar等编译器、归档器、链接器等一整套工具集的配置。</p>
 <p>通常用于某个target被同时设置了多个工具链的情况,但同时只能生效一个独立工具链,通过此配置可以保证生效的工具链存在互斥关系,比如gcc/clang工具链不会同时生效。</p>
 <p>而像yasm/nasm这种局部工具链,属于附加的局部工具链扩展,不用设置standalone,因为clang/yasm两个工具链有可能同时存在。</p>
-<p>!&gt; 只要记住,存在完整编译环境的工具链,都设置为standalone就行了</p>
+<p>!> 只要记住,存在完整编译环境的工具链,都设置为standalone就行了</p>
 <h3 id="toolchain-set_toolset">toolchain:set_toolset</h3>
 <h4 id="-">设置工具集</h4>
 <p>用于设置每个单独工具名和路径,例如:</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
-    set_toolset(&quot;cxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;ld&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;sh&quot;, &quot;clang++&quot;, &quot;clang&quot;)
-    set_toolset(&quot;ar&quot;, &quot;ar&quot;)
-    set_toolset(&quot;ex&quot;, &quot;ar&quot;)
-    set_toolset(&quot;strip&quot;, &quot;strip&quot;)
-    set_toolset(&quot;mm&quot;, &quot;clang&quot;)
-    set_toolset(&quot;mxx&quot;, &quot;clang&quot;, &quot;clang++&quot;)
-    set_toolset(&quot;as&quot;, &quot;clang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 </code></pre>
 <p>关于这个接口的详情,可以看下:<a href="/zh-cn/manual/project_target?id=targetset_toolset">target.set_toolset</a></p>
 <h3 id="toolchain-set_sdkdir">toolchain:set_sdkdir</h3>
 <h4 id="-sdk-">设置工具链sdk目录路径</h4>
 <p>通常我们可以通过<code>xmake f --toolchain=myclang --sdk=xxx</code>来配置sdk目录,但是每次配置比较繁琐,我们也可以通过此接口预先配置到xmake.lua中去,方便快速切换使用。</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
-    set_sdkdir(&quot;/tmp/sdkdir&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
+    set_sdkdir("/tmp/sdkdir")
+    set_toolset("cc", "clang")
 </code></pre>
 <h3 id="toolchain-set_bindir">toolchain:set_bindir</h3>
 <h4 id="-bin-">设置工具链bin目录路径</h4>
 <p>通常我们可以通过<code>xmake f --toolchain=myclang --bin=xxx</code>来配置sdk目录,但是每次配置比较繁琐,我们也可以通过此接口预先配置到xmake.lua中去,方便快速切换使用。</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
-    set_bindir(&quot;/tmp/sdkdir/bin&quot;)
-    set_toolset(&quot;cc&quot;, &quot;clang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
+    set_bindir("/tmp/sdkdir/bin")
+    set_toolset("cc", "clang")
 </code></pre>
 <h3 id="toolchain-on_check">toolchain:on_check</h3>
 <h4 id="-">检测工具链</h4>
 <p>用于检测指定工具链所在sdk或者程序在当前系统上是否存在,通常用于多个standalone工具链的情况,进行自动探测和选择有效工具链。</p>
 <p>而对于<code>xmake f --toolchain=myclang</code>手动指定的场景,此检测配置不是必须的,可以省略。</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
     on_check(function (toolchain)
-        return import(&quot;lib.detect.find_tool&quot;)(&quot;clang&quot;)
+        return import("lib.detect.find_tool")("clang")
     end)
 </code></pre>
 <h3 id="toolchain-on_load">toolchain:on_load</h3>
 <h4 id="-">加载工具链</h4>
 <p>对于一些复杂的场景,我们可以在on_load中动态灵活的设置各种工具链配置,比在描述域设置更加灵活,更加强大:</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
-    set_kind(&quot;standalone&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
+    set_kind("standalone")
     on_load(function (toolchain)
 
         -- set toolset
-        toolchain:set(&quot;toolset&quot;, &quot;cc&quot;, &quot;clang&quot;)
-        toolchain:set(&quot;toolset&quot;, &quot;ld&quot;, &quot;clang++&quot;)
+        toolchain:set("toolset", "cc", "clang")
+        toolchain:set("toolset", "ld", "clang++")
         -- ..
 
         -- get march
-        local march = is_arch(&quot;x86_64&quot;, &quot;x64&quot;) and &quot;-m64&quot; or &quot;-m32&quot;
+        local march = is_arch("x86_64", "x64") and "-m64" or "-m32"
 
         -- init flags for c/c++
-        toolchain:add(&quot;cxflags&quot;, march)
-        toolchain:add(&quot;ldflags&quot;, march)
-        toolchain:add(&quot;shflags&quot;, march)
-        if not is_plat(&quot;windows&quot;) and os.isdir(&quot;/usr&quot;) then
-            for _, includedir in ipairs({&quot;/usr/local/include&quot;, &quot;/usr/include&quot;}) do
+        toolchain:add("cxflags", march)
+        toolchain:add("ldflags", march)
+        toolchain:add("shflags", march)
+        if not is_plat("windows") and os.isdir("/usr") then
+            for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do
                 if os.isdir(includedir) then
-                    toolchain:add(&quot;includedirs&quot;, includedir)
+                    toolchain:add("includedirs", includedir)
                 end
             end
-            for _, linkdir in ipairs({&quot;/usr/local/lib&quot;, &quot;/usr/lib&quot;}) do
+            for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do
                 if os.isdir(linkdir) then
-                    toolchain:add(&quot;linkdirs&quot;, linkdir)
+                    toolchain:add("linkdirs", linkdir)
                 end
             end
         end
 
         -- init flags for objc/c++  (with ldflags and shflags)
-        toolchain:add(&quot;mxflags&quot;, march)
+        toolchain:add("mxflags", march)
 
         -- init flags for asm
-        toolchain:add(&quot;asflags&quot;, march)
+        toolchain:add("asflags", march)
     end)
 </code></pre>
 <h3 id="toolchain_end">toolchain_end</h3>
 <h4 id="-">结束定义工具链</h4>
 <p>这个是可选的,如果想要手动结束toolchain的定义,可以调用它:</p>
-<pre><code class="lang-lua">toolchain(&quot;myclang&quot;)
+<pre><code class="lang-lua">toolchain("myclang")
     -- ..
 toolchain_end()
 </code></pre>

File diff suppressed because it is too large
+ 179 - 179
mirror/zh-cn/manual/extension_modules.html


+ 112 - 112
mirror/zh-cn/manual/global_interfaces.html

@@ -103,72 +103,72 @@
 <tr>
 <td><a href="#includes">includes</a></td>
 <td>添加子工程文件和目录</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#set_modes">set_modes</a></td>
 <td>设置支持的编译模式</td>
-<td>&gt;= 2.1.2</td>
+<td>>= 2.1.2</td>
 </tr>
 <tr>
 <td><a href="#set_project">set_project</a></td>
 <td>设置工程名</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#set_version">set_version</a></td>
 <td>设置工程版本</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#set_xmakever">set_xmakever</a></td>
 <td>设置最小xmake版本</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="#add_subdirs">add_subdirs</a></td>
 <td>添加子工程目录</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#add_subfiles">add_subfiles</a></td>
 <td>添加子工程文件</td>
-<td>&gt;= 1.0.1</td>
+<td>>= 1.0.1</td>
 </tr>
 <tr>
 <td><a href="#add_moduledirs">add_moduledirs</a></td>
 <td>添加模块目录</td>
-<td>&gt;= 2.1.5</td>
+<td>>= 2.1.5</td>
 </tr>
 <tr>
 <td><a href="#add_plugindirs">add_plugindirs</a></td>
 <td>添加插件目录</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#add_packagedirs">add_packagedirs</a></td>
 <td>添加包目录</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#get_config">get_config</a></td>
 <td>获取给的配置值</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#set_config">set_config</a></td>
 <td>设置默认的配置值</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#add_requires">add_requires</a></td>
 <td>添加需要的依赖包</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 <tr>
 <td><a href="#add_repositories">add_repositories</a></td>
 <td>添加依赖包仓库</td>
-<td>&gt;= 2.2.2</td>
+<td>>= 2.2.2</td>
 </tr>
 </tbody>
 </table>
@@ -179,27 +179,27 @@
 <p>关于这块的更加完整的说明,可以看下:<a href="https://github.com/xmake-io/xmake/issues/342">https://github.com/xmake-io/xmake/issues/342</a></p>
 <p>例子:</p>
 <p>检测links, c/c++ type, includes和编译器特性,并且写入宏定义到config.h</p>
-<pre><code class="lang-lua">includes(&quot;check_links.lua&quot;)
-includes(&quot;check_ctypes.lua&quot;)
-includes(&quot;check_cfuncs.lua&quot;)
-includes(&quot;check_features.lua&quot;)
-includes(&quot;check_csnippets.lua&quot;)
-includes(&quot;check_cincludes.lua&quot;)
+<pre><code class="lang-lua">includes("check_links.lua")
+includes("check_ctypes.lua")
+includes("check_cfuncs.lua")
+includes("check_features.lua")
+includes("check_csnippets.lua")
+includes("check_cincludes.lua")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;*.c&quot;)
-    add_configfiles(&quot;config.h.in&quot;)
+target("test")
+    set_kind("binary")
+    add_files("*.c")
+    add_configfiles("config.h.in")
 
-    configvar_check_ctypes(&quot;HAS_WCHAR&quot;, &quot;wchar_t&quot;)
-    configvar_check_cincludes(&quot;HAS_STRING_H&quot;, &quot;string.h&quot;)
-    configvar_check_cincludes(&quot;HAS_STRING_AND_STDIO_H&quot;, {&quot;string.h&quot;, &quot;stdio.h&quot;})
-    configvar_check_ctypes(&quot;HAS_WCHAR_AND_FLOAT&quot;, {&quot;wchar_t&quot;, &quot;float&quot;})
-    configvar_check_links(&quot;HAS_PTHREAD&quot;, {&quot;pthread&quot;, &quot;m&quot;, &quot;dl&quot;})
-    configvar_check_csnippets(&quot;HAS_STATIC_ASSERT&quot;, &quot;_Static_assert(1, \&quot;\&quot;);&quot;)
-    configvar_check_cfuncs(&quot;HAS_SETJMP&quot;, &quot;setjmp&quot;, {includes = {&quot;signal.h&quot;, &quot;setjmp.h&quot;}})
-    configvar_check_features(&quot;HAS_CONSTEXPR&quot;, &quot;cxx_constexpr&quot;)
-    configvar_check_features(&quot;HAS_CONSEXPR_AND_STATIC_ASSERT&quot;, {&quot;cxx_constexpr&quot;, &quot;c_static_assert&quot;}, {languages = &quot;c++11&quot;})
+    configvar_check_ctypes("HAS_WCHAR", "wchar_t")
+    configvar_check_cincludes("HAS_STRING_H", "string.h")
+    configvar_check_cincludes("HAS_STRING_AND_STDIO_H", {"string.h", "stdio.h"})
+    configvar_check_ctypes("HAS_WCHAR_AND_FLOAT", {"wchar_t", "float"})
+    configvar_check_links("HAS_PTHREAD", {"pthread", "m", "dl"})
+    configvar_check_csnippets("HAS_STATIC_ASSERT", "_Static_assert(1, \"\");")
+    configvar_check_cfuncs("HAS_SETJMP", "setjmp", {includes = {"signal.h", "setjmp.h"}})
+    configvar_check_features("HAS_CONSTEXPR", "cxx_constexpr")
+    configvar_check_features("HAS_CONSEXPR_AND_STATIC_ASSERT", {"cxx_constexpr", "c_static_assert"}, {languages = "c++11"})
 </code></pre>
 <p>config.h.in</p>
 <pre><code class="lang-c">${define HAS_STRING_H}
@@ -227,31 +227,31 @@ ${define HAS_CONSEXPR_AND_STATIC_ASSERT}
 <h4 id="-">设置支持的编译模式</h4>
 <p>这个是可选接口,一般情况下不需要设置,目前仅用于对工程增加更加细致的描述信息,方便vs工程的多模式生成,以及其他xmake插件中获取模式信息。</p>
 <p>例如:</p>
-<pre><code class="lang-lua">set_modes(&quot;debug&quot;, &quot;release&quot;)
+<pre><code class="lang-lua">set_modes("debug", "release")
 </code></pre>
 <p>如果设置了这个,xmake就知道当前工程支持哪些编译模式,这样生成vs工程文件的时候,只需要:</p>
 <pre><code class="lang-bash">$ xmake project -k vs2017
 </code></pre>
 <p>不再需要额外手动指定需要的编译模式了,此外其他一些想要获取工程信息的插件,也许也会需要这些设置信息。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>当然,对于<a href="#is_mode">is_mode</a>接口,<code>set_modes</code>不是必须的,就算不设置,也是可以通过<code>is_mode</code>正常判断当前的编译模式。<br>&lt;/p&gt;
+<p><p class="tip"><br>当然,对于<a href="#is_mode">is_mode</a>接口,<code>set_modes</code>不是必须的,就算不设置,也是可以通过<code>is_mode</code>正常判断当前的编译模式。<br></p>
 
 </p>
 <h3 id="set_project">set_project</h3>
 <h4 id="-">设置工程名</h4>
 <p>设置工程名,在doxygen自动文档生成插件、工程文件生成插件中会用到,一般设置在xmake.lua的最开头,当然放在其他地方也是可以的</p>
 <pre><code class="lang-lua">-- 设置工程名
-set_project(&quot;tbox&quot;)
+set_project("tbox")
 
 -- 设置工程版本
-set_version(&quot;1.5.1&quot;)
+set_version("1.5.1")
 </code></pre>
 <h3 id="set_version">set_version</h3>
 <h4 id="-">设置工程版本</h4>
 <p>设置项目版本,可以放在xmake.lua任何地方,一般放在最开头,例如:</p>
-<pre><code class="lang-lua">set_version(&quot;1.5.1&quot;)
+<pre><code class="lang-lua">set_version("1.5.1")
 </code></pre>
 <p>2.1.7版本支持buildversion的配置:</p>
-<pre><code class="lang-lua">set_version(&quot;1.5.1&quot;, {build = &quot;%Y%m%d%H%M&quot;})
+<pre><code class="lang-lua">set_version("1.5.1", {build = "%Y%m%d%H%M"})
 </code></pre>
 <p>我们也能够添加版本宏定义到头文件,请参考:<a href="/manual/project_target?id=add-template-configuration-files">add_configfiles</a></p>
 <h3 id="set_xmakever">set_xmakever</h3>
@@ -260,11 +260,11 @@ set_version(&quot;1.5.1&quot;)
 <p>一般情况下,建议默认对其进行设置,这样对用户比较友好,如果<code>xmake.lua</code>中用到了高版本的api接口,用户那边至少可以知道是否因为版本不对导致的构建失败。</p>
 <p>设置如下:</p>
 <pre><code class="lang-lua">-- 设置最小版本为:2.1.0,低于此版本的xmake编译此工程将会提示版本错误信息
-set_xmakever(&quot;2.1.0&quot;)
+set_xmakever("2.1.0")
 </code></pre>
 <h3 id="add_subdirs">add_subdirs</h3>
 <h4 id="-">添加子工程目录</h4>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>xmake 2.x以上版本,请尽量使用<a href="#includes">includes</a>这个接口,这个是add_subdirs和add_subfiles的通用版本,并且支持一些内建扩展模块。<br>&lt;/p&gt;
+<p><p class="tip"><br>xmake 2.x以上版本,请尽量使用<a href="#includes">includes</a>这个接口,这个是add_subdirs和add_subfiles的通用版本,并且支持一些内建扩展模块。<br></p>
 
 </p>
 <p>每个子工程对应一个<code>xmake.lua</code>的工程描述文件。</p>
@@ -280,11 +280,11 @@ set_xmakever(&quot;2.1.0&quot;)
 `
 </code></pre><p>在<code>tbox/xmake.lua</code>中通过<code>add_subdirs</code>将拥有<code>xmale.lua</code>的子模块的目录,添加进来,就可以了,例如:</p>
 <pre><code class="lang-lua">-- 添加libtbox库模块目录
-add_subdirs(&quot;src/tbox&quot;) 
+add_subdirs("src/tbox") 
 
 -- 如果xmake f --demo=y,启用了demo模块,那么包含demo目录
-if is_option(&quot;demo&quot;) then 
-    add_subdirs(&quot;src/demo&quot;) 
+if is_option("demo") then 
+    add_subdirs("src/demo") 
 end
 </code></pre>
 <p>默认情况下,xmake会去编译在所有xmake.lua中描述的所有target目标,如果只想编译指定目标,可以执行:</p>
@@ -294,11 +294,11 @@ $ xmake build tbox
 <p>需要注意的是,每个子<code>xmake.lua</code>中所有的路径设置都是相对于当前这个子<code>xmake.lua</code>所在的目录的,都是相对路径,这样方便维护</p>
 <h3 id="add_subfiles">add_subfiles</h3>
 <h4 id="-">添加子工程文件</h4>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>xmake 2.x以上版本,请尽量使用<a href="#includes">includes</a>这个接口,这个是add_subdirs和add_subfiles的通用版本,并且支持一些内建扩展模块。<br>&lt;/p&gt;
+<p><p class="tip"><br>xmake 2.x以上版本,请尽量使用<a href="#includes">includes</a>这个接口,这个是add_subdirs和add_subfiles的通用版本,并且支持一些内建扩展模块。<br></p>
 
 </p>
 <p><code>add_subfiles</code>的作用与<a href="#add_subdirs">add_subdirs</a>类似,唯一的区别就是:这个接口直接指定<code>xmake.lua</code>文件所在的路径,而不是目录,例如:</p>
-<pre><code class="lang-lua">add_subfiles(&quot;src/tbox/xmake.lua&quot;)
+<pre><code class="lang-lua">add_subfiles("src/tbox/xmake.lua")
 </code></pre>
 <h3 id="add_moduledirs">add_moduledirs</h3>
 <h4 id="-">添加模块目录</h4>
@@ -306,13 +306,13 @@ $ xmake build tbox
 <p>例如定义一个<code>find_openssl.lua</code>的扩展模块,用于扩展内置的<a href="#detect-find_package">lib.detect.find_package</a>接口,则只需要将它放置在:</p>
 <pre><code>projectdir/xmake/modules/detect/packages/find_openssl.lua
 </code></pre><p>然后在工程<code>xmake.lua</code>下指定这个模块目录,<code>find_package</code>就可以自动找到了:</p>
-<pre><code class="lang-lua">add_moduledirs(&quot;projectdir/xmake/modules&quot;)
+<pre><code class="lang-lua">add_moduledirs("projectdir/xmake/modules")
 </code></pre>
 <h3 id="add_plugindirs">add_plugindirs</h3>
 <h4 id="-">添加插件目录</h4>
 <p>xmake内置的插件都是放在<code>xmake/plugins</code>目录下,但是对于用户自定义的一些特定工程的插件,如果不想放置在xmake安装目录下,那么可以在<code>xmake.lua</code>中进行配置指定的其他插件路径。</p>
 <pre><code class="lang-lua">-- 将当前工程下的plugins目录设置为自定义插件目录
-add_plugindirs(&quot;$(projectdir)/plugins&quot;)
+add_plugindirs("$(projectdir)/plugins")
 </code></pre>
 <p>这样,xmake在编译此工程的时候,也就加载这些插件。</p>
 <h3 id="add_packagedirs">add_packagedirs</h3>
@@ -326,115 +326,115 @@ add_plugindirs(&quot;$(projectdir)/plugins&quot;)
 - pcre.pkg
 - ...
 </code></pre><p>如果要让当前工程识别加载这些包,首先要指定包目录路径,例如:</p>
-<pre><code class="lang-lua">add_packagedirs(&quot;packages&quot;)
+<pre><code class="lang-lua">add_packagedirs("packages")
 </code></pre>
 <p>指定好后,就可以在target作用域中,通过<a href="#add_packages">add_packages</a>接口,来添加集成包依赖了,例如:</p>
-<pre><code class="lang-lua">target(&quot;tbox&quot;)
-    add_packages(&quot;zlib&quot;, &quot;polarssl&quot;, &quot;pcre&quot;, &quot;mysql&quot;)
+<pre><code class="lang-lua">target("tbox")
+    add_packages("zlib", "polarssl", "pcre", "mysql")
 </code></pre>
 <h3 id="get_config">get_config</h3>
 <h4 id="-">获取给定的配置值</h4>
 <p>此接口从2.2.2版本开始引入,用于快速获取给定的配置值,可用于描述域。</p>
-<pre><code class="lang-lua">if get_config(&quot;myconfig&quot;) == &quot;xxx&quot; then
-    add_defines(&quot;HELLO&quot;)
+<pre><code class="lang-lua">if get_config("myconfig") == "xxx" then
+    add_defines("HELLO")
 end
 </code></pre>
 <h3 id="set_config">set_config</h3>
 <h4 id="-">设置给定的默认配置值</h4>
 <p>此接口从2.2.2版本开始引入,用于快速在xmake.lua中设置一个默认配置值,仅用于描述域。</p>
 <p>之前很多配置,包括编译工具链,构建目录等只能通过<code>$ xmake f --name=value</code>的方式来配置,如果我们想写死在xmake.lua提供一个默认值,就可以通过下面的方式来配置:</p>
-<pre><code class="lang-lua">set_config(&quot;name&quot;, &quot;value&quot;)
-set_config(&quot;buildir&quot;, &quot;other/buildir&quot;)
-set_config(&quot;cc&quot;, &quot;gcc&quot;)
-set_config(&quot;ld&quot;, &quot;g++&quot;)
+<pre><code class="lang-lua">set_config("name", "value")
+set_config("buildir", "other/buildir")
+set_config("cc", "gcc")
+set_config("ld", "g++")
 </code></pre>
 <p>不过,我们还是可以通过<code>$ xmake f --name=value</code>的方式,去修改xmake.lua中的默认配置。</p>
 <h3 id="add_requires">add_requires</h3>
 <h4 id="-">添加需要的依赖包</h4>
-<p>xmake的依赖包管理是完全支持语义版本选择的,例如:&quot;~1.6.1&quot;,对于语义版本的具体描述见:<a href="https://semver.org/">https://semver.org/</a></p>
+<p>xmake的依赖包管理是完全支持语义版本选择的,例如:"~1.6.1",对于语义版本的具体描述见:<a href="https://semver.org/">https://semver.org/</a></p>
 <p>一些语义版本写法:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;pcre 1.3.x&quot;, &quot;libpng ^1.18&quot;)
-add_requires(&quot;libpng ~1.16&quot;, &quot;zlib 1.1.2 || &gt;=1.2.11 &lt;1.3.0&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "pcre 1.3.x", "libpng ^1.18")
+add_requires("libpng ~1.16", "zlib 1.1.2 || >=1.2.11 <1.3.0")
 </code></pre>
 <p>目前xmake使用的语义版本解析器是<a href="https://github.com/uael">uael</a>贡献的<a href="https://github.com/uael/sv">sv</a>库,里面也有对版本描述写法的详细说明,可以参考下:<a href="https://github.com/uael/sv#versions">版本描述说明</a></p>
 <p>当然,如果我们对当前的依赖包的版本没有特殊要求,那么可以直接这么写:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox", "libpng", "zlib")
 </code></pre>
 <p>这会使用已知的最新版本包,或者是master分支的源码编译的包,如果当前包有git repo地址,我们也能指定特定分支版本:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox master&quot;)
-add_requires(&quot;tbox dev&quot;)
+<pre><code class="lang-lua">add_requires("tbox master")
+add_requires("tbox dev")
 </code></pre>
 <p>如果指定的依赖包当前平台不支持,或者编译安装失败了,那么xmake会编译报错,这对于有些必须要依赖某些包才能工作的项目,这是合理的。<br>但是如果有些包是可选的依赖,即使没有也可以正常编译使用的话,可以设置为可选包:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {optional = true})
+<pre><code class="lang-lua">add_requires("tbox", {optional = true})
 </code></pre>
 <p>默认的设置,xmake会去优先检测系统库是否存在(如果没设置版本要求),如果用户完全不想使用系统库以及第三方包管理提供的库,那么可以设置:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {system = false})
+<pre><code class="lang-lua">add_requires("tbox", {system = false})
 </code></pre>
 <p>如果我们想同时源码调试依赖包,那么可以设置为使用debug版本的包(当然前提是这个包支持debug编译):</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {debug = true})
+<pre><code class="lang-lua">add_requires("tbox", {debug = true})
 </code></pre>
 <p>如果当前包还不支持debug编译,可在仓库中提交修改编译规则,对debug进行支持,例如:</p>
-<pre><code class="lang-lua">package(&quot;openssl&quot;)
-    on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
-        os.vrun(&quot;./config %s --prefix=\&quot;%s\&quot;&quot;, package:debug() and &quot;--debug&quot; or &quot;&quot;, package:installdir())
-        os.vrun(&quot;make -j4&quot;)
-        os.vrun(&quot;make install&quot;)
+<pre><code class="lang-lua">package("openssl")
+    on_install("linux", "macosx", function (package)
+        os.vrun("./config %s --prefix=\"%s\"", package:debug() and "--debug" or "", package:installdir())
+        os.vrun("make -j4")
+        os.vrun("make install")
     end)
 </code></pre>
 <p>某些包在编译时候有各种编译选项,我们也可以传递进来,当然包本身得支持:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {config = {small=true}})
+<pre><code class="lang-lua">add_requires("tbox", {config = {small=true}})
 </code></pre>
 <p>传递<code>--small=true</code>给tbox包,使得编译安装的tbox包是启用此选项的。</p>
 <p>v2.2.3之后,可以通过<a href="#option">option</a>和<a href="#has_config">has_config</a>配合,在自己定义配置选项参数中控制是否需要添加某个依赖包:</p>
-<pre><code class="lang-lua">option(&quot;luajit&quot;)
+<pre><code class="lang-lua">option("luajit")
     set_default(false)
     set_showmenu(true)
-    set_category(&quot;option&quot;)
-    set_description(&quot;Enable the luajit runtime engine.&quot;)
+    set_category("option")
+    set_description("Enable the luajit runtime engine.")
 option_end()
 
-if has_config(&quot;luajit&quot;) then
-    add_requires(&quot;luajit&quot;)
+if has_config("luajit") then
+    add_requires("luajit")
 else
-    add_requires(&quot;lua&quot;)
+    add_requires("lua")
 end
 </code></pre>
 <p>我们可以通过<code>$xmake f --luajit=y</code>去切换依赖包。</p>
 <p>并且我们也新增了group参数,来分组依赖包,同一个组下的所有依赖包,只能有一个生效启用,启用顺序依赖<code>add_requires</code>添加的顺序:</p>
-<pre><code class="lang-lua">add_requires(&quot;openssl&quot;, {group = &quot;ssl&quot;, optional = true})
-add_requires(&quot;mbedtls&quot;, {group = &quot;ssl&quot;, optional = true})
+<pre><code class="lang-lua">add_requires("openssl", {group = "ssl", optional = true})
+add_requires("mbedtls", {group = "ssl", optional = true})
 
-target(&quot;test&quot;)
-    add_packages(&quot;openssl&quot;, &quot;mbedtls&quot;)
+target("test")
+    add_packages("openssl", "mbedtls")
 </code></pre>
 <p>例如上面,所以同时依赖两个ssl包,实际上只会启用生效实际安装成功的那一个ssl包,并不会同时链接两个依赖包。</p>
 <p>2.2.5版本之后,xmake支持对对第三方包管理器里面的依赖库安装支持,例如:conan,brew, vcpkg等</p>
 <p>添加homebrew的依赖包:</p>
-<pre><code class="lang-lua">add_requires(&quot;brew::zlib&quot;, {alias = &quot;zlib&quot;}})
-add_requires(&quot;brew::pcre2/libpcre2-8&quot;, {alias = &quot;pcre2&quot;}})
+<pre><code class="lang-lua">add_requires("brew::zlib", {alias = "zlib"}})
+add_requires("brew::pcre2/libpcre2-8", {alias = "pcre2"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;pcre2&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("pcre2", "zlib")
 </code></pre>
 <p>添加vcpkg的依赖包:</p>
-<pre><code class="lang-lua">add_requires(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+<pre><code class="lang-lua">add_requires("vcpkg::zlib", "vcpkg::pcre2")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("vcpkg::zlib", "vcpkg::pcre2")
 </code></pre>
 <p>添加conan的依赖包:</p>
-<pre><code class="lang-lua">add_requires(&quot;CONAN::zlib/1.2.11@conan/stable&quot;, {alias = &quot;zlib&quot;, debug = true})
-add_requires(&quot;CONAN::OpenSSL/1.0.2n@conan/stable&quot;, {alias = &quot;openssl&quot;, 
-    configs = {options = &quot;OpenSSL:shared=True&quot;}})
+<pre><code class="lang-lua">add_requires("CONAN::zlib/1.2.11@conan/stable", {alias = "zlib", debug = true})
+add_requires("CONAN::OpenSSL/1.0.2n@conan/stable", {alias = "openssl", 
+    configs = {options = "OpenSSL:shared=True"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("openssl", "zlib")
 </code></pre>
 <p>执行xmake进行编译后:</p>
 <pre><code class="lang-console">ruki:test_package ruki$ xmake
@@ -442,12 +442,12 @@ checking for the architecture ... x86_64
 checking for the Xcode directory ... /Applications/Xcode.app
 checking for the SDK version of Xcode ... 10.14
 note: try installing these packages (pass -y to skip confirm)?
-  -&gt; CONAN::zlib/1.2.11@conan/stable  (debug)
-  -&gt; CONAN::OpenSSL/1.0.2n@conan/stable  
+  -> CONAN::zlib/1.2.11@conan/stable  (debug)
+  -> CONAN::OpenSSL/1.0.2n@conan/stable  
 please input: y (y/n)
 
-  =&gt; installing CONAN::zlib/1.2.11@conan/stable .. ok
-  =&gt; installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
+  => installing CONAN::zlib/1.2.11@conan/stable .. ok
+  => installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
 
 [  0%]: ccache compiling.release src/main.c
 [100%]: linking.release test
@@ -456,20 +456,20 @@ please input: y (y/n)
 <p>添加clib的依赖包:</p>
 <p>clib是一款基于源码的依赖包管理器,拉取的依赖包是直接下载对应的库源码,集成到项目中编译,而不是二进制库依赖。</p>
 <p>其在xmake中集成也很方便,唯一需要注意的是,还需要自己添加上对应库的源码到xmake.lua,例如:</p>
-<pre><code class="lang-lua">add_requires(&quot;clib::clibs/[email protected]&quot;, {alias = &quot;bytes&quot;})
+<pre><code class="lang-lua">add_requires("clib::clibs/[email protected]", {alias = "bytes"})
 
-target(&quot;xmake-test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;clib/bytes/*.c&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;bytes&quot;)
+target("xmake-test")
+    set_kind("binary")
+    add_files("clib/bytes/*.c")
+    add_files("src/*.c") 
+    add_packages("bytes")
 </code></pre>
 <h3 id="add_repositories">add_repositories</h3>
 <h4 id="-">添加依赖包仓库</h4>
 <p>如果需要的包不在官方仓库<a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a>中,我们可以提交贡献代码到仓库进行支持。<br>但如果有些包仅用于个人或者私有项目,我们可以建立一个私有仓库repo,仓库组织结构可参考:<a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a></p>
 <p>比如,现在我们有一个一个私有仓库repo:<a href="mailto:`[email protected]">`[email protected]</a>:myrepo/xmake-repo.git`</p>
 <p>我们可以通过此接口来添加:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo [email protected]:myrepo/xmake-repo.git")
 </code></pre>
 <p>如果我们只是想添加一两个私有包,这个时候特定去建立一个git repo太小题大做了,我们可以直接把包仓库放置项目里面,例如:</p>
 <pre><code>projectdir
@@ -481,7 +481,7 @@ target(&quot;xmake-test&quot;)
     - main.c
   - xmake.lua
 </code></pre><p>上面myrepo目录就是自己的私有包仓库,内置在自己的项目里面,然后在xmake.lua里面添加一下这个仓库位置:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo myrepo&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo myrepo")
 </code></pre>
 <p>这个可以参考<a href="https://github.com/tboox/benchbox">benchbox</a>项目,里面就内置了一个私有仓库。</p>
 </article>

+ 18 - 18
mirror/zh-cn/manual/package_dependencies.html

@@ -93,36 +93,36 @@
     <p>仓库依赖包定义描述,<code>package()</code>相关接口定义,等有时间会详细说明,敬请期待。。</p>
 <p>可先参考官方仓库中现有包描述:<a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a></p>
 <p>这里给个比较具有代表性的实例供参考:</p>
-<pre><code class="lang-lua">package(&quot;libxml2&quot;)
+<pre><code class="lang-lua">package("libxml2")
 
-    set_homepage(&quot;http://xmlsoft.org/&quot;)
-    set_description(&quot;The XML C parser and toolkit of Gnome.&quot;)
+    set_homepage("http://xmlsoft.org/")
+    set_description("The XML C parser and toolkit of Gnome.")
 
-    set_urls(&quot;https://github.com/GNOME/libxml2/archive/$(version).zip&quot;, {excludes = {&quot;*/result/*&quot;, &quot;*/test/*&quot;}})
+    set_urls("https://github.com/GNOME/libxml2/archive/$(version).zip", {excludes = {"*/result/*", "*/test/*"}})
 
-    add_versions(&quot;v2.9.8&quot;, &quot;c87793e45e66a7aa19200f861873f75195065de786a21c1b469bdb7bfc1230fb&quot;)
-    add_versions(&quot;v2.9.7&quot;, &quot;31dd4c0e10fa625b47e27fd6a5295d246c883f214da947b9a4a9e13733905ed9&quot;)
+    add_versions("v2.9.8", "c87793e45e66a7aa19200f861873f75195065de786a21c1b469bdb7bfc1230fb")
+    add_versions("v2.9.7", "31dd4c0e10fa625b47e27fd6a5295d246c883f214da947b9a4a9e13733905ed9")
 
-    if is_plat(&quot;macosx&quot;, &quot;linux&quot;) then
-        add_deps(&quot;autoconf&quot;, &quot;automake&quot;, &quot;libtool&quot;, &quot;pkg-config&quot;)
+    if is_plat("macosx", "linux") then
+        add_deps("autoconf", "automake", "libtool", "pkg-config")
     end
 
     on_load(function (package)
-        package:addvar(&quot;includedirs&quot;, &quot;include/libxml2&quot;)
-        package:addvar(&quot;links&quot;, &quot;xml2&quot;)
+        package:addvar("includedirs", "include/libxml2")
+        package:addvar("links", "xml2")
     end)
 
-    if is_plat(&quot;windows&quot;) and winos.version():gt(&quot;winxp&quot;) then
-        on_install(&quot;windows&quot;, function (package)
-            os.cd(&quot;win32&quot;)
-            os.vrun(&quot;cscript configure.js iso8859x=yes iconv=no compiler=msvc cruntime=/MT debug=%s prefix=\&quot;%s\&quot;&quot;, package:debug() and &quot;yes&quot; or &quot;no&quot;, package:installdir())
-            os.vrun(&quot;nmake /f Makefile.msvc&quot;)
-            os.vrun(&quot;nmake /f Makefile.msvc install&quot;)
+    if is_plat("windows") and winos.version():gt("winxp") then
+        on_install("windows", function (package)
+            os.cd("win32")
+            os.vrun("cscript configure.js iso8859x=yes iconv=no compiler=msvc cruntime=/MT debug=%s prefix=\"%s\"", package:debug() and "yes" or "no", package:installdir())
+            os.vrun("nmake /f Makefile.msvc")
+            os.vrun("nmake /f Makefile.msvc install")
         end)
     end
 
-    on_install(&quot;macosx&quot;, &quot;linux&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).install(package, {&quot;--disable-dependency-tracking&quot;, &quot;--without-python&quot;, &quot;--without-lzma&quot;})
+    on_install("macosx", "linux", function (package)
+        import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--without-python", "--without-lzma"})
     end)
 </code></pre>
 </article>

+ 46 - 46
mirror/zh-cn/manual/plugin_task.html

@@ -104,27 +104,27 @@
 <tr>
 <td><a href="#task">task</a></td>
 <td>定义插件或者任务</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#task_end">task_end</a></td>
 <td>结束定义插件或任务</td>
-<td>&gt;= 2.1.1</td>
+<td>>= 2.1.1</td>
 </tr>
 <tr>
 <td><a href="#taskset_menu">set_menu</a></td>
 <td>设置任务菜单</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#taskset_category">set_category</a></td>
 <td>设置任务类别</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 <tr>
 <td><a href="#taskon_run">on_run</a></td>
 <td>设置任务运行脚本</td>
-<td>&gt;= 2.0.1</td>
+<td>>= 2.0.1</td>
 </tr>
 </tbody>
 </table>
@@ -132,24 +132,24 @@
 <h4 id="-">定义插件或者任务</h4>
 <p><code>task</code>域用于描述一个自定义的任务实现,与<a href="#target">target</a>和<a href="#option">option</a>同级。</p>
 <p>例如,这里定义一个最简单的任务:</p>
-<pre><code class="lang-lua">task(&quot;hello&quot;)
+<pre><code class="lang-lua">task("hello")
 
     -- 设置运行脚本
     on_run(function ()
-        print(&quot;hello xmake!&quot;)
+        print("hello xmake!")
     end)
 </code></pre>
 <p>这个任务只需要打印<code>hello xmake!</code>,那如何来运行呢?</p>
 <p>由于这里没有使用<a href="#taskset_menu">set_menu</a>设置菜单,因此这个任务只能再<code>xmake.lua</code>的自定义脚本或者其他任务内部调用,例如:</p>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
 
     after_build(function (target)
 
         -- 导入task模块
-        import(&quot;core.project.task&quot;)
+        import("core.project.task")
 
         -- 运行hello任务
-        task.run(&quot;hello&quot;)
+        task.run("hello")
     end)
 </code></pre>
 <p>在构建完<code>test</code>目标后运行<code>hello</code>任务。</p>
@@ -159,60 +159,60 @@
 <h3 id="task-set_menu">task:set_menu</h3>
 <h4 id="-">设置任务菜单</h4>
 <p>通过设置一个菜单,这个任务就可以开放给用户自己通过命令行手动调用,菜单的设置如下:</p>
-<pre><code class="lang-lua">task(&quot;echo&quot;)
+<pre><code class="lang-lua">task("echo")
 
     -- 设置运行脚本
     on_run(function ()
 
         -- 导入参数选项模块
-        import(&quot;core.base.option&quot;)
+        import("core.base.option")
 
         -- 初始化颜色模式
-        local modes = &quot;&quot;
-        for _, mode in ipairs({&quot;bright&quot;, &quot;dim&quot;, &quot;blink&quot;, &quot;reverse&quot;}) do
+        local modes = ""
+        for _, mode in ipairs({"bright", "dim", "blink", "reverse"}) do
             if option.get(mode) then
-                modes = modes .. &quot; &quot; .. mode 
+                modes = modes .. " " .. mode 
             end
         end
 
         -- 获取参数内容并且显示信息
-        cprint(&quot;${%s%s}%s&quot;, option.get(&quot;color&quot;), modes, table.concat(option.get(&quot;contents&quot;) or {}, &quot; &quot;))
+        cprint("${%s%s}%s", option.get("color"), modes, table.concat(option.get("contents") or {}, " "))
     end)
 
     -- 设置插件的命令行选项,这里没有任何参数选项,仅仅显示插件描述
     set_menu {
                 -- 设置菜单用法
-                usage = &quot;xmake echo [options]&quot;
+                usage = "xmake echo [options]"
 
                 -- 设置菜单描述
-            ,   description = &quot;Echo the given info!&quot;
+            ,   description = "Echo the given info!"
 
                 -- 设置菜单选项,如果没有选项,可以设置为{}
             ,   options = 
                 {
                     -- 设置k模式作为key-only型bool参数
-                    {&#39;b&#39;, &quot;bright&quot;,     &quot;k&quot;,  nil,       &quot;Enable bright.&quot;               }      
-                ,   {&#39;d&#39;, &quot;dim&quot;,        &quot;k&quot;,  nil,       &quot;Enable dim.&quot;                  }      
-                ,   {&#39;-&#39;, &quot;blink&quot;,      &quot;k&quot;,  nil,       &quot;Enable blink.&quot;                }      
-                ,   {&#39;r&#39;, &quot;reverse&quot;,    &quot;k&quot;,  nil,       &quot;Reverse color.&quot;               }      
+                    {&#39;b&#39;, "bright",     "k",  nil,       "Enable bright."               }      
+                ,   {&#39;d&#39;, "dim",        "k",  nil,       "Enable dim."                  }      
+                ,   {&#39;-&#39;, "blink",      "k",  nil,       "Enable blink."                }      
+                ,   {&#39;r&#39;, "reverse",    "k",  nil,       "Reverse color."               }      
 
                     -- 菜单显示时,空白一行
                 ,   {}
 
                     -- 设置kv作为key-value型参数,并且设置默认值:black
-                ,   {&#39;c&#39;, &quot;color&quot;,      &quot;kv&quot;, &quot;black&quot;,   &quot;Set the output color.&quot;
-                                                     ,   &quot;    - red&quot;   
-                                                     ,   &quot;    - blue&quot;
-                                                     ,   &quot;    - yellow&quot;
-                                                     ,   &quot;    - green&quot;
-                                                     ,   &quot;    - magenta&quot;
-                                                     ,   &quot;    - cyan&quot; 
-                                                     ,   &quot;    - white&quot;                  }
+                ,   {&#39;c&#39;, "color",      "kv", "black",   "Set the output color."
+                                                     ,   "    - red"   
+                                                     ,   "    - blue"
+                                                     ,   "    - yellow"
+                                                     ,   "    - green"
+                                                     ,   "    - magenta"
+                                                     ,   "    - cyan" 
+                                                     ,   "    - white"                  }
 
                     -- 设置`vs`作为values多值型参数,还有`v`单值类型
                     -- 一般放置在最后,用于获取可变参数列表
                 ,   {}
-                ,   {nil, &quot;contents&quot;,   &quot;vs&quot;, nil,       &quot;The info contents.&quot;           }
+                ,   {nil, "contents",   "vs", nil,       "The info contents."           }
                 }
             } 
 </code></pre>
@@ -266,7 +266,7 @@ Options:
 
     contents ...                           The info contents.
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>其中菜单最开头的部分选项,是xmake内置的常用选项,基本上每个任务都会用到,不需要自己额外定义,简化菜单定义。<br>&lt;/p&gt;
+<p><p class="tip"><br>其中菜单最开头的部分选项,是xmake内置的常用选项,基本上每个任务都会用到,不需要自己额外定义,简化菜单定义。<br></p>
 
 </p>
 <p>下面,我们来实际运行下这个任务,例如我要显示红色的<code>hello xmake!</code>,只需要:</p>
@@ -275,11 +275,11 @@ Options:
 <p>也可以使用选项全名,并且加上高亮:</p>
 <pre><code class="lang-bash">$ xmake echo --color=red --bright hello xmake!
 </code></pre>
-<p>最后面的可变参数列表,在<code>run</code>脚本中通过<code>option.get(&quot;contents&quot;)</code>获取,返回的是一个<code>table</code>类型的数组。</p>
+<p>最后面的可变参数列表,在<code>run</code>脚本中通过<code>option.get("contents")</code>获取,返回的是一个<code>table</code>类型的数组。</p>
 <h3 id="task-set_category">task:set_category</h3>
 <h4 id="-">设置任务类别</h4>
 <p>仅仅用于菜单的分组显示,当然插件默认会用<code>plugin</code>,内置任务默认会用:<code>action</code>,但也仅仅只是个约定。</p>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>你可以使用任何自己定义的名字,相同名字会分组归类到一起显示,如果设置为<code>plugin</code>,就会显示到xmake的Plugins分组中去。<br>&lt;/p&gt;
+<p><p class="tip"><br>你可以使用任何自己定义的名字,相同名字会分组归类到一起显示,如果设置为<code>plugin</code>,就会显示到xmake的Plugins分组中去。<br></p>
 
 </p>
 <p>例如:</p>
@@ -296,16 +296,16 @@ Options:
 <h3 id="task-on_run">task:on_run</h3>
 <h4 id="-">设置任务运行脚本</h4>
 <p>可以有两种设置方式,最简单的就是设置内嵌函数:</p>
-<pre><code class="lang-lua">task(&quot;hello&quot;)
+<pre><code class="lang-lua">task("hello")
 
     on_run(function ()
-        print(&quot;hello xmake!&quot;)
+        print("hello xmake!")
     end)
 </code></pre>
 <p>这种对于小任务很方便,也很简洁,但是对于大型任务就不太适用了,例如插件等,需要复杂的脚本支持。</p>
 <p>这个时候就需要独立的模块文件来设置运行脚本,例如:</p>
-<pre><code class="lang-lua">task(&quot;hello&quot;)
-    on_run(&quot;main&quot;)
+<pre><code class="lang-lua">task("hello")
+    on_run("main")
 </code></pre>
 <p>这里的<code>main</code>设置为脚本运行主入口模块,文件名为<code>main.lua</code>,放在定义<code>task</code>的<code>xmake.lua</code>的同目录下,当然你可以起其他文件名。</p>
 <p>目录结构如下:</p>
@@ -314,18 +314,18 @@ Options:
     - main.lua
 </code></pre><p><code>main.lua</code>里面内容如下:</p>
 <pre><code class="lang-lua">function main(...)
-    print(&quot;hello xmake!&quot;)
+    print("hello xmake!")
 end
 </code></pre>
 <p>就是一个简单的带<code>main</code>主函数的脚本文件,你可以通过<a href="/zh-cn/manual/builtin_modules?id=import">import</a>导入各种扩展模块,实现复杂功能,例如:</p>
 <pre><code class="lang-lua">-- 导入参数选项模块
-import(&quot;core.base.option&quot;)
+import("core.base.option")
 
 -- 入口函数
 function main(...)
 
     -- 获取参数内容
-    print(&quot;color: %s&quot;, option.get(&quot;color&quot;))
+    print("color: %s", option.get("color"))
 end
 </code></pre>
 <p>你也可以在当前目录下,创建多个自定义的模块文件,通过<a href="/zh-cn/manual/builtin_modules?id=import">import</a>导入后使用,例如:</p>
@@ -336,14 +336,14 @@ end
 </code></pre><p><code>module.lua</code>的内容如下:</p>
 <pre><code class="lang-lua">-- 定义一个导出接口
 function hello()
-    print(&quot;hello xmake!&quot;)
+    print("hello xmake!")
 end
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>私有接口,通过<code>_hello</code>带下滑线前缀命名,这样导入的模块就不会包含此接口,只在模块自身内部使用。<br>&lt;/p&gt;
+<p><p class="tip"><br>私有接口,通过<code>_hello</code>带下滑线前缀命名,这样导入的模块就不会包含此接口,只在模块自身内部使用。<br></p>
 
 </p>
 <p>然后在<code>main.lua</code>进行调用:</p>
-<pre><code class="lang-lua">import(&quot;module&quot;)
+<pre><code class="lang-lua">import("module")
 
 function main(...)
     module.hello()
@@ -351,9 +351,9 @@ end
 </code></pre>
 <p>更多模块介绍见:<a href="/zh-cn/manual/builtin_modules">内置模块</a>和<a href="/zh-cn/manual/extension_modules">扩展模块</a></p>
 <p>其中,<code>main(...)</code>中参数,是通过<code>task.run</code>指定的,例如:</p>
-<pre><code class="lang-lua">task.run(&quot;hello&quot;, {color=&quot;red&quot;}, arg1, arg2, arg3)
+<pre><code class="lang-lua">task.run("hello", {color="red"}, arg1, arg2, arg3)
 </code></pre>
-<p>里面的<code>arg1, arg2</code>这些就是传入<code>hello</code>任务<code>main(...)</code>入口的参数列表,而<code>{color=&quot;red&quot;}</code>用来指定任务菜单中的参数选项。</p>
+<p>里面的<code>arg1, arg2</code>这些就是传入<code>hello</code>任务<code>main(...)</code>入口的参数列表,而<code>{color="red"}</code>用来指定任务菜单中的参数选项。</p>
 <p>更加详细的<code>task.run</code>描述,见:<a href="#task-run">task.run</a></p>
 </article>
 </body>

File diff suppressed because it is too large
+ 212 - 212
mirror/zh-cn/manual/project_target.html


+ 3 - 3
mirror/zh-cn/manual/specification.html

@@ -114,7 +114,7 @@
 </tr>
 <tr>
 <td><code>s</code>后缀的接口</td>
-<td>表示支持多值传入,例如:<code>add_files(&quot;*.c&quot;, &quot;test.cpp&quot;)</code></td>
+<td>表示支持多值传入,例如:<code>add_files("*.c", "test.cpp")</code></td>
 </tr>
 <tr>
 <td><code>on_</code>前缀的接口</td>
@@ -129,8 +129,8 @@
 <td>表示为在内置脚本运行后,执行此脚本</td>
 </tr>
 <tr>
-<td><code>scope(&quot;name&quot;)</code>的接口</td>
-<td>表示为定义一个描述域,例如:<code>target(&quot;xxx&quot;)</code>, <code>option(&quot;xxx&quot;)</code></td>
+<td><code>scope("name")</code>的接口</td>
+<td>表示为定义一个描述域,例如:<code>target("xxx")</code>, <code>option("xxx")</code></td>
 </tr>
 <tr>
 <td>描述域/描述设置</td>

+ 3 - 3
mirror/zh-cn/package/local_package.html

@@ -100,11 +100,11 @@
 - pcre.pkg
 - ...
 </code></pre><p>如果要让当前工程识别加载这些包,首先要指定包目录路径,例如:</p>
-<pre><code class="lang-lua">add_packagedirs(&quot;packages&quot;)
+<pre><code class="lang-lua">add_packagedirs("packages")
 </code></pre>
 <p>指定好后,就可以在target作用域中,通过<a href="/zh-cn/manual/project_target?id=targetadd_packages">add_packages</a>接口,来添加集成包依赖了,例如:</p>
-<pre><code class="lang-lua">target(&quot;tbox&quot;)
-    add_packages(&quot;zlib&quot;, &quot;polarssl&quot;, &quot;pcre&quot;, &quot;mysql&quot;)
+<pre><code class="lang-lua">target("tbox")
+    add_packages("zlib", "polarssl", "pcre", "mysql")
 </code></pre>
 <p>那么如何去生成一个*.pkg的包呢,如果是基于xmake的工程,生成方式很简单,只需要:</p>
 <pre><code class="lang-console">$ cd tbox

+ 229 - 229
mirror/zh-cn/package/remote_package.html

@@ -91,30 +91,30 @@
 }
 </style>
     <p>这个在2.2.2版本后已经初步支持,用法上更加的简单,只需要设置对应的依赖包就行了,例如:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;libpng ~1.16&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "libpng ~1.16", "zlib")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("tbox", "libpng", "zlib")
 </code></pre>
 <p>上面的<code>add_requires</code>用于描述当前项目需要的依赖包,而<code>add_packages</code>用于应用依赖包到test目标,只有设置这个才会自动追加links, linkdirs, includedirs等设置。</p>
 <p>然后直接执行编译即可:</p>
 <pre><code class="lang-console">$ xmake 
 </code></pre>
 <p>xmake会去远程拉取相关源码包,然后自动编译安装,最后编译项目,进行依赖包的链接,具体效果见下图:</p>
-<p>&lt;img src=&quot;/assets/img/index/package_manage.png&quot; width=&quot;80%&quot; /&gt;</p>
+<p><img src="/assets/img/index/package_manage.png" width="80%" /></p>
 <p>关于包依赖管理的更多相关信息和进展见相关issues:<a href="https://github.com/xmake-io/xmake/issues/69">Remote package management</a> </p>
 <h2 id="-">目前支持的特性</h2>
 <ul>
-<li>语义版本支持,例如:&quot;&gt;= 1.1.0 &lt; 1.2&quot;, &quot;~1.6&quot;, &quot;1.2.x&quot;, &quot;1.*&quot;</li>
+<li>语义版本支持,例如:">= 1.1.0 < 1.2", "~1.6", "1.2.x", "1.*"</li>
 <li>提供官方包仓库、自建私有仓库、项目内置仓库等多仓库管理支持</li>
 <li>跨平台包编译集成支持(不同平台、不同架构的包可同时安装,快速切换使用)</li>
 <li>debug依赖包支持,实现源码调试</li>
 </ul>
 <h2 id="-">依赖包处理机制</h2>
 <p>这里我们简单介绍下整个依赖包的处理机制:</p>
-<p>&lt;img src=&quot;/assets/img/index/package_arch.png&quot; width=&quot;80%&quot; /&gt;</p>
+<p><img src="/assets/img/index/package_arch.png" width="80%" /></p>
 <ol>
 <li>优先检测当前系统目录、第三方包管理下有没有存在指定的包,如果有匹配的包,那么就不需要下载安装了 (当然也可以设置不使用系统包)</li>
 <li>检索匹配对应版本的包,然后下载、编译、安装(注:安装在特定xmake目录,不会干扰系统库环境)</li>
@@ -137,121 +137,121 @@ $ xmake
 $ xmake
 </code></pre>
 <h2 id="-">语义版本设置</h2>
-<p>xmake的依赖包管理是完全支持语义版本选择的,例如:&quot;~1.6.1&quot;,对于语义版本的具体描述见:<a href="https://semver.org/">https://semver.org/</a></p>
+<p>xmake的依赖包管理是完全支持语义版本选择的,例如:"~1.6.1",对于语义版本的具体描述见:<a href="https://semver.org/">https://semver.org/</a></p>
 <p>一些语义版本写法:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox 1.6.*&quot;, &quot;pcre 1.3.x&quot;, &quot;libpng ^1.18&quot;)
-add_requires(&quot;libpng ~1.16&quot;, &quot;zlib 1.1.2 || &gt;=1.2.11 &lt;1.3.0&quot;)
+<pre><code class="lang-lua">add_requires("tbox 1.6.*", "pcre 1.3.x", "libpng ^1.18")
+add_requires("libpng ~1.16", "zlib 1.1.2 || >=1.2.11 <1.3.0")
 </code></pre>
 <p>目前xmake使用的语义版本解析器是<a href="https://github.com/uael">uael</a>贡献的<a href="https://github.com/uael/sv">sv</a>库,里面也有对版本描述写法的详细说明,可以参考下:<a href="https://github.com/uael/sv#versions">版本描述说明</a></p>
 <p>当然,如果我们对当前的依赖包的版本没有特殊要求,那么可以直接这么写:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, &quot;libpng&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">add_requires("tbox", "libpng", "zlib")
 </code></pre>
 <p>这会使用已知的最新版本包,或者是master分支的源码编译的包,如果当前包有git repo地址,我们也能指定特定分支版本:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox master&quot;)
-add_requires(&quot;tbox dev&quot;)
+<pre><code class="lang-lua">add_requires("tbox master")
+add_requires("tbox dev")
 </code></pre>
 <h2 id="-">额外的包信息设置</h2>
 <h3 id="-">可选包设置</h3>
 <p>如果指定的依赖包当前平台不支持,或者编译安装失败了,那么xmake会编译报错,这对于有些必须要依赖某些包才能工作的项目,这是合理的。<br>但是如果有些包是可选的依赖,即使没有也可以正常编译使用的话,可以设置为可选包:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {optional = true})
+<pre><code class="lang-lua">add_requires("tbox", {optional = true})
 </code></pre>
 <h3 id="-">禁用系统库</h3>
 <p>默认的设置,xmake会去优先检测系统库是否存在(如果没设置版本要求),如果用户完全不想使用系统库以及第三方包管理提供的库,那么可以设置:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {system = false})
+<pre><code class="lang-lua">add_requires("tbox", {system = false})
 </code></pre>
 <h3 id="-">使用调试版本的包</h3>
 <p>如果我们想同时源码调试依赖包,那么可以设置为使用debug版本的包(当然前提是这个包支持debug编译):</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {debug = true})
+<pre><code class="lang-lua">add_requires("tbox", {debug = true})
 </code></pre>
 <p>如果当前包还不支持debug编译,可在仓库中提交修改编译规则,对debug进行支持,例如:</p>
-<pre><code class="lang-lua">package(&quot;openssl&quot;)
-    on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
-        os.vrun(&quot;./config %s --prefix=\&quot;%s\&quot;&quot;, package:debug() and &quot;--debug&quot; or &quot;&quot;, package:installdir())
-        os.vrun(&quot;make -j4&quot;)
-        os.vrun(&quot;make install&quot;)
+<pre><code class="lang-lua">package("openssl")
+    on_install("linux", "macosx", function (package)
+        os.vrun("./config %s --prefix=\"%s\"", package:debug() and "--debug" or "", package:installdir())
+        os.vrun("make -j4")
+        os.vrun("make install")
     end)
 </code></pre>
 <h3 id="-">传递额外的编译信息到包</h3>
 <p>某些包在编译时候有各种编译选项,我们也可以传递进来,当然包本身得支持:</p>
-<pre><code class="lang-lua">add_requires(&quot;tbox&quot;, {configs = {small = true}})
+<pre><code class="lang-lua">add_requires("tbox", {configs = {small = true}})
 </code></pre>
 <p>传递<code>--small=true</code>给tbox包,使得编译安装的tbox包是启用此选项的。</p>
 <p>我们可以通过在工程目录中执行:<code>xmake require --info tbox</code> 来获取指定包所有的可配置参数列表和取值说明。</p>
 <p>比如:</p>
 <pre><code class="lang-console">xmake require --info spdlog
     require(spdlog): 
-      -&gt; requires:
-         -&gt; plat: macosx
-         -&gt; arch: x86_64
-         -&gt; configs:
-            -&gt; header_only: true
-            -&gt; shared: false
-            -&gt; vs_runtime: MT
-            -&gt; debug: false
-            -&gt; fmt_external: true
-            -&gt; noexcept: false
-      -&gt; configs:
-         -&gt; header_only: Use header only (default: true)
-         -&gt; fmt_external: Use external fmt library instead of bundled (default: false)
-         -&gt; noexcept: Compile with -fno-exceptions. Call abort() on any spdlog exceptions (default: false)
-      -&gt; configs (builtin):
-         -&gt; debug: Enable debug symbols. (default: false)
-         -&gt; shared: Enable shared library. (default: false)
-         -&gt; cflags: Set the C compiler flags.
-         -&gt; cxflags: Set the C/C++ compiler flags.
-         -&gt; cxxflags: Set the C++ compiler flags.
-         -&gt; asflags: Set the assembler flags.
-         -&gt; vs_runtime: Set vs compiler runtime. (default: MT)
-            -&gt; values: {&quot;MT&quot;,&quot;MD&quot;}
+      -> requires:
+         -> plat: macosx
+         -> arch: x86_64
+         -> configs:
+            -> header_only: true
+            -> shared: false
+            -> vs_runtime: MT
+            -> debug: false
+            -> fmt_external: true
+            -> noexcept: false
+      -> configs:
+         -> header_only: Use header only (default: true)
+         -> fmt_external: Use external fmt library instead of bundled (default: false)
+         -> noexcept: Compile with -fno-exceptions. Call abort() on any spdlog exceptions (default: false)
+      -> configs (builtin):
+         -> debug: Enable debug symbols. (default: false)
+         -> shared: Enable shared library. (default: false)
+         -> cflags: Set the C compiler flags.
+         -> cxflags: Set the C/C++ compiler flags.
+         -> cxxflags: Set the C++ compiler flags.
+         -> asflags: Set the assembler flags.
+         -> vs_runtime: Set vs compiler runtime. (default: MT)
+            -> values: {"MT","MD"}
 </code></pre>
 <p>其中,configs里面就是spdlog包自身提供的可配置参数,而下面带有builtin的configs部分,是所有包都会有的内置配置参数。<br>最上面requires部分,是项目当前配置值。</p>
-<p>!&gt; <code>vs_runtime</code>是用于msvc下vs runtime的设置,v2.2.9版本中,还支持所有static依赖包的自动继承,也就是说spdlog如果设置了MD,那么它依赖的fmt包也会自动继承设置MD。</p>
+<p>!> <code>vs_runtime</code>是用于msvc下vs runtime的设置,v2.2.9版本中,还支持所有static依赖包的自动继承,也就是说spdlog如果设置了MD,那么它依赖的fmt包也会自动继承设置MD。</p>
 <p>可以看到,我们已经能够很方便的定制化获取需要的包,但是每个包自身也许有很多依赖,如果这些依赖也要各种定制化配置,怎么办?</p>
-<p>还是拿<code>spdlog-&gt;fmt</code>为例,对于<code>vs_runtime</code>这种可以自动继承配置,因为它是内置配置项,很多私有配置就没法处理了。</p>
+<p>还是拿<code>spdlog->fmt</code>为例,对于<code>vs_runtime</code>这种可以自动继承配置,因为它是内置配置项,很多私有配置就没法处理了。</p>
 <p>这个时候,我们可以通过在外层项目xmake.lua提前通过<code>add_requires</code>添加fmt包(这个时候你可以设置各种自己的配置),<br>确保spdlog在在安装之前,fmt已经通过<code>add_requires</code>的配置完成了安装,那么在安装spdlog的时候,就会自动检测到,并直接使用,不会在内部继续安装fmt依赖。</p>
 <p>例如:</p>
-<pre><code class="lang-lua">add_requires(&quot;fmt&quot;, {system = false, configs = {cxflags = &quot;-fPIC&quot;}})
-add_requires(&quot;spdlog&quot;, {system = false, configs = {fmt_external = true, cxflags = &quot;-fPIC&quot;}})
+<pre><code class="lang-lua">add_requires("fmt", {system = false, configs = {cxflags = "-fPIC"}})
+add_requires("spdlog", {system = false, configs = {fmt_external = true, cxflags = "-fPIC"}})
 </code></pre>
 <p>我们的项目需要spdlog启用fPIC编译,那么它的fmt依赖包也需要启用,那么我们可以在spdlog的上面优先添加fmt包,也设置上fPIC提前安装掉即可。</p>
 <p>通过这种方式,spdlog对应内部的fmt依赖包,我们也可以在上层通过<code>add_requires</code>灵活的设置各种复杂的自定义配置。</p>
 <h2 id="-">第三方依赖包安装</h2>
 <p>2.2.5版本之后,xmake支持对对第三方包管理器里面的依赖库安装支持,例如:conan,brew, vcpkg等</p>
 <h3 id="-homebrew-">添加homebrew的依赖包</h3>
-<pre><code class="lang-lua">add_requires(&quot;brew::zlib&quot;, {alias = &quot;zlib&quot;}})
-add_requires(&quot;brew::pcre2/libpcre2-8&quot;, {alias = &quot;pcre2&quot;}})
+<pre><code class="lang-lua">add_requires("brew::zlib", {alias = "zlib"}})
+add_requires("brew::pcre2/libpcre2-8", {alias = "pcre2"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;pcre2&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("pcre2", "zlib")
 </code></pre>
 <h3 id="-vcpkg-">添加vcpkg的依赖包</h3>
-<pre><code class="lang-lua">add_requires(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+<pre><code class="lang-lua">add_requires("vcpkg::zlib", "vcpkg::pcre2")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;vcpkg::zlib&quot;, &quot;vcpkg::pcre2&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("vcpkg::zlib", "vcpkg::pcre2")
 </code></pre>
 <p>我们也可以加个包别名,简化对<code>add_packages</code>的使用:</p>
-<pre><code class="lang-lua">add_requires(&quot;vcpkg::zlib&quot;, {alias = &quot;zlib&quot;})
-add_requires(&quot;vcpkg::pcre2&quot;, {alias = &quot;pcre2&quot;})
+<pre><code class="lang-lua">add_requires("vcpkg::zlib", {alias = "zlib"})
+add_requires("vcpkg::pcre2", {alias = "pcre2"})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;zlib&quot;, &quot;pcre2&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("zlib", "pcre2")
 </code></pre>
 <h3 id="-conan-">添加conan的依赖包</h3>
-<pre><code class="lang-lua">add_requires(&quot;CONAN::zlib/1.2.11@conan/stable&quot;, {alias = &quot;zlib&quot;, debug = true})
-add_requires(&quot;CONAN::OpenSSL/1.0.2n@conan/stable&quot;, {alias = &quot;openssl&quot;, 
-    configs = {options = &quot;OpenSSL:shared=True&quot;}})
+<pre><code class="lang-lua">add_requires("CONAN::zlib/1.2.11@conan/stable", {alias = "zlib", debug = true})
+add_requires("CONAN::OpenSSL/1.0.2n@conan/stable", {alias = "openssl", 
+    configs = {options = "OpenSSL:shared=True"}})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("openssl", "zlib")
 </code></pre>
 <p>执行xmake进行编译后:</p>
 <pre><code class="lang-console">ruki:test_package ruki$ xmake
@@ -259,12 +259,12 @@ checking for the architecture ... x86_64
 checking for the Xcode directory ... /Applications/Xcode.app
 checking for the SDK version of Xcode ... 10.14
 note: try installing these packages (pass -y to skip confirm)?
-  -&gt; CONAN::zlib/1.2.11@conan/stable  (debug)
-  -&gt; CONAN::OpenSSL/1.0.2n@conan/stable  
+  -> CONAN::zlib/1.2.11@conan/stable  (debug)
+  -> CONAN::OpenSSL/1.0.2n@conan/stable  
 please input: y (y/n)
 
-  =&gt; installing CONAN::zlib/1.2.11@conan/stable .. ok
-  =&gt; installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
+  => installing CONAN::zlib/1.2.11@conan/stable .. ok
+  => installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
 
 [  0%]: ccache compiling.release src/main.c
 [100%]: linking.release test
@@ -272,13 +272,13 @@ please input: y (y/n)
 <h3 id="-clib-">添加clib的依赖包</h3>
 <p>clib是一款基于源码的依赖包管理器,拉取的依赖包是直接下载对应的库源码,集成到项目中编译,而不是二进制库依赖。</p>
 <p>其在xmake中集成也很方便,唯一需要注意的是,还需要自己添加上对应库的源码到xmake.lua,例如:</p>
-<pre><code class="lang-lua">add_requires(&quot;clib::clibs/[email protected]&quot;, {alias = &quot;bytes&quot;})
+<pre><code class="lang-lua">add_requires("clib::clibs/[email protected]", {alias = "bytes"})
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;clib/bytes/*.c&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;bytes&quot;)
+target("test")
+    set_kind("binary")
+    add_files("clib/bytes/*.c")
+    add_files("src/*.c") 
+    add_packages("bytes")
 </code></pre>
 <h2 id="-">使用自建私有包仓库</h2>
 <p>如果需要的包不在官方仓库<a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a>中,我们可以提交贡献代码到仓库进行支持。<br>但如果有些包仅用于个人或者私有项目,我们可以建立一个私有仓库repo,仓库组织结构可参考:<a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a></p>
@@ -286,12 +286,12 @@ target(&quot;test&quot;)
 <p>我们可以通过下面的命令进行仓库添加:</p>
 <pre><code class="lang-console">$ xmake repo --add myrepo [email protected]:myrepo/xmake-repo.git [branch]
 </code></pre>
-<p>!&gt; [branch]是可选的,我们也可以切换到指定repo分支</p>
+<p>!> [branch]是可选的,我们也可以切换到指定repo分支</p>
 <p>或者我们直接写在xmake.lua中:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo [email protected]:myrepo/xmake-repo.git")
 </code></pre>
 <p>同样,我们也可以切换到指定repo分支</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo [email protected]:myrepo/xmake-repo.git dev&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo [email protected]:myrepo/xmake-repo.git dev")
 </code></pre>
 <p>如果我们只是想添加一两个私有包,这个时候特定去建立一个git repo太小题大做了,我们可以直接把包仓库放置项目里面,例如:</p>
 <pre><code>projectdir
@@ -303,35 +303,35 @@ target(&quot;test&quot;)
     - main.c
   - xmake.lua
 </code></pre><p>上面myrepo目录就是自己的私有包仓库,内置在自己的项目里面,然后在xmake.lua里面添加一下这个仓库位置:</p>
-<pre><code class="lang-lua">add_repositories(&quot;my-repo myrepo&quot;)
+<pre><code class="lang-lua">add_repositories("my-repo myrepo")
 </code></pre>
 <p>这个可以参考<a href="https://github.com/tboox/benchbox">benchbox</a>项目,里面就内置了一个私有仓库。</p>
 <p>我们甚至可以连仓库也不用建,直接定义包描述到项目xmake.lua中,这对依赖一两个包的情况还是很有用的,例如:</p>
-<pre><code class="lang-lua">package(&quot;libjpeg&quot;)
+<pre><code class="lang-lua">package("libjpeg")
 
-    set_urls(&quot;http://www.ijg.org/files/jpegsrc.$(version).tar.gz&quot;)
+    set_urls("http://www.ijg.org/files/jpegsrc.$(version).tar.gz")
 
-    add_versions(&quot;v9c&quot;, &quot;650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122&quot;)
+    add_versions("v9c", "650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122")
 
-    on_install(&quot;windows&quot;, function (package)
-        os.mv(&quot;jconfig.vc&quot;, &quot;jconfig.h&quot;)
-        os.vrun(&quot;nmake -f makefile.vc&quot;)
-        os.cp(&quot;*.h&quot;, package:installdir(&quot;include&quot;))
-        os.cp(&quot;libjpeg.lib&quot;, package:installdir(&quot;lib&quot;))
+    on_install("windows", function (package)
+        os.mv("jconfig.vc", "jconfig.h")
+        os.vrun("nmake -f makefile.vc")
+        os.cp("*.h", package:installdir("include"))
+        os.cp("libjpeg.lib", package:installdir("lib"))
     end)
 
-    on_install(&quot;macosx&quot;, &quot;linux&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).install(package)
+    on_install("macosx", "linux", function (package)
+        import("package.tools.autoconf").install(package)
     end)
 
 package_end()
 
-add_requires(&quot;libjpeg&quot;)
+add_requires("libjpeg")
 
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_files(&quot;src/*.c&quot;) 
-    add_packages(&quot;libjpeg&quot;)
+target("test")
+    set_kind("binary")
+    add_files("src/*.c") 
+    add_packages("libjpeg")
 </code></pre>
 <p>关于如何编写自定义包描述规则,详情见:<a href="#添加包到仓库">添加包到仓库</a></p>
 <h2 id="-">包管理命令使用</h2>
@@ -340,13 +340,13 @@ target(&quot;test&quot;)
 <pre><code class="lang-console">$ xmake require tbox
 </code></pre>
 <p>安装指定版本包:</p>
-<pre><code class="lang-console">$ xmake require tbox &quot;~1.6&quot;
+<pre><code class="lang-console">$ xmake require tbox "~1.6"
 </code></pre>
 <p>强制重新下载安装,并且显示详细安装信息:</p>
-<pre><code class="lang-console">$ xmake require -f -v tbox &quot;1.5.x&quot;
+<pre><code class="lang-console">$ xmake require -f -v tbox "1.5.x"
 </code></pre>
 <p>传递额外的设置信息:</p>
-<pre><code class="lang-console">$ xmake require --extra=&quot;debug=true,config={small=true}&quot; tbox
+<pre><code class="lang-console">$ xmake require --extra="debug=true,config={small=true}" tbox
 </code></pre>
 <p>安装debug包,并且传递<code>small=true</code>的编译配置信息到包中去。</p>
 <h3 id="-">卸载指定包</h3>
@@ -373,7 +373,7 @@ target(&quot;test&quot;)
 <p>v2.2.3开始,支持添加指定分支的repo,例如:</p>
 <pre><code class="lang-console">$ xmake repo --add myrepo [email protected]:myrepo/xmake-repo.git dev
 </code></pre>
-<p>!&gt; 我们也可以添加本地仓库路径,即使没有git也是可以支持的,用于在本地快速的调试repo中的包。</p>
+<p>!> 我们也可以添加本地仓库路径,即使没有git也是可以支持的,用于在本地快速的调试repo中的包。</p>
 <p>我们也可以移除已安装的某个仓库:</p>
 <pre><code class="lang-console">$ xmake repo --remove myrepo
 </code></pre>
@@ -388,18 +388,18 @@ target(&quot;test&quot;)
 <h3 id="-">手动下载</h3>
 <p>默认xmake会调用curl, wget等工具来下载,用户也可以手动用自己的下载器下载(也可以使用代理),把下载后的包放到自己的目录下,比如: <code>/download/packages/zlib-v1.0.tar.gz</code></p>
 <p>然后使用下面的命令,设置包下载的搜索目录:</p>
-<pre><code class="lang-console">$ xmake g --pkg_searchdirs=&quot;/download/packages&quot;
+<pre><code class="lang-console">$ xmake g --pkg_searchdirs="/download/packages"
 </code></pre>
 <p>然后重新执行xmake编译时候,xmake会优先从<code>/download/packages</code>找寻源码包,然后直接使用,不再自己下载了。</p>
 <p>至于找寻的包名是怎样的呢,可以通过下面的命令查看:</p>
 <pre><code class="lang-console">$ xmake require --info zlib
--&gt; searchdirs: /download/packages
--&gt; searchnames: zlib-1.2.11.tar.gz
+-> searchdirs: /download/packages
+-> searchnames: zlib-1.2.11.tar.gz
 </code></pre>
 <p>我们可以看到对应的搜索目录以及搜索的包名。</p>
 <h3 id="-">设置代理</h3>
 <p>如果觉得手动下载还是麻烦,我们也可以让xmake直接走代理。</p>
-<pre><code class="lang-console">$ xmake g --proxy=&quot;socks5://127.0.0.1:1086&quot;
+<pre><code class="lang-console">$ xmake g --proxy="socks5://127.0.0.1:1086"
 $ xmake g --help
     -x PROXY, --proxy=PROXY  Use proxy on given port. [PROTOCOL://]HOST[:PORT]
                                  e.g.
@@ -426,21 +426,21 @@ $ xmake g --help
                                            end
                                        end
 </code></pre>
-<p>!&gt; 如果有proxy_hosts优先走hosts配置,没有的话才走pac配置。</p>
+<p>!> 如果有proxy_hosts优先走hosts配置,没有的话才走pac配置。</p>
 <p>pac的默认路径:~/.xmake/pac.lua,如果--proxy被设置,并且这个文件存在,就会自动走pac,如果不存在,也没hosts,那就全局生效代理。</p>
 <p>也可以手动指定pac全路径</p>
 <pre><code class="lang-console">$ xmake g --proxy_pac=/xxxx/xxxxx_pac.lua
 </code></pre>
 <p>配置规则描述:</p>
 <pre><code class="lang-lua">function main(url, host)
-    if host:find(&quot;bintray.com&quot;) then
+    if host:find("bintray.com") then
         return true
     end
 end
 </code></pre>
 <p>如果返回true,那么这个url和host就是走的代理,不返回或者返回false,就是不走代理。</p>
 <p>这块的具体详情见:<a href="https://github.com/xmake-io/xmake/issues/854">https://github.com/xmake-io/xmake/issues/854</a></p>
-<p>!&gt; 另外,除了依赖包下载,其他涉及网络下载的命令也都支持代理,比如:<code>xmake update</code></p>
+<p>!> 另外,除了依赖包下载,其他涉及网络下载的命令也都支持代理,比如:<code>xmake update</code></p>
 <h2 id="-">添加包到仓库</h2>
 <h3 id="-">仓库包结构</h3>
 <p>在制作自己的包之前,我们需要先了解下一个包仓库的结构,不管是官方包仓库,还是自建私有包仓库,结构都是相同的:</p>
@@ -453,38 +453,38 @@ end
 <p>关于包的描述规则,基本上都是在它的xmake.lua里面完成的,这跟项目工程里面的xmake.lua描述很类似,不同的是描述域仅支持<code>package()</code>,</p>
 <p>不过,在项目xmake.lua里面,也是可以直接添加<code>package()</code>来内置包描述的,连包仓库都省了,有时候这样会更加方便。</p>
 <p>首先,我们先拿zlib的描述规则,来直观感受下,这个规则可以在<a href="https://github.com/xmake-io/xmake-repo/blob/master/packages/z/zlib/xmake.lua">xmake-repo/z/zlib/xmake.lua</a>下找到。</p>
-<pre><code>package(&quot;zlib&quot;)
+<pre><code>package("zlib")
 
-    set_homepage(&quot;http://www.zlib.net&quot;)
-    set_description(&quot;A Massively Spiffy Yet Delicately Unobtrusive Compression Library&quot;)
+    set_homepage("http://www.zlib.net")
+    set_description("A Massively Spiffy Yet Delicately Unobtrusive Compression Library")
 
-    set_urls(&quot;http://zlib.net/zlib-$(version).tar.gz&quot;,
-             &quot;https://downloads.sourceforge.net/project/libpng/zlib/$(version)/zlib-$(version).tar.gz&quot;)
+    set_urls("http://zlib.net/zlib-$(version).tar.gz",
+             "https://downloads.sourceforge.net/project/libpng/zlib/$(version)/zlib-$(version).tar.gz")
 
-    add_versions(&quot;1.2.10&quot;, &quot;8d7e9f698ce48787b6e1c67e6bff79e487303e66077e25cb9784ac8835978017&quot;)
-    add_versions(&quot;1.2.11&quot;, &quot;c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1&quot;)
+    add_versions("1.2.10", "8d7e9f698ce48787b6e1c67e6bff79e487303e66077e25cb9784ac8835978017")
+    add_versions("1.2.11", "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1")
 
-    on_install(&quot;windows&quot;, function (package)
-        io.gsub(&quot;win32/Makefile.msc&quot;, &quot;%-MD&quot;, &quot;-&quot; .. package:config(&quot;vs_runtime&quot;))
-        os.vrun(&quot;nmake -f win32\\Makefile.msc zlib.lib&quot;)
-        os.cp(&quot;zlib.lib&quot;, package:installdir(&quot;lib&quot;))
-        os.cp(&quot;*.h&quot;, package:installdir(&quot;include&quot;))
+    on_install("windows", function (package)
+        io.gsub("win32/Makefile.msc", "%-MD", "-" .. package:config("vs_runtime"))
+        os.vrun("nmake -f win32\\Makefile.msc zlib.lib")
+        os.cp("zlib.lib", package:installdir("lib"))
+        os.cp("*.h", package:installdir("include"))
     end)
 
-    on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).install(package, {&quot;--static&quot;})
+    on_install("linux", "macosx", function (package)
+        import("package.tools.autoconf").install(package, {"--static"})
     end)
 
-    on_install(&quot;iphoneos&quot;, &quot;android@linux,macosx&quot;, &quot;mingw@linux,macosx&quot;, function (package)
-        import(&quot;package.tools.autoconf&quot;).configure(package, {host = &quot;&quot;, &quot;--static&quot;})
-        io.gsub(&quot;Makefile&quot;, &quot;\nAR=.-\n&quot;,      &quot;\nAR=&quot; .. (package:build_getenv(&quot;ar&quot;) or &quot;&quot;) .. &quot;\n&quot;)
-        io.gsub(&quot;Makefile&quot;, &quot;\nARFLAGS=.-\n&quot;, &quot;\nARFLAGS=cr\n&quot;)
-        io.gsub(&quot;Makefile&quot;, &quot;\nRANLIB=.-\n&quot;,  &quot;\nRANLIB=\n&quot;)
-        os.vrun(&quot;make install -j4&quot;)
+    on_install("iphoneos", "android@linux,macosx", "mingw@linux,macosx", function (package)
+        import("package.tools.autoconf").configure(package, {host = "", "--static"})
+        io.gsub("Makefile", "\nAR=.-\n",      "\nAR=" .. (package:build_getenv("ar") or "") .. "\n")
+        io.gsub("Makefile", "\nARFLAGS=.-\n", "\nARFLAGS=cr\n")
+        io.gsub("Makefile", "\nRANLIB=.-\n",  "\nRANLIB=\n")
+        os.vrun("make install -j4")
     end)
 
     on_test(function (package)
-        assert(package:has_cfuncs(&quot;inflate&quot;, {includes = &quot;zlib.h&quot;}))
+        assert(package:has_cfuncs("inflate", {includes = "zlib.h"}))
     end)
 </code></pre><p>这个包规则对windows, linux, macosx, iphoneos,mingw等平台都添加了安装规则,基本上已经做到了全平台覆盖,甚至一些交叉编译平台,算是一个比较典型的例子了。</p>
 <p>当然,有些包依赖源码实现力度,并不能完全跨平台,那么只需对它支持的平台设置安装规则即可。</p>
@@ -494,59 +494,59 @@ end
 <p>设置包的相关描述信息,一般通过<code>xmake require --info zlib</code>查看相关包信息时候,会看到。</p>
 <h4 id="set_kind">set_kind</h4>
 <p>设置包类型,对于依赖库,则不用设置,如果是可执行包,需要设置为binary。</p>
-<pre><code>package(&quot;cmake&quot;)
+<pre><code>package("cmake")
 
-    set_kind(&quot;binary&quot;)
-    set_homepage(&quot;https://cmake.org&quot;)
-    set_description(&quot;A cross-platform family of tool designed to build, test and package software&quot;)
+    set_kind("binary")
+    set_homepage("https://cmake.org")
+    set_description("A cross-platform family of tool designed to build, test and package software")
 </code></pre><h4 id="set_urls">set_urls</h4>
 <p>设置包的源码包或者git仓库地址,跟add_urls不同的是,此接口是覆盖性设置,而add_urls是追加设置,其他使用方式类似,这个根据不同需要来选择。</p>
 <h4 id="add_urls">add_urls</h4>
 <p>添加包的源码包或者git仓库地址,此接口一般跟add_version配对使用,用于设置每个源码包的版本和对应的sha256值。</p>
-<p>!&gt; 可以通过添加多个urls作为镜像源,xmake会自动检测优先选用最快的url进行下载,如果下载失败则会尝试其他urls。</p>
-<pre><code class="lang-lua">add_urls(&quot;https://github.com/protobuf-c/protobuf-c/releases/download/v$(version)/protobuf-c-$(version).tar.gz&quot;)
-add_versions(&quot;1.3.1&quot;, &quot;51472d3a191d6d7b425e32b612e477c06f73fe23e07f6a6a839b11808e9d2267&quot;)
+<p>!> 可以通过添加多个urls作为镜像源,xmake会自动检测优先选用最快的url进行下载,如果下载失败则会尝试其他urls。</p>
+<pre><code class="lang-lua">add_urls("https://github.com/protobuf-c/protobuf-c/releases/download/v$(version)/protobuf-c-$(version).tar.gz")
+add_versions("1.3.1", "51472d3a191d6d7b425e32b612e477c06f73fe23e07f6a6a839b11808e9d2267")
 </code></pre>
 <p>urls里面的<code>$(version)</code>内置变量,会根据实际安装时候选择的版本适配进去,而版本号都是从<code>add_versions</code>中指定的版本列表中选择的。</p>
 <p>如果对于urls里面带有比较复杂的版本串,没有跟add_versions有直接对应关系,则需要通过下面的方式定制化转换下:</p>
-<pre><code class="lang-lua">add_urls(&quot;https://sqlite.org/2018/sqlite-autoconf-$(version)000.tar.gz&quot;,
-         {version = function (version) return version:gsub(&quot;%.&quot;, &quot;&quot;) end})
+<pre><code class="lang-lua">add_urls("https://sqlite.org/2018/sqlite-autoconf-$(version)000.tar.gz",
+         {version = function (version) return version:gsub("%.", "") end})
 
-add_versions(&quot;3.24.0&quot;, &quot;d9d14e88c6fb6d68de9ca0d1f9797477d82fc3aed613558f87ffbdbbc5ceb74a&quot;)
-add_versions(&quot;3.23.0&quot;, &quot;b7711a1800a071674c2bf76898ae8584fc6c9643cfe933cfc1bc54361e3a6e49&quot;)
+add_versions("3.24.0", "d9d14e88c6fb6d68de9ca0d1f9797477d82fc3aed613558f87ffbdbbc5ceb74a")
+add_versions("3.23.0", "b7711a1800a071674c2bf76898ae8584fc6c9643cfe933cfc1bc54361e3a6e49")
 </code></pre>
 <p>当然,我们也只可以添加git源码地址:</p>
-<pre><code class="lang-lua">add_urls(&quot;https://gitlab.gnome.org/GNOME/libxml2.git&quot;)
+<pre><code class="lang-lua">add_urls("https://gitlab.gnome.org/GNOME/libxml2.git")
 </code></pre>
 <p>如果设置的多个镜像地址对应的源码包sha256是不同的,我们可以通过alias的方式来分别设置</p>
-<pre><code class="lang-lua">add_urls(&quot;https://ffmpeg.org/releases/ffmpeg-$(version).tar.bz2&quot;, {alias = &quot;home&quot;})
-add_urls(&quot;https://github.com/FFmpeg/FFmpeg/archive/n$(version).zip&quot;, {alias = &quot;github&quot;})
-add_versions(&quot;home:4.0.2&quot;, &quot;346c51735f42c37e0712e0b3d2f6476c86ac15863e4445d9e823fe396420d056&quot;)
-add_versions(&quot;github:4.0.2&quot;, &quot;4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1bb34062a097f026&quot;)
+<pre><code class="lang-lua">add_urls("https://ffmpeg.org/releases/ffmpeg-$(version).tar.bz2", {alias = "home"})
+add_urls("https://github.com/FFmpeg/FFmpeg/archive/n$(version).zip", {alias = "github"})
+add_versions("home:4.0.2", "346c51735f42c37e0712e0b3d2f6476c86ac15863e4445d9e823fe396420d056")
+add_versions("github:4.0.2", "4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1bb34062a097f026")
 </code></pre>
 <h4 id="add_versions">add_versions</h4>
 <p>用于设置每个源码包的版本和对应的sha256值,具体描述见:<a href="#add_urls">add_urls</a></p>
 <h4 id="add_patches">add_patches</h4>
 <p>此接口用于针对源码包,在编译安装前,先打对应设置的补丁包,再对其进行编译,并且可支持同时打多个补丁。</p>
-<pre><code class="lang-lua">if is_plat(&quot;macosx&quot;) then
-    add_patches(&quot;1.15&quot;, &quot;https://raw.githubusercontent.com/Homebrew/patches/9be2793af/libiconv/patch-utf8mac.diff&quot;,
-                        &quot;e8128732f22f63b5c656659786d2cf76f1450008f36bcf541285268c66cabeab&quot;)
+<pre><code class="lang-lua">if is_plat("macosx") then
+    add_patches("1.15", "https://raw.githubusercontent.com/Homebrew/patches/9be2793af/libiconv/patch-utf8mac.diff",
+                        "e8128732f22f63b5c656659786d2cf76f1450008f36bcf541285268c66cabeab")
 end
 </code></pre>
 <p>例如,上面的代码,就是针对macosx下编译的时候,打上对应的patch-utf8mac.diff补丁,并且每个补丁后面也是要设置sha256值的,确保完整性。</p>
 <h4 id="add_links">add_links</h4>
 <p>默认情况下,xmake会去自动检测安装后的库,设置链接关系,但是有时候并不是很准,如果要自己手动调整链接顺序,以及链接名,则可以通过这个接口来设置。</p>
-<pre><code class="lang-lua">add_links(&quot;mbedtls&quot;, &quot;mbedx509&quot;, &quot;mbedcrypto&quot;)
+<pre><code class="lang-lua">add_links("mbedtls", "mbedx509", "mbedcrypto")
 </code></pre>
 <h4 id="add_syslinks">add_syslinks</h4>
 <p>添加一些系统库链接,有些包集成链接的时候,还需要依赖一些系统库,才能链接通过,这个时候可以在包描述里面都附加上去。</p>
-<pre><code>if is_plat(&quot;macosx&quot;) then
-    add_frameworks(&quot;CoreGraphics&quot;, &quot;CoreFoundation&quot;, &quot;Foundation&quot;)
-elseif is_plat(&quot;windows&quot;) then
-    add_defines(&quot;CAIRO_WIN32_STATIC_BUILD=1&quot;)
-    add_syslinks(&quot;gdi32&quot;, &quot;msimg32&quot;, &quot;user32&quot;)
+<pre><code>if is_plat("macosx") then
+    add_frameworks("CoreGraphics", "CoreFoundation", "Foundation")
+elseif is_plat("windows") then
+    add_defines("CAIRO_WIN32_STATIC_BUILD=1")
+    add_syslinks("gdi32", "msimg32", "user32")
 else
-    add_syslinks(&quot;pthread&quot;)
+    add_syslinks("pthread")
 end
 </code></pre><h4 id="add_frameworks">add_frameworks</h4>
 <p>添加依赖的系统frameworks链接。</p>
@@ -559,42 +559,42 @@ end
 <p>可以对集成的包对外输出一些特定的定义选项。</p>
 <h4 id="add_configs">add_configs</h4>
 <p>我们可以通过此接口添加每个包的对外输出配置参数:</p>
-<pre><code class="lang-lua">package(&quot;pcre2&quot;)
+<pre><code class="lang-lua">package("pcre2")
 
-    set_homepage(&quot;https://www.pcre.org/&quot;)
-    set_description(&quot;A Perl Compatible Regular Expressions Library&quot;)
+    set_homepage("https://www.pcre.org/")
+    set_description("A Perl Compatible Regular Expressions Library")
 
-    add_configs(&quot;bitwidth&quot;, {description = &quot;Set the code unit width.&quot;, default = &quot;8&quot;, values = {&quot;8&quot;, &quot;16&quot;, &quot;32&quot;}})
+    add_configs("bitwidth", {description = "Set the code unit width.", default = "8", values = {"8", "16", "32"}})
 
     on_load(function (package)
-        local bitwidth = package:config(&quot;bitwidth&quot;) or &quot;8&quot;
-        package:add(&quot;links&quot;, &quot;pcre2-&quot; .. bitwidth)
-        package:add(&quot;defines&quot;, &quot;PCRE2_CODE_UNIT_WIDTH=&quot; .. bitwidth)
+        local bitwidth = package:config("bitwidth") or "8"
+        package:add("links", "pcre2-" .. bitwidth)
+        package:add("defines", "PCRE2_CODE_UNIT_WIDTH=" .. bitwidth)
     end)
 </code></pre>
 <p>在工程项目里面,我们也可以查看特定包的可配置参数和值列表:</p>
 <pre><code class="lang-bash">$ xmake require --info pcre2
 The package info of project:
     require(pcre2): 
-      -&gt; description: A Perl Compatible Regular Expressions Library
-      -&gt; version: 10.31
+      -> description: A Perl Compatible Regular Expressions Library
+      -> version: 10.31
       ...
-      -&gt; configs:
-         -&gt; bitwidth:
-            -&gt; description: Set the code unit width.
-            -&gt; values: {&quot;8&quot;,&quot;16&quot;,&quot;32&quot;}
-            -&gt; default: 8
+      -> configs:
+         -> bitwidth:
+            -> description: Set the code unit width.
+            -> values: {"8","16","32"}
+            -> default: 8
 </code></pre>
 <p>然后在项目里面,启用这些配置,编译集成带有特定配置的包:</p>
-<pre><code class="lang-lua">add_requires(&quot;pcre2&quot;, {configs = {bitwidth = 16}})
+<pre><code class="lang-lua">add_requires("pcre2", {configs = {bitwidth = 16}})
 </code></pre>
 <h4 id="on_load">on_load</h4>
 <p>这是个可选的接口,如果要更加灵活的动态判断各种平台架构,针对性做设置,可以在这个里面完成,例如:</p>
 <pre><code class="lang-lua">on_load(function (package)
-    local bitwidth = package:config(&quot;bitwidth&quot;) or &quot;8&quot;
-    package:add(&quot;links&quot;, &quot;pcre&quot; .. (bitwidth ~= &quot;8&quot; and bitwidth or &quot;&quot;))
-    if not package:config(&quot;shared&quot;) then
-        package:add(&quot;defines&quot;, &quot;PCRE_STATIC&quot;)
+    local bitwidth = package:config("bitwidth") or "8"
+    package:add("links", "pcre" .. (bitwidth ~= "8" and bitwidth or ""))
+    if not package:config("shared") then
+        package:add("defines", "PCRE_STATIC")
     end
 end)
 </code></pre>
@@ -610,24 +610,24 @@ end)
 end)
 </code></pre>
 <p>如果安装脚本对特定平台生效,那么直接指定对应的编译平台,可以同时指定多个:</p>
-<pre><code class="lang-lua">on_install(&quot;linux&quot;, &quot;macosx&quot;, function (package)
+<pre><code class="lang-lua">on_install("linux", "macosx", function (package)
     -- TODO
 end)
 </code></pre>
 <p>如果还要细分到指定架构才能生效,可以这么写:</p>
-<pre><code class="lang-lua">on_install(&quot;linux|x86_64&quot;, &quot;iphoneos|arm64&quot;, function (package)
+<pre><code class="lang-lua">on_install("linux|x86_64", "iphoneos|arm64", function (package)
     -- TODO
 end)
 </code></pre>
 <p>如果还要限制执行的主机环境平台和架构,可以在后面追加<code>@host|arch</code>,例如:</p>
-<pre><code class="lang-lua">on_install(&quot;mingw@windows&quot;, function (package)
+<pre><code class="lang-lua">on_install("mingw@windows", function (package)
     -- TODO
 end)
 </code></pre>
 <p>意思就是仅对windows下编译mingw平台生效。</p>
 <p>我们也可以不指定比那一平台和架构,仅设置主机平台和架构,这通常用于描述一些跟编译工具相关的依赖包,只能在主机环境运行。</p>
 <p>例如,我们编译的包,依赖了cmake,需要添加cmake的包描述,那么里面编译安装环境,只能是主机平台:</p>
-<pre><code class="lang-lua">on_install(&quot;@windows&quot;, &quot;@linux&quot;, &quot;@macosx&quot;, function (package)
+<pre><code class="lang-lua">on_install("@windows", "@linux", "@macosx", function (package)
     -- TODO
 end)
 </code></pre>
@@ -645,77 +645,77 @@ end)
 <h6 id="xmake">xmake</h6>
 <p>如果是基于xmake的依赖包,那么集成起来就非常简单了,xmake对其做了非常好的内置集成支持,可以直接对其进行跨平台编译支持,一般情况下只需要:</p>
 <pre><code class="lang-lua">on_install(function (package)
-    import(&quot;package.tools.xmake&quot;).install(package)
+    import("package.tools.xmake").install(package)
 end)
 </code></pre>
 <p>如果要传递一些特有的编译配置参数:</p>
 <pre><code class="lang-lua">on_install(function (package)
-    import(&quot;package.tools.xmake&quot;).install(package, {&quot;--xxx=y&quot;})
+    import("package.tools.xmake").install(package, {"--xxx=y"})
 end)
 </code></pre>
 <h6 id="cmake">cmake</h6>
 <p>如果是基于cmake的包,集成起来也很简答,通常也只需要设置一些配置参数即可,不过还需要先添加上cmake的依赖才行:</p>
-<pre><code class="lang-lua">add_deps(&quot;cmake&quot;)
+<pre><code class="lang-lua">add_deps("cmake")
 on_install(function (package)
-    import(&quot;package.tools.cmake&quot;).install(package, {&quot;-Dxxx=ON&quot;})
+    import("package.tools.cmake").install(package, {"-Dxxx=ON"})
 end)
 </code></pre>
 <h6 id="autoconf">autoconf</h6>
 <p>如果是基于autoconf的包,集成方式跟cmake类似,只是传递的配置参数不同而已,不过通常情况下,unix系统都内置了autoconf系列工具,所以不加相关依赖也没事。</p>
 <pre><code class="lang-lua">on_install(function (package)
-    import(&quot;package.tools.autoconf&quot;).install(package, {&quot;--enable-shared=no&quot;})
+    import("package.tools.autoconf").install(package, {"--enable-shared=no"})
 end)
 </code></pre>
 <p>不过,有些源码包用系统内置的autoconf可能不能完全满足,那么可以加上autoconf系列依赖,对其进行构建:</p>
-<pre><code class="lang-lua">add_deps(&quot;autoconf&quot;, &quot;automake&quot;, &quot;libtool&quot;, &quot;pkg-config&quot;)
+<pre><code class="lang-lua">add_deps("autoconf", "automake", "libtool", "pkg-config")
 on_install(function (package)
-    import(&quot;package.tools.autoconf&quot;).install(package, {&quot;--enable-shared=no&quot;})
+    import("package.tools.autoconf").install(package, {"--enable-shared=no"})
 end)
 </code></pre>
 <h6 id="meson">meson</h6>
 <p>如果是meson,还需要加上ninja的依赖来执行构建才行。</p>
-<pre><code class="lang-lua">add_deps(&quot;meson&quot;, &quot;ninja&quot;)
+<pre><code class="lang-lua">add_deps("meson", "ninja")
 on_install(function (package)
-    import(&quot;package.tools.meson&quot;).install(package, {&quot;-Dxxx=ON&quot;})
+    import("package.tools.meson").install(package, {"-Dxxx=ON"})
 end)
 </code></pre>
 <h4 id="on_test">on_test</h4>
 <p>安装后,需要设置对应的测试脚本,执行一些测试,确保安装包的可靠性,如果测试不通过,则会撤销整个安装包。</p>
 <pre><code class="lang-lua">on_test(function (package)
-    assert(package:has_cfuncs(&quot;inflate&quot;, {includes = &quot;zlib.h&quot;}))
+    assert(package:has_cfuncs("inflate", {includes = "zlib.h"}))
 end)
 </code></pre>
 <p>上面的脚本调用包内置的<code>has_cfuncs</code>接口,检测安装后的包是否存在zlib.h头文件,以及库和头文件里面是否存在<code>inflate</code>这个接口函数。</p>
 <p>xmake会去尝试编译链接来做测试,<code>has_cfuncs</code>用于检测c函数,而<code>has_cxxfuncs</code>则可以检测c++库函数。</p>
-<p>而includes里面可以设置多个头文件,例如:<code>includes = {&quot;xxx.h&quot;, &quot;yyy.h&quot;}</code></p>
+<p>而includes里面可以设置多个头文件,例如:<code>includes = {"xxx.h", "yyy.h"}</code></p>
 <p>我们还可以传递一些自己的编译参数进去检测,例如:</p>
 <pre><code class="lang-lua">on_test(function (package)
-    assert(package:has_cxxfuncs(&quot;func1&quot;, {includes = &quot;xxx.h&quot;, configs = {defines = &quot;c++14&quot;, cxflags = &quot;-Dxxx&quot;}}))
+    assert(package:has_cxxfuncs("func1", {includes = "xxx.h", configs = {defines = "c++14", cxflags = "-Dxxx"}}))
 end)
 </code></pre>
 <p>我们也可以通过<code>check_csnippets</code>和<code>check_cxxsnippets</code>检测一个代码片段:</p>
 <pre><code class="lang-lua">on_test(function (package)
     assert(package:check_cxxsnippets({test = [[
-        #include &lt;boost/algorithm/string.hpp&gt;
-        #include &lt;string&gt;
-        #include &lt;vector&gt;
-        #include &lt;assert.h&gt;
+        #include <boost/algorithm/string.hpp>
+        #include <string>
+        #include <vector>
+        #include <assert.h>
         using namespace boost::algorithm;
         using namespace std;
         static void test() {
-            string str(&quot;a,b&quot;);
-            vector&lt;string&gt; strVec;
-            split(strVec, str, is_any_of(&quot;,&quot;));
+            string str("a,b");
+            vector<string> strVec;
+            split(strVec, str, is_any_of(","));
             assert(strVec.size()==2);
-            assert(strVec[0]==&quot;a&quot;);
-            assert(strVec[1]==&quot;b&quot;);
+            assert(strVec[0]=="a");
+            assert(strVec[1]=="b");
         }
-    ]]}, {configs = {languages = &quot;c++14&quot;}}))
+    ]]}, {configs = {languages = "c++14"}}))
 end)
 </code></pre>
 <p>如果是可执行包,也可以通过尝试运行来检测:</p>
 <pre><code class="lang-lua">on_test(function (package)
-    os.run(&quot;xxx --help&quot;)
+    os.run("xxx --help")
 end)
 </code></pre>
 <p>如果运行失败,那么测试不会通过。</p>
@@ -724,56 +724,56 @@ end)
 <h3 id="-">内置配置参数</h3>
 <p>除了可以通过<a href="#add_configs">add_configs</a>设置一些扩展的配置参数以外,xmake还提供了一些内置的配置参数,可以使用</p>
 <h4 id="-">启用调试包</h4>
-<pre><code class="lang-lua">add_requires(&quot;xxx&quot;, {debug = true})
+<pre><code class="lang-lua">add_requires("xxx", {debug = true})
 </code></pre>
 <p>包描述里面必须有相关处理才能支持:</p>
 <pre><code class="lang-lua">on_install(function (package)
     local configs = {}
     if package:debug() then
-        table.insert(configs, &quot;--enable-debug&quot;)
+        table.insert(configs, "--enable-debug")
     end
-    import(&quot;package.tools.autoconf&quot;).install(package)
+    import("package.tools.autoconf").install(package)
 end)
 </code></pre>
 <h4 id="-msvc-">设置msvc运行时库</h4>
-<pre><code class="lang-lua">add_requires(&quot;xxx&quot;, {configs = {vs_runtime = &quot;MT&quot;}})
+<pre><code class="lang-lua">add_requires("xxx", {configs = {vs_runtime = "MT"}})
 </code></pre>
-<p>通常情况下,通过<code>import(&quot;package.tools.autoconf&quot;).install</code>等内置工具脚本安装的包,内部都对vs_runtime自动处理过了。</p>
+<p>通常情况下,通过<code>import("package.tools.autoconf").install</code>等内置工具脚本安装的包,内部都对vs_runtime自动处理过了。</p>
 <p>但是如果是一些特殊的源码包,构建规则比较特殊,那么需要自己处理了:</p>
 <pre><code class="lang-lua">on_install(function (package)
-    io.gsub(&quot;build/Makefile.win32.common&quot;, &quot;%-MD&quot;, &quot;-&quot; .. package:config(&quot;vs_runtime&quot;))
+    io.gsub("build/Makefile.win32.common", "%-MD", "-" .. package:config("vs_runtime"))
 end)
 </code></pre>
 <h3 id="-">添加环境变量</h3>
 <p>对于一些库,里面也带了可执行的工具,如果需要在集成包的时候,使用上这些工具,那么也可以设置上对应PATH环境变量:</p>
-<pre><code class="lang-lua">package(&quot;luajit&quot;)
+<pre><code class="lang-lua">package("luajit")
     on_load(function (package)
-        if is_plat(&quot;windows&quot;) then
-            package:addenv(&quot;PATH&quot;, &quot;lib&quot;)
+        if is_plat("windows") then
+            package:addenv("PATH", "lib")
         end
-        package:addenv(&quot;PATH&quot;, &quot;bin&quot;)
+        package:addenv("PATH", "bin")
     end)
 </code></pre>
 <p>而在项目工程中,只有通过<code>add_packages</code>集成对应的包后,对应的环境变量才会生效。</p>
-<pre><code class="lang-lua">add_requires(&quot;luajit&quot;)
-target(&quot;test&quot;)
-    set_kind(&quot;binary&quot;)
-    add_packages(&quot;luajit&quot;)
+<pre><code class="lang-lua">add_requires("luajit")
+target("test")
+    set_kind("binary")
+    add_packages("luajit")
     after_run(function (package)
-        os.exec(&quot;luajit --version&quot;)
+        os.exec("luajit --version")
     end)
 </code></pre>
 <h3 id="-">安装二进制包</h3>
 <p>xmake也是支持直接引用二进制版本包,直接安装使用,例如:</p>
-<pre><code class="lang-lua">if is_plat(&quot;windows&quot;) then
-    set_urls(&quot;https://www.libsdl.org/release/SDL2-devel-$(version)-VC.zip&quot;)
-    add_versions(&quot;2.0.8&quot;, &quot;68505e1f7c16d8538e116405411205355a029dcf2df738dbbc768b2fe95d20fd&quot;)
+<pre><code class="lang-lua">if is_plat("windows") then
+    set_urls("https://www.libsdl.org/release/SDL2-devel-$(version)-VC.zip")
+    add_versions("2.0.8", "68505e1f7c16d8538e116405411205355a029dcf2df738dbbc768b2fe95d20fd")
 end
 
-on_install(&quot;windows&quot;, function (package)
-    os.cp(&quot;include&quot;, package:installdir())
-    os.cp(&quot;lib/$(arch)/*.lib&quot;, package:installdir(&quot;lib&quot;))
-    os.cp(&quot;lib/$(arch)/*.dll&quot;, package:installdir(&quot;lib&quot;))
+on_install("windows", function (package)
+    os.cp("include", package:installdir())
+    os.cp("lib/$(arch)/*.lib", package:installdir("lib"))
+    os.cp("lib/$(arch)/*.dll", package:installdir("lib"))
 end)
 </code></pre>
 <h3 id="-">本地测试</h3>

+ 15 - 15
mirror/zh-cn/package/system_package.html

@@ -93,25 +93,25 @@
     <h2 id="-">查找系统包</h2>
 <p>如果觉得上述内置包的管理方式非常不方便,可以通过xmake提供的内置接口<code>find_packages</code>。</p>
 <p>并且通过系统和第三方包管理工具进行依赖包的安装,然后与xmake进行集成使用,例如我们查找一个openssl包:</p>
-<pre><code class="lang-lua">local packages = find_packages(&quot;openssl&quot;, &quot;zlib&quot;)
+<pre><code class="lang-lua">local packages = find_packages("openssl", "zlib")
 </code></pre>
 <p>返回的结果如下:</p>
 <pre><code class="lang-lua">{
-    {links = {&quot;ssl&quot;, &quot;crypto&quot;}, linkdirs = {&quot;/usr/local/lib&quot;}, includedirs = {&quot;/usr/local/include&quot;}},
-    {links = {&quot;z&quot;}, linkdirs = {&quot;/usr/local/lib&quot;}, includedirs = {&quot;/usr/local/include&quot;}}
+    {links = {"ssl", "crypto"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}},
+    {links = {"z"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}}
 }
 </code></pre>
 <p>如果查找成功,则返回一个包含所有包信息的table,如果失败返回nil</p>
 <p>这里的返回结果可以直接作为<code>target:add</code>, <code>option:add</code>的参数传入,用于动态增加<code>target/option</code>的配置:</p>
-<pre><code class="lang-lua">option(&quot;zlib&quot;)
+<pre><code class="lang-lua">option("zlib")
     set_showmenu(true)
     before_check(function (option)
-        option:add(find_packages(&quot;openssl&quot;, &quot;zlib&quot;))
+        option:add(find_packages("openssl", "zlib"))
     end)
 </code></pre>
-<pre><code class="lang-lua">target(&quot;test&quot;)
+<pre><code class="lang-lua">target("test")
     on_load(function (target)
-        target:add(find_packages(&quot;openssl&quot;, &quot;zlib&quot;))
+        target:add(find_packages("openssl", "zlib"))
     end)
 </code></pre>
 <p>目前此接口支持以下一些包管理支持:</p>
@@ -126,7 +126,7 @@
 <p>当然,如果觉得通过查找包的方式来集成第三方依赖包还不能满足需求,也可以通过<code>add_requires</code>来直接集成远程依赖包,具体请查看文档:<a href="https://xmake.io/#/zh-cn/package/remote_package">使用远程依赖包</a></p>
 <h2 id="-homebrew-">查找homebrew包</h2>
 <p>另外,我们也可以从手动指定的包管理器查找包:</p>
-<pre><code class="lang-lua">find_packages(&quot;brew::pcre2/libpcre2-8&quot;, &quot;brew::x264&quot;)
+<pre><code class="lang-lua">find_packages("brew::pcre2/libpcre2-8", "brew::x264")
 </code></pre>
 <p>我们只需要添加<code>brew::</code>前缀,就可以显式指定从homebrew的包源来查找包,如果<code>brew::pcre2</code>存在多个pkgconfig文件,例如:libpcre2-8.pc, libpcre2-16.pc, libpcre2-32.pc</p>
 <p>那么我们可以通过<code>brew::pcre2/libpcre2-16</code>来选择对应的pkgconfig文件指定的链接库信息。</p>
@@ -140,11 +140,11 @@
 <pre><code class="lang-console">$ xmake g --vcpkg=f:\vcpkg
 </code></pre>
 <p>然后,我们就可以通过<code>vcpkg::</code>前缀,来指定查找vcpkg中的依赖包了:</p>
-<pre><code class="lang-lua">find_packages(&quot;vcpkg::zlib&quot;, &quot;vcpkg::openssl&quot;)
+<pre><code class="lang-lua">find_packages("vcpkg::zlib", "vcpkg::openssl")
 </code></pre>
 <h2 id="-conan-">查找conan包</h2>
 <p>xmake v2.2.6以后的版本,也支持从conan中查找指定的包:</p>
-<pre><code class="lang-lua">find_packages(&quot;conan::OpenSSL/1.0.2n@conan/stable&quot;)
+<pre><code class="lang-lua">find_packages("conan::OpenSSL/1.0.2n@conan/stable")
 </code></pre>
 <h2 id="-">查找包快速测试</h2>
 <p>我们可以使用下面的命令,快速检测系统上指定的包信息:</p>
@@ -152,14 +152,14 @@
 { 
   { 
     links = { 
-      &quot;x264&quot; 
+      "x264" 
     },
     linkdirs = { 
-      &quot;/usr/local/Cellar/x264/r2699/lib&quot; 
+      "/usr/local/Cellar/x264/r2699/lib" 
     },
-    version = &quot;0.148.2699 a5e06b9&quot;,
+    version = "0.148.2699 a5e06b9",
     includedirs = { 
-      &quot;/usr/local/Cellar/x264/r2699/include&quot; 
+      "/usr/local/Cellar/x264/r2699/include" 
     } 
   } 
 }
@@ -167,7 +167,7 @@
 <p>我们也可以追加第三方包管理器前缀来测试:</p>
 <pre><code class="lang-console">xmake l find_packages conan::OpenSSL/1.0.2n@conan/stable
 </code></pre>
-<p>!&gt; 需要注意的是,find_package命令如果在带有xmake.lua的工程目录下执行,是会有缓存的,如果查找失败,下次查找也会使用缓存的结果,如果要每次强制重新检测,请切换到非工程目录下执行上面的命令。</p>
+<p>!> 需要注意的是,find_package命令如果在带有xmake.lua的工程目录下执行,是会有缓存的,如果查找失败,下次查找也会使用缓存的结果,如果要每次强制重新检测,请切换到非工程目录下执行上面的命令。</p>
 </article>
 </body>
 </html>

+ 80 - 80
mirror/zh-cn/plugin/builtin_plugins.html

@@ -93,7 +93,7 @@
     <h2 id="-ide-">生成IDE工程文件</h2>
 <h3 id="-">简介</h3>
 <p>XMake跟<code>cmake</code>, <code>premake</code>等其他一些构建工具的区别在于:</p>
-<p>&lt;p class=&quot;warn&quot;&gt;<br><code>xmake</code>默认是直接构建运行的,生成第三方的IDE的工程文件仅仅作为<code>插件</code>来提供。<br>&lt;/p&gt;
+<p><p class="warn"><br><code>xmake</code>默认是直接构建运行的,生成第三方的IDE的工程文件仅仅作为<code>插件</code>来提供。<br></p>
 
 </p>
 <p>这样做的一个好处是:插件更加容易扩展,维护也更加独立和方便。</p>
@@ -104,7 +104,7 @@
 <pre><code class="lang-console">$ xmake project -k cmakelists
 </code></pre>
 <h3 id="-build-ninja">生成build.ninja</h3>
-<p>!&gt; 2.3.1以上版本才支持</p>
+<p>!> 2.3.1以上版本才支持</p>
 <pre><code class="lang-console">$ xmake project -k ninja
 </code></pre>
 <h3 id="-compiler_flags">生成compiler_flags</h3>
@@ -116,9 +116,9 @@
 </code></pre>
 <p>输出的内容格式如下:</p>
 <pre><code>[
-  { &quot;directory&quot;: &quot;/home/user/llvm/build&quot;,
-    &quot;command&quot;: &quot;/usr/bin/clang++ -Irelative -DSOMEDEF=\&quot;With spaces, quotes and \\-es.\&quot; -c -o file.o file.cc&quot;,
-    &quot;file&quot;: &quot;file.cc&quot; },
+  { "directory": "/home/user/llvm/build",
+    "command": "/usr/bin/clang++ -Irelative -DSOMEDEF=\"With spaces, quotes and \\-es.\" -c -o file.o file.cc",
+    "file": "file.cc" },
   ...
 ]
 
@@ -129,38 +129,38 @@
 <p>但是这种模式,对xmake的rules是没法支持的。因为xmake的rules里面用了很多的<code>on_build</code>此类自定义脚本,无法展开,所以像qt, wdk此类的项目就没法支持导出到vs里面进行编译了。</p>
 <p>因此,为了解决这个问题,新版本的vs生成插件通过在vs下直接调用xmake命令,去执行编译操作,并且对intellsence和定义跳转,还有断点调试也做了支持。</p>
 <p>具体使用方式跟老版本类似:</p>
-<pre><code class="lang-console">$ xmake project -k [vsxmake2010|vsxmake2013|vsxmake2015|..] -m &quot;debug;release&quot;
+<pre><code class="lang-console">$ xmake project -k [vsxmake2010|vsxmake2013|vsxmake2015|..] -m "debug;release"
 </code></pre>
 <p>如果没指明版本,那么xmake会自动探测当前已有的vs版本来生成:</p>
-<pre><code class="lang-bash">$ xmake project -k vsxmake -m &quot;debug;release&quot;
+<pre><code class="lang-bash">$ xmake project -k vsxmake -m "debug;release"
 </code></pre>
 <p><img src="/assets/img/manual/qt_vs.png" alt=""></p>
 <p>另外,vsxmake插件还会额外生成一个自定义的配置属性页,用于在vs里面,方便灵活的修改和追加一些xmake编译配置,甚至可以在里面配置切换到其他交叉工具链,实现在vs中对android, linux等其他平台的交叉编译。</p>
 <p><img src="/assets/img/manual/property_page_vsxmake.png" alt=""></p>
 <h4 id="-vs-">使用vs内置编译机制</h4>
-<p>!&gt; 建议尽量使用上文提到的v2.2.8之后提供的新版的vs生成插件,支持更加完善,此处的生成方式不支持xmake的rules,以及对qt等工程的生成。</p>
+<p>!> 建议尽量使用上文提到的v2.2.8之后提供的新版的vs生成插件,支持更加完善,此处的生成方式不支持xmake的rules,以及对qt等工程的生成。</p>
 <pre><code class="lang-console">$ xmake project -k [vs2008|vs2013|vs2015|..]
 </code></pre>
 <p>v2.1.2以上版本,增强了vs201x版本工程的生成,支持多模式+多架构生成,生成的时候只需要指定:</p>
-<pre><code class="lang-console">$ xmake project -k vs2017 -m &quot;debug,release&quot;
+<pre><code class="lang-console">$ xmake project -k vs2017 -m "debug,release"
 </code></pre>
 <p>生成后的工程文件,同时支持<code>debug|x86</code>, <code>debug|x64</code>, <code>release|x86</code>, <code>release|x64</code>四种配置模式。</p>
 <p>如果不想每次生成的时候,指定模式,可以把模式配置加到<code>xmake.lua</code>的中,例如:</p>
 <pre><code class="lang-lua">-- 配置当前的工程,支持哪些编译模式
-add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)
+add_rules("mode.debug", "mode.release")
 </code></pre>
 <h2 id="-lua-">运行自定义lua脚本</h2>
 <p>这个跟宏脚本类似,只是省去了导入导出操作,直接指定lua脚本来加载运行,这对于想要快速测试一些接口模块,验证自己的某些思路,都是一个不错的方式。</p>
 <h3 id="-">运行指定的脚本文件</h3>
 <p>我们先写个简单的lua脚本:</p>
 <pre><code class="lang-lua">function main()
-    print(&quot;hello xmake!&quot;)
+    print("hello xmake!")
 end
 </code></pre>
 <p>然后直接运行它就行了:</p>
 <pre><code class="lang-console">$ xmake lua /tmp/test.lua
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    当然,你也可以像宏脚本那样,使用<code>import</code>接口导入扩展模块,实现复杂的功能。<br>&lt;/p&gt;
+<p><p class="tip"><br>    当然,你也可以像宏脚本那样,使用<code>import</code>接口导入扩展模块,实现复杂的功能。<br></p>
 
 </p>
 <h3 id="-">运行内置的脚本命令</h3>
@@ -175,7 +175,7 @@ scripts:
 </code></pre>
 <p>并且运行它们:</p>
 <pre><code class="lang-console">$ xmake lua cat ~/file.txt
-$ xmake lua echo &quot;hello xmake&quot;
+$ xmake lua echo "hello xmake"
 $ xmake lua cp /tmp/file /tmp/file2
 $ xmake lua versioninfo
 </code></pre>
@@ -184,35 +184,35 @@ $ xmake lua versioninfo
 <p>我们先看下,如何进入交互模式:</p>
 <pre><code class="lang-console"># 不带任何参数执行,就可以进入
 $ xmake lua
-&gt;
+>
 
 # 进行表达式计算
-&gt; 1 + 2
+> 1 + 2
 3
 
 # 赋值和打印变量值
-&gt; a = 1
-&gt; a
+> a = 1
+> a
 1
 
 # 多行输入和执行
-&gt; for _, v in pairs({1, 2, 3}) do
-&gt;&gt; print(v)
-&gt;&gt; end
+> for _, v in pairs({1, 2, 3}) do
+>> print(v)
+>> end
 1
 2
 3
 </code></pre>
 <p>我们也能够通过 <code>import</code> 来导入扩展模块:</p>
-<pre><code class="lang-console">&gt; task = import(&quot;core.project.task&quot;)
-&gt; task.run(&quot;hello&quot;)
+<pre><code class="lang-console">> task = import("core.project.task")
+> task.run("hello")
 hello xmake!
 </code></pre>
 <p>如果要中途取消多行输入,只需要输入字符:<code>q</code> 就行了</p>
-<pre><code class="lang-console">&gt; for _, v in ipairs({1, 2}) do
-&gt;&gt; print(v)
-&gt;&gt; q             &lt;--  取消多行输入,清空先前的输入数据
-&gt; 1 + 2
+<pre><code class="lang-console">> for _, v in ipairs({1, 2}) do
+>> print(v)
+>> q             <--  取消多行输入,清空先前的输入数据
+> 1 + 2
 3
 </code></pre>
 <h2 id="-">显示指定信息和列表</h2>
@@ -271,24 +271,24 @@ The information of target(tbox):
     links: pthread
     syslinks: pthread, dl, m, c
     cxflags: -Wno-error=deprecated-declarations, -fno-strict-aliasing, -Wno-error=expansion-to-defined, -fno-stack-protector
-    defines: __tb_small__, __tb_prefix__=&quot;tbox&quot;
+    defines: __tb_small__, __tb_prefix__="tbox"
     mxflags: -Wno-error=deprecated-declarations, -fno-strict-aliasing, -Wno-error=expansion-to-defined
     headerfiles: src/(tbox/**.h)|**/impl/**.h, src/(tbox/prefix/**/prefix.S), src/(tbox/math/impl/*.h), src/(tbox/utils/impl/*.h), build/macosx/x86_64/release/tbox.config.h
     includedirs: src, build/macosx/x86_64/release
     at: /Users/ruki/projects/personal/tbox/src/tbox/xmake.lua
     sourcebatch(cc): with rule(c.build)
-      -&gt; src/tbox/string/static_string.c
-         -&gt; build/.objs/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o
-         -&gt; build/.deps/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o.d
-      -&gt; src/tbox/platform/sched.c
-         -&gt; build/.objs/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o
-         -&gt; build/.deps/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o.d
-      -&gt; src/tbox/stream/stream.c
-         -&gt; build/.objs/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o
-         -&gt; build/.deps/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o.d
-      -&gt; src/tbox/utils/base32.c
-         -&gt; build/.objs/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o
-         -&gt; build/.deps/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o.d
+      -> src/tbox/string/static_string.c
+         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o
+         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o.d
+      -> src/tbox/platform/sched.c
+         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o
+         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o.d
+      -> src/tbox/stream/stream.c
+         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o
+         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o.d
+      -> src/tbox/utils/base32.c
+         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o
+         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o.d
 </code></pre>
 <h3 id="-">显示内置编译模式列表</h3>
 <pre><code class="lang-bash">$ xmake show -l modes
@@ -368,22 +368,22 @@ $ xmake macro --export=/xxx/macrodir
 <h3 id="-">自定义宏脚本</h3>
 <p>我们也可以自己编写个宏脚本 <code>macro.lua</code> 然后导入到xmake中去。</p>
 <pre><code class="lang-lua">function main()
-    os.exec(&quot;xmake f -p android --ndk=/xxx/ndk -a arm64-v8a&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p mingw --sdk=/mingwsdk&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a armv7&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a arm64&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a armv7s&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a i386&quot;)
-    os.exec(&quot;xmake p&quot;)
-    os.exec(&quot;xmake f -p iphoneos -a x86_64&quot;)
-    os.exec(&quot;xmake p&quot;)  
+    os.exec("xmake f -p android --ndk=/xxx/ndk -a arm64-v8a")
+    os.exec("xmake p")
+    os.exec("xmake f -p mingw --sdk=/mingwsdk")
+    os.exec("xmake p")
+    os.exec("xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a armv7")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a arm64")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a armv7s")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a i386")
+    os.exec("xmake p")
+    os.exec("xmake f -p iphoneos -a x86_64")
+    os.exec("xmake p")  
 end
 </code></pre>
 <p>导入到xmake,并且定义宏名字:</p>
@@ -400,52 +400,52 @@ end
 <h3 id="-">高级的宏脚本编写</h3>
 <p>以上面提到的<code>package</code>宏为例,我们看下其具体代码,里面通过<code>import</code>导入一些扩展模块,实现了复杂的脚本操作。</p>
 <pre><code class="lang-lua">-- imports
-import(&quot;core.base.option&quot;)
-import(&quot;core.project.config&quot;)
-import(&quot;core.project.project&quot;)
-import(&quot;core.platform.platform&quot;)
+import("core.base.option")
+import("core.project.config")
+import("core.project.project")
+import("core.platform.platform")
 
 -- the options
 local options =
 {
-    {&#39;p&#39;, &quot;plat&quot;,       &quot;kv&quot;,  os.host(),   &quot;Set the platform.&quot;                                    }
-,   {&#39;f&#39;, &quot;config&quot;,     &quot;kv&quot;,  nil,         &quot;Pass the config arguments to \&quot;xmake config\&quot; ..&quot;     }
-,   {&#39;o&#39;, &quot;outputdir&quot;,  &quot;kv&quot;,  nil,         &quot;Set the output directory of the package.&quot;             }
+    {&#39;p&#39;, "plat",       "kv",  os.host(),   "Set the platform."                                    }
+,   {&#39;f&#39;, "config",     "kv",  nil,         "Pass the config arguments to \"xmake config\" .."     }
+,   {&#39;o&#39;, "outputdir",  "kv",  nil,         "Set the output directory of the package."             }
 }
 
 -- package all
 --
 -- .e.g
 -- xmake m package 
--- xmake m package -f &quot;-m debug&quot;
+-- xmake m package -f "-m debug"
 -- xmake m package -p linux
--- xmake m package -p iphoneos -f &quot;-m debug --xxx ...&quot; -o /tmp/xxx
--- xmake m package -f \&quot;--mode=debug\&quot;
+-- xmake m package -p iphoneos -f "-m debug --xxx ..." -o /tmp/xxx
+-- xmake m package -f \"--mode=debug\"
 --
 function main(argv)
 
     -- parse arguments
-    local args = option.parse(argv, options, &quot;Package all architectures for the given the platform.&quot;
-                                           , &quot;&quot;
-                                           , &quot;Usage: xmake macro package [options]&quot;)
+    local args = option.parse(argv, options, "Package all architectures for the given the platform."
+                                           , ""
+                                           , "Usage: xmake macro package [options]")
 
     -- package all archs
     local plat = args.plat
     for _, arch in ipairs(platform.archs(plat)) do
 
         -- config it
-        os.exec(&quot;xmake f -p %s -a %s %s -c %s&quot;, plat, arch, args.config or &quot;&quot;, (option.get(&quot;verbose&quot;) and &quot;-v&quot; or &quot;&quot;))
+        os.exec("xmake f -p %s -a %s %s -c %s", plat, arch, args.config or "", (option.get("verbose") and "-v" or ""))
 
         -- package it
         if args.outputdir then
-            os.exec(&quot;xmake p -o %s %s&quot;, args.outputdir, (option.get(&quot;verbose&quot;) and &quot;-v&quot; or &quot;&quot;))
+            os.exec("xmake p -o %s %s", args.outputdir, (option.get("verbose") and "-v" or ""))
         else
-            os.exec(&quot;xmake p %s&quot;, (option.get(&quot;verbose&quot;) and &quot;-v&quot; or &quot;&quot;))
+            os.exec("xmake p %s", (option.get("verbose") and "-v" or ""))
         end
     end
 
     -- package universal for iphoneos, watchos ...
-    if plat == &quot;iphoneos&quot; or plat == &quot;watchos&quot; then
+    if plat == "iphoneos" or plat == "watchos" then
 
         -- load configure
         config.load()
@@ -457,13 +457,13 @@ function main(argv)
         os.cd(project.directory())
 
         -- the outputdir directory
-        local outputdir = args.outputdir or config.get(&quot;buildir&quot;)
+        local outputdir = args.outputdir or config.get("buildir")
 
         -- package all targets
         for _, target in pairs(project.targets()) do
 
             -- get all modes
-            local modedirs = os.match(format(&quot;%s/%s.pkg/lib/*&quot;, outputdir, target:name()), true)
+            local modedirs = os.match(format("%s/%s.pkg/lib/*", outputdir, target:name()), true)
             for _, modedir in ipairs(modedirs) do
 
                 -- get mode
@@ -472,28 +472,28 @@ function main(argv)
                 -- make lipo arguments
                 local lipoargs = nil
                 for _, arch in ipairs(platform.archs(plat)) do
-                    local archfile = format(&quot;%s/%s.pkg/lib/%s/%s/%s/%s&quot;, outputdir, target:name(), mode, plat, arch, path.filename(target:targetfile())) 
+                    local archfile = format("%s/%s.pkg/lib/%s/%s/%s/%s", outputdir, target:name(), mode, plat, arch, path.filename(target:targetfile())) 
                     if os.isfile(archfile) then
-                        lipoargs = format(&quot;%s -arch %s %s&quot;, lipoargs or &quot;&quot;, arch, archfile) 
+                        lipoargs = format("%s -arch %s %s", lipoargs or "", arch, archfile) 
                     end
                 end
                 if lipoargs then
 
                     -- make full lipo arguments
-                    lipoargs = format(&quot;-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s&quot;, lipoargs, outputdir, target:name(), mode, plat, path.filename(target:targetfile()))
+                    lipoargs = format("-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s", lipoargs, outputdir, target:name(), mode, plat, path.filename(target:targetfile()))
 
                     -- make universal directory
-                    os.mkdir(format(&quot;%s/%s.pkg/lib/%s/%s/universal&quot;, outputdir, target:name(), mode, plat))
+                    os.mkdir(format("%s/%s.pkg/lib/%s/%s/universal", outputdir, target:name(), mode, plat))
 
                     -- package all archs
-                    os.execv(&quot;xmake&quot;, {&quot;l&quot;, &quot;lipo&quot;, lipoargs})
+                    os.execv("xmake", {"l", "lipo", lipoargs})
                 end
             end
         end
     end
 end
 </code></pre>
-<p>&lt;p class=&quot;tip&quot;&gt;<br>    如果你想要获取更多宏参数选项信息,请运行: <code>xmake macro --help</code><br>&lt;/p&gt;
+<p><p class="tip"><br>    如果你想要获取更多宏参数选项信息,请运行: <code>xmake macro --help</code><br></p>
 
 </p>
 <h2 id="-doxygen-">生成doxygen文档</h2>

+ 29 - 29
mirror/zh-cn/plugin/more_plugins.html

@@ -94,15 +94,15 @@
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-vscode">xmake-vscode</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-vscode/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-vscode/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-sublime">xmake-sublime</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-sublime/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-sublime/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake-idea">xmake-idea</a></li>
 </ul>
-<p>&lt;img src=&quot;https://raw.githubusercontent.com/xmake-io/xmake-idea/master/res/problem.gif&quot; width=&quot;650px&quot; /&gt;</p>
+<p><img src="https://raw.githubusercontent.com/xmake-io/xmake-idea/master/res/problem.gif" width="650px" /></p>
 <ul>
 <li><a href="https://github.com/luzhlon/xmake.vim">xmake.vim</a> (third-party, thanks <a href="https://github.com/luzhlon">@luzhlon</a>)</li>
 </ul>
@@ -118,7 +118,7 @@
 <pre><code>buildscript {
   repositories {
     maven {
-      url &quot;https://plugins.gradle.org/m2/&quot;
+      url "https://plugins.gradle.org/m2/"
     }
   }
   dependencies {
@@ -129,14 +129,14 @@
   }
 }
 
-apply plugin: &quot;org.tboox.gradle-xmake-plugin&quot;
+apply plugin: "org.tboox.gradle-xmake-plugin"
 </code></pre><h3 id="-">最简单的配置示例</h3>
 <p>如果我们添加<code>xmake.lua</code>文件到<code>projectdir/jni/xmake.lua</code>,那么我们只需要在build.gradle中启用生效了xmake指定下对应的JNI工程路径即可。</p>
 <h4 id="build-gradle">build.gradle</h4>
 <pre><code>android {
     externalNativeBuild {
         xmake {
-            path &quot;jni/xmake.lua&quot;
+            path "jni/xmake.lua"
         }
     }
 }
@@ -150,10 +150,10 @@ apply plugin: &quot;org.tboox.gradle-xmake-plugin&quot;
     - xmake.lua
     - *.cpp
 </code></pre><p>xmake.lua:</p>
-<pre><code class="lang-lua">add_rules(&quot;mode.debug&quot;, &quot;mode.release&quot;)
-target(&quot;nativelib&quot;)
-    set_kind(&quot;shared&quot;)
-    add_files(&quot;nativelib.cc&quot;)
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
+target("nativelib")
+    set_kind("shared")
+    add_files("nativelib.cc")
 </code></pre>
 <h3 id="-gradle-">更多Gradle配置说明</h3>
 <pre><code>android {
@@ -161,17 +161,17 @@ target(&quot;nativelib&quot;)
         externalNativeBuild {
             xmake {
                 // 追加设置全局c编译flags
-                cFlags &quot;-DTEST&quot;
+                cFlags "-DTEST"
 
                 // 追加设置全局c++编译flags
-                cppFlags &quot;-DTEST&quot;, &quot;-DTEST2&quot;
+                cppFlags "-DTEST", "-DTEST2"
 
                 // 设置切换编译模式,与`xmake f -m debug`的配置对应,具体模式值根据自己的xmake.lua设置而定
-                buildMode &quot;debug&quot;
+                buildMode "debug"
 
                 // 设置需要编译的abi列表,支持:armeabi, armeabi-v7a, arm64-v8a, x86, x86_64
                 // 如果没有设置的话,我们也支持从defaultConfig.ndk.abiFilters中获取abiFilters
-                abiFilters &quot;armeabi-v7a&quot;, &quot;arm64-v8a&quot;
+                abiFilters "armeabi-v7a", "arm64-v8a"
             }
         }
     }
@@ -179,13 +179,13 @@ target(&quot;nativelib&quot;)
     externalNativeBuild {
         xmake {
             // 设置jni工程中xmake.lua根文件路径,这是必须的,不设置就不会启用jni编译
-            path &quot;jni/xmake.lua&quot;
+            path "jni/xmake.lua"
 
             // 启用详细输出,会显示完整编译命令行参数,其他值:verbose, warning, normal
-            logLevel &quot;verbose&quot;
+            logLevel "verbose"
 
             // 指定c++ stl库,默认不指定会使用c++_static,其他值:c++_static/c++_shared, gnustl_static/gnustl_shared, stlport_static/stlport_shared
-            stl &quot;c++_shared&quot;
+            stl "c++_shared"
 
             // 设置xmake可执行程序路径(通常不用设置)
             // program /usr/local/bin/xmake
@@ -195,7 +195,7 @@ target(&quot;nativelib&quot;)
 
             // 设置其他指定的ndk目录路径 (这是可选的,默认xmake会自动从$ANDROID_NDK_HOME或者`~/Library/Android/sdk/ndk-bundle`中检测)
             // 当然如果用户通过`xmake g --ndk=xxx`配置了全局设置,也会自动从这个里面检测
-            // ndk &quot;/Users/ruki/files/android-ndk-r20b/&quot;
+            // ndk "/Users/ruki/files/android-ndk-r20b/"
 
             // 设置ndk中sdk版本
             // sdkver 21
@@ -205,23 +205,23 @@ target(&quot;nativelib&quot;)
 </code></pre><h3 id="-jni-apk">编译JNI并且生成APK</h3>
 <p>当<code>gradle-xmake-plugin</code>插件被应用生效后,<code>xmakeBuild</code>任务会自动注入到现有的<code>assemble</code>任务中去,自动执行jni库编译和集成。</p>
 <pre><code class="lang-console">$ ./gradlew app:assembleDebug
-&gt; Task :nativelib:xmakeConfigureForArm64
-&gt; Task :nativelib:xmakeBuildForArm64
-&gt;&gt; xmake build
+> Task :nativelib:xmakeConfigureForArm64
+> Task :nativelib:xmakeBuildForArm64
+>> xmake build
 [ 50%]: ccache compiling.debug nativelib.cc
 [ 75%]: linking.debug libnativelib.so
 [100%]: build ok!
-&gt;&gt; install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/arm64-v8a
-&gt; Task :nativelib:xmakeConfigureForArmv7
-&gt; Task :nativelib:xmakeBuildForArmv7
-&gt;&gt; xmake build
+>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/arm64-v8a
+> Task :nativelib:xmakeConfigureForArmv7
+> Task :nativelib:xmakeBuildForArmv7
+>> xmake build
 [ 50%]: ccache compiling.debug nativelib.cc
 [ 75%]: linking.debug libnativelib.so
 [100%]: build ok!
-&gt;&gt; install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/armeabi-v7a
-&gt; Task :nativelib:preBuild
-&gt; Task :nativelib:assemble
-&gt; Task :app:assembleDebug
+>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/armeabi-v7a
+> Task :nativelib:preBuild
+> Task :nativelib:assemble
+> Task :app:assembleDebug
 </code></pre>
 <h3 id="-jni">强制重建JNI</h3>
 <pre><code class="lang-console">$ ./gradlew nativelib:xmakeRebuild

+ 9 - 9
mirror/zh-cn/plugin/plugin_development.html

@@ -109,26 +109,26 @@
 <h2 id="-">快速开始</h2>
 <p>接下来我们介绍下本文的重点,一个简单的hello xmake插件的开发,代码如下:</p>
 <pre><code class="lang-lua">-- 定义一个名叫hello的插件任务
-task(&quot;hello&quot;)
+task("hello")
 
     -- 设置类型为插件
-    set_category(&quot;plugin&quot;)
+    set_category("plugin")
 
     -- 插件运行的入口
     on_run(function ()
 
         -- 显示hello xmake!
-        print(&quot;hello xmake!&quot;)
+        print("hello xmake!")
 
     end)
 
     -- 设置插件的命令行选项,这里没有任何参数选项,仅仅显示插件描述
     set_menu {
                 -- usage
-                usage = &quot;xmake hello [options]&quot;
+                usage = "xmake hello [options]"
 
                 -- description
-            ,   description = &quot;Hello xmake!&quot;
+            ,   description = "Hello xmake!"
 
                 -- options
             ,   options = {}
@@ -142,7 +142,7 @@ task(&quot;hello&quot;)
 <ol>
 <li>把 hello 这个文件夹放置在 xmake的插件安装目录 <code>xmake/plugins</code>,这个里面都是些内建的插件</li>
 <li>把 hello 文件夹放置在 <code>~/.xmake/plugins</code> 用户全局目录,这样对当前xmake 全局生效</li>
-<li>把 hello 文件夹放置在任意地方,通过在工程描述文件xmake.lua中调用<code>add_plugindirs(&quot;./hello&quot;)</code> 添加当前的工程的插件搜索目录,这样只对当前工程生效</li>
+<li>把 hello 文件夹放置在任意地方,通过在工程描述文件xmake.lua中调用<code>add_plugindirs("./hello")</code> 添加当前的工程的插件搜索目录,这样只对当前工程生效</li>
 </ol>
 <h2 id="-">运行插件</h2>
 <p>接下来,我们尝试运行下这个插件:</p>
@@ -151,16 +151,16 @@ task(&quot;hello&quot;)
 <p>显示结果:</p>
 <pre><code>hello xmake!
 </code></pre><p>最后我们还可以在target自定义的脚本中运行这个插件:</p>
-<pre><code class="lang-lua">target(&quot;demo&quot;)
+<pre><code class="lang-lua">target("demo")
 
     -- 构建之后运行插件
     after_build(function (target)
 
         -- 导入task模块
-        import(&quot;core.project.task&quot;)
+        import("core.project.task")
 
         -- 运行插件任务
-        task.run(&quot;hello&quot;)
+        task.run("hello")
     end)
 </code></pre>
 </article>

+ 4 - 4
mirror/zh-cn/theme/builtin_themes.html

@@ -92,7 +92,7 @@
 </style>
     <h2 id="-">默认主题</h2>
 <p>这个也就是咱们安装xmake后默认的显示主题,主题名:default,它默认会提供色彩输出,适合一些深色背景的终端。</p>
-<p>&lt;img src=&quot;/assets/img/theme/default.png&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/theme/default.png" width="60%" /></p>
 <p>我们也可以通过下面的命令切回默认主题:</p>
 <pre><code class="lang-bash">$ xmake g --theme=default
 </code></pre>
@@ -101,19 +101,19 @@
 <p>除了进度展示不同外,其他都跟默认主题的配置相同。</p>
 <pre><code class="lang-bash">$ xmake g --theme=ninja
 </code></pre>
-<p>&lt;img src=&quot;/assets/img/theme/ninja.png&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/theme/ninja.png" width="60%" /></p>
 <h2 id="emoji-">Emoji主题</h2>
 <p>这个主题部分输出通过emoji字符代替之前的色彩输出。</p>
 <pre><code class="lang-bash">$ xmake g --theme=emoji
 </code></pre>
-<p>&lt;img src=&quot;/assets/img/theme/emoji.png&quot; width=&quot;60%&quot; /&gt;</p>
+<p><img src="/assets/img/theme/emoji.png" width="60%" /></p>
 <h2 id="dark-">Dark主题</h2>
 <p>这个主题主要是对一些终端背景是浅色系(比如淡黄色等),导致一些警告输出(默认也是黄色)重合不可见,所以把主题配色变成深色系,提高可见性。</p>
 <pre><code class="lang-bash">$ xmake g --theme=dark
 </code></pre>
 <h2 id="plain-">Plain主题</h2>
 <p>这个主题,其实就是完全禁用色彩、emoji输出,主要是应对一些不支持colors code的终端导致显示乱码的问题,也是最朴素的主题风格。</p>
-<p>!&gt; 一些win终端可能不支持colors,就可以设置这个主题来解决乱码显示问题</p>
+<p>!> 一些win终端可能不支持colors,就可以设置这个主题来解决乱码显示问题</p>
 <pre><code class="lang-bash">$ xmake g --theme=plain
 </code></pre>
 <h2 id="powershell-">Powershell主题</h2>

+ 1 - 1
mirror/zh-cn/theme/switch_theme.html

@@ -101,7 +101,7 @@
 <pre><code class="lang-bash">$ xmake g --theme=default
 </code></pre>
 <p>另外,xmake还提供了不少有趣实用的内置主题,大伙可以试试,下文会详细讲解。</p>
-<p>!&gt; 如果大家有更好的主题,也欢迎提pr贡献进来,非常感谢!</p>
+<p>!> 如果大家有更好的主题,也欢迎提pr贡献进来,非常感谢!</p>
 </article>
 </body>
 </html>

+ 72 - 72
sitemap.xml

@@ -12,362 +12,362 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2020-07-11T23:53:19+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/other_features.html</loc>
-  <lastmod>2020-07-11T23:53:19+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2020-07-11T23:53:20+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2020-07-11T23:53:20+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2020-07-11T23:53:20+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2020-07-11T23:53:20+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2020-07-11T23:53:20+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2020-07-11T23:53:20+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2020-07-11T23:53:21+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2020-07-11T23:53:21+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/zh/plugins.html</loc>
-  <lastmod>2020-07-11T23:53:21+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/zh/manual.html</loc>
-  <lastmod>2020-07-11T23:53:21+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/plugins.html</loc>
-  <lastmod>2020-07-11T23:53:21+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/manual.html</loc>
-  <lastmod>2020-07-11T23:53:21+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2020-07-11T23:53:22+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2020-07-11T23:53:22+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2020-07-11T23:53:22+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2020-07-11T23:53:22+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2020-07-11T23:53:22+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2020-07-11T23:53:22+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2020-07-11T23:53:23+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/other_features.html</loc>
-  <lastmod>2020-07-11T23:53:23+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2020-07-11T23:53:23+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2020-07-11T23:53:23+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2020-07-11T23:53:23+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2020-07-11T23:53:23+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2020-07-11T23:53:23+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2020-07-11T23:53:24+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2020-07-11T23:53:24+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2020-07-11T23:53:24+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2020-07-11T23:53:24+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2020-07-11T23:53:24+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2020-07-11T23:53:24+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2020-07-11T23:53:25+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2020-07-11T23:53:25+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2020-07-11T23:53:25+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2020-07-11T23:53:25+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2020-07-11T23:53:25+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2020-07-11T23:53:25+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2020-07-11T23:53:26+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2020-07-11T23:53:26+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2020-07-11T23:53:26+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2020-07-11T23:53:26+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2020-07-11T23:53:26+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2020-07-11T23:53:26+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2020-07-11T23:53:27+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2020-07-11T23:53:27+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2020-07-11T23:53:27+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2020-07-11T23:53:27+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2020-07-11T23:53:27+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2020-07-11T23:53:27+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2020-07-11T23:53:28+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2020-07-11T23:53:28+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2020-07-11T23:53:28+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2020-07-11T23:53:28+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2020-07-11T23:53:28+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2020-07-11T23:53:28+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2020-07-11T23:53:28+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2020-07-11T23:53:29+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2020-07-11T23:53:29+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:31+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2020-07-11T23:53:29+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:31+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2020-07-11T23:53:29+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:31+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2020-07-11T23:53:29+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:31+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2020-07-11T23:53:29+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:31+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2020-07-11T23:53:30+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:31+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2020-07-11T23:53:30+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:32+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2020-07-11T23:53:30+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:32+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2020-07-11T23:53:30+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:32+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2020-07-11T23:53:30+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:32+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2020-07-11T23:53:30+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:32+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2020-07-11T23:53:31+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:32+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2020-07-11T23:53:31+08:00</lastmod>
+  <lastmod>2020-07-13T09:39:33+08:00</lastmod>
 </url>
 
 </urlset>

Some files were not shown because too many files changed in this diff