Browse Source

update docs

ruki 2 years ago
parent
commit
65dd453347

+ 8 - 0
guide/configuration.md

@@ -107,6 +107,14 @@ Regarding the version correspondence, you can see: [https://wiki.qt.io/Qt_for_We
 
 For more details, please see: [https://github.com/xmake-io/xmake/issues/956](https://github.com/xmake-io/xmake/issues/956)
 
+In addition to emscripten, there is a common wasi-sdk toolchain for building wasi-based programs, and we just need to switch between toolchains.
+
+```console
+$ xmake f -p wasm --toolchain=wasi
+$ xmake
+```
+
+
 ### Apple WatchOS
 
 ```bash

+ 21 - 0
guide/project_examples.md

@@ -64,6 +64,27 @@ For a complete example, execute the following command to create:
 xmake create -l c -t shared test
 ```
 
+## Wasm programs
+
+All c/c++ programs can be compiled to Wasm without any xmake.lua configuration changes, just switch to the wasm compilation platform and compile.
+
+```console
+$ xmake f -p wasm
+$ xmake
+```
+
+For detailed wasm compilation configuration see: [wasm configuration](/guide/configuration?id=wasm)
+
+Alternatively, when compiling a file with the `-preload-file assets/xxx.md` setting, we can also simplify its setup by configuring
+
+```lua
+target("test5")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    add_values("wasm.preloadfiles", "src/xxx.md")
+    add_values("wasm.preloadfiles", "src/xxx2.md")
+```
+
 ## Qt Program
 
 Create an empty project:

+ 2 - 1
index.html

@@ -107,7 +107,8 @@
               + wwads
               + '\n\n----\n\n'
               + '<a href="https://tboox.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Copyright (c) 2015-present xmake.io and tboox.org</a>'
-          })
+          });
+
           /* wwads */
           hook.doneEach(function () {
             var panel = document.getElementById('wwads-panel');

+ 4 - 0
mirror/guide/configuration.html

@@ -150,6 +150,10 @@ $ xmake
 <p>One thing to note is that there is a correspondence between the versions of Emscripten and Qt SDK. If the version does not match, there may be compatibility issues between Qt/Wasm.</p>
 <p>Regarding the version correspondence, you can see: <a href="https://wiki.qt.io/Qt_for_WebAssembly">https://wiki.qt.io/Qt_for_WebAssembly</a></p>
 <p>For more details, please see: <a href="https://github.com/xmake-io/xmake/issues/956">https://github.com/xmake-io/xmake/issues/956</a></p>
+<p>In addition to emscripten, there is a common wasi-sdk toolchain for building wasi-based programs, and we just need to switch between toolchains.</p>
+<pre><code class="lang-console">$ xmake f -p wasm --toolchain=wasi
+$ xmake
+</code></pre>
 <h3 id="applewatchos">Apple WatchOS</h3>
 <pre><code class="lang-bash">$ xmake f -p watchos [-a i386|armv7k]
 $ xmake

+ 13 - 0
mirror/guide/project_examples.html

@@ -133,6 +133,19 @@ target("test")
 <p>For a complete example, execute the following command to create:</p>
 <pre><code class="lang-bash">xmake create -l c -t shared test
 </code></pre>
+<h2 id="wasmprograms">Wasm programs</h2>
+<p>All c/c++ programs can be compiled to Wasm without any xmake.lua configuration changes, just switch to the wasm compilation platform and compile.</p>
+<pre><code class="lang-console">$ xmake f -p wasm
+$ xmake
+</code></pre>
+<p>For detailed wasm compilation configuration see: <a href="/mirror/guide/configuration.html#wasm">wasm configuration</a></p>
+<p>Alternatively, when compiling a file with the <code>-preload-file assets/xxx.md</code> setting, we can also simplify its setup by configuring</p>
+<pre><code class="lang-lua">target("test5")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    add_values("wasm.preloadfiles", "src/xxx.md")
+    add_values("wasm.preloadfiles", "src/xxx2.md")
+</code></pre>
 <h2 id="qtprogram">Qt Program</h2>
 <p>Create an empty project:</p>
 <p>v2.2.9 or higher:</p>

+ 4 - 0
mirror/zh-cn/guide/configuration.html

@@ -153,6 +153,10 @@ $ xmake
 <p>需要注意的一点是,Emscripten 和 Qt SDK 的版本是有对应关系的,不匹配的版本,可能会有Qt/Wasm之间的兼容问题。</p>
 <p>关于版本对应关系,可以看下:<a href="https://wiki.qt.io/Qt_for_WebAssembly">https://wiki.qt.io/Qt_for_WebAssembly</a></p>
 <p>更多详情见:<a href="https://github.com/xmake-io/xmake/issues/956">https://github.com/xmake-io/xmake/issues/956</a></p>
+<p>除了 emscripten 以外,还有一个常用的wasm工具链 wasi-sdk,用于构建基于wasi的程序,我们仅仅只需要切换工具链即可。</p>
+<pre><code class="lang-console">$ xmake f -p wasm --toolchain=wasi
+$ xmake
+</code></pre>
 <h2 id="">交叉编译配置</h2>
 <p>通常,如果我们需要在当前pc环境编译生成其他设备上才能运行的目标文件时候,就需要通过对应的交叉编译工具链来编译生成它们,比如在win/macos上编译linux的程序,或者在linux上编译其他嵌入式设备的目标文件等。</p>
 <p>通常的交叉编译工具链都是基于gcc/clang的,大都具有类似如下的结构:</p>

+ 14 - 1
mirror/zh-cn/guide/project_examples.html

@@ -132,7 +132,20 @@ target("test")
 <p>完整例子请执行下面的命令来创建:</p>
 <pre><code class="lang-bash">xmake create -l c -t shared test
 </code></pre>
-<h2 id="qt">Qt程序</h2>
+<h2 id="wasm">Wasm 程序</h2>
+<p>所有 c/c++ 程序,我们都可以编译成 Wasm,无需任何 xmake.lua 配置改动,只需要切换到 wasm 编译平台进行编译。</p>
+<pre><code class="lang-console">$ xmake f -p wasm
+$ xmake
+</code></pre>
+<p>详细的 Wasm 编译配置见:<a href="/mirror/zh-cn/guide/configuration.html#wasm">Wasm 配置</a></p>
+<p>另外,在编译带有 <code>--preload-file assets/xxx.md</code> 设置的文件时候,我们也可以通过配置,简化对它的设置。</p>
+<pre><code class="lang-lua">target("test5")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    add_values("wasm.preloadfiles", "src/xxx.md")
+    add_values("wasm.preloadfiles", "src/xxx2.md")
+</code></pre>
+<h2 id="qt">Qt 程序</h2>
 <p>创建一个空工程:</p>
 <p>v2.2.9以上版本:</p>
 <pre><code class="lang-console">$ xmake create -t qt.console test

+ 103 - 103
sitemap.xml

@@ -7,517 +7,517 @@
     
 <url>
   <loc>https://xmake.io</loc>
-  <lastmod>2023-05-09T19:19:25+08:00</lastmod>
+  <lastmod>2023-05-10T09:21:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2023-05-09T21:36:40+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:10+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2023-05-09T21:36:40+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:10+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2023-05-09T21:36:40+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/build_policies.html</loc>
-  <lastmod>2023-05-09T21:36:41+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2023-05-09T21:36:41+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2023-05-09T21:36:41+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2023-05-09T21:36:41+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/remote_build.html</loc>
-  <lastmod>2023-05-09T21:36:41+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/unity_build.html</loc>
-  <lastmod>2023-05-09T21:36:42+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/distcc_build.html</loc>
-  <lastmod>2023-05-09T21:36:42+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/trybuild.html</loc>
-  <lastmod>2023-05-09T21:36:42+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/autogen.html</loc>
-  <lastmod>2023-05-09T21:36:42+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/build_cache.html</loc>
-  <lastmod>2023-05-09T21:36:42+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2023-05-09T21:36:43+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2023-05-09T21:36:43+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2023-05-09T21:36:43+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2023-05-09T21:36:43+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2023-05-09T21:36:43+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2023-05-09T21:36:43+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2023-05-09T21:36:44+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2023-05-09T21:36:44+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/who_is_using_xmake.html</loc>
-  <lastmod>2023-05-09T21:36:44+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2023-05-09T21:36:44+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2023-05-09T21:36:45+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2023-05-09T21:36:45+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2023-05-09T21:36:45+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2023-05-09T21:36:45+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/build_policies.html</loc>
-  <lastmod>2023-05-09T21:36:45+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2023-05-09T21:36:45+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2023-05-09T21:36:46+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2023-05-09T21:36:46+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/remote_build.html</loc>
-  <lastmod>2023-05-09T21:36:46+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/unity_build.html</loc>
-  <lastmod>2023-05-09T21:36:46+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/distcc_build.html</loc>
-  <lastmod>2023-05-09T21:36:46+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/trybuild.html</loc>
-  <lastmod>2023-05-09T21:36:47+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/autogen.html</loc>
-  <lastmod>2023-05-09T21:36:47+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/build_cache.html</loc>
-  <lastmod>2023-05-09T21:36:47+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2023-05-09T21:36:47+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2023-05-09T21:36:47+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2023-05-09T21:36:48+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2023-05-09T21:36:48+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2023-05-09T21:36:48+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2023-05-09T21:36:48+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2023-05-09T21:36:49+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/peripheral_items.html</loc>
-  <lastmod>2023-05-09T21:36:49+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2023-05-09T21:36:49+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/who_is_using_xmake.html</loc>
-  <lastmod>2023-05-09T21:36:49+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2023-05-09T21:36:49+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2023-05-09T21:36:49+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2023-05-09T21:36:50+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2023-05-09T21:36:50+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2023-05-09T21:36:50+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2023-05-09T21:36:50+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2023-05-09T21:36:50+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2023-05-09T21:36:51+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/target_instance.html</loc>
-  <lastmod>2023-05-09T21:36:51+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2023-05-09T21:36:51+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2023-05-09T21:36:51+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2023-05-09T21:36:51+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2023-05-09T21:36:52+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2023-05-09T21:36:52+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2023-05-09T21:36:52+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2023-05-09T21:36:52+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/helper_interfaces.html</loc>
-  <lastmod>2023-05-09T21:36:52+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2023-05-09T21:36:52+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_instance.html</loc>
-  <lastmod>2023-05-09T21:36:53+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/option_instance.html</loc>
-  <lastmod>2023-05-09T21:36:53+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2023-05-09T21:36:53+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2023-05-09T21:36:53+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_3rd_source_library.html</loc>
-  <lastmod>2023-05-09T21:36:53+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package_old.html</loc>
-  <lastmod>2023-05-09T21:36:54+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2023-05-09T21:36:54+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2023-05-09T21:36:54+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2023-05-09T21:36:54+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/remote_toolchain.html</loc>
-  <lastmod>2023-05-09T21:36:54+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2023-05-09T21:36:55+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2023-05-09T21:36:55+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:31+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2023-05-09T21:36:55+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:33+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2023-05-09T21:36:55+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:35+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2023-05-09T21:36:55+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2023-05-09T21:36:55+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/target_instance.html</loc>
-  <lastmod>2023-05-09T21:36:56+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2023-05-09T21:36:56+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2023-05-09T21:36:56+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2023-05-09T21:36:56+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2023-05-09T21:36:56+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2023-05-09T21:36:57+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2023-05-09T21:36:57+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2023-05-09T21:36:57+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/helper_interfaces.html</loc>
-  <lastmod>2023-05-09T21:36:57+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2023-05-09T21:36:57+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_instance.html</loc>
-  <lastmod>2023-05-09T21:36:58+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/option_instance.html</loc>
-  <lastmod>2023-05-09T21:36:58+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2023-05-09T21:36:58+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2023-05-09T21:36:58+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_3rd_source_library.html</loc>
-  <lastmod>2023-05-09T21:36:58+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package_old.html</loc>
-  <lastmod>2023-05-09T21:36:58+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2023-05-09T21:36:59+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2023-05-09T21:36:59+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2023-05-09T21:36:59+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/remote_toolchain.html</loc>
-  <lastmod>2023-05-09T21:36:59+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2023-05-09T21:37:00+08:00</lastmod>
+  <lastmod>2023-05-15T12:22:51+08:00</lastmod>
 </url>
 
 </urlset>

+ 7 - 0
zh-cn/guide/configuration.md

@@ -113,6 +113,13 @@ $ xmake
 
 更多详情见:[https://github.com/xmake-io/xmake/issues/956](https://github.com/xmake-io/xmake/issues/956)
 
+除了 emscripten 以外,还有一个常用的wasm工具链 wasi-sdk,用于构建基于wasi的程序,我们仅仅只需要切换工具链即可。
+
+```console
+$ xmake f -p wasm --toolchain=wasi
+$ xmake
+```
+
 ## 交叉编译配置
 
 通常,如果我们需要在当前pc环境编译生成其他设备上才能运行的目标文件时候,就需要通过对应的交叉编译工具链来编译生成它们,比如在win/macos上编译linux的程序,或者在linux上编译其他嵌入式设备的目标文件等。

+ 22 - 1
zh-cn/guide/project_examples.md

@@ -64,7 +64,28 @@ target("test")
 xmake create -l c -t shared test
 ```
 
-## Qt程序
+## Wasm 程序
+
+所有 c/c++ 程序,我们都可以编译成 Wasm,无需任何 xmake.lua 配置改动,只需要切换到 wasm 编译平台进行编译。
+
+```console
+$ xmake f -p wasm
+$ xmake
+```
+
+详细的 Wasm 编译配置见:[Wasm 配置](/zh-cn/guide/configuration?id=wasm)
+
+另外,在编译带有 `--preload-file assets/xxx.md` 设置的文件时候,我们也可以通过配置,简化对它的设置。
+
+```lua
+target("test5")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    add_values("wasm.preloadfiles", "src/xxx.md")
+    add_values("wasm.preloadfiles", "src/xxx2.md")
+```
+
+## Qt 程序
 
 创建一个空工程: