Browse Source

update docs

ruki 1 year ago
parent
commit
d7ca17870e

+ 10 - 0
guide/build_policies.md

@@ -297,6 +297,16 @@ Similar to [build.sanitizer.address](https://xmake.io/#/guide/build_policies?id=
 
 Similar to [build.sanitizer.address](https://xmake.io/#/guide/build_policies?id=buildsanitizeraddress) for detecting undefined issues.
 
+### build.always_update_configfiles
+
+This policy is used for the automatic generation of `add_configfiles` configuration files. By default, xmake only triggers the regeneration of configfiles the first time `xmake config` is done, or if the xmake.lua configuration is changed.
+
+Each subsequent build will not regenerate configfiles as long as the configuration has not changed.
+
+However, if we use a variable such as GIT_COMMIT in our configfiles and want to always regenerate the latest configuration for each build, we can configure it.
+
+For background on how to use it, see: [#4747](https://github.com/xmake-io/xmake/issues/4747)
+
 ### run.autobuild
 
 This policy is used to adjust the behaviour of `xmake run`. By default, running `xmake run` does not build the target program automatically, but prompts the user to build it manually if it has not been compiled yet.

+ 13 - 1
guide/project_examples.md

@@ -2134,7 +2134,7 @@ A more complete example: [Verilator](https://github.com/xmake-io/xmake/tree/mast
 
 ## Cppfront Program
 
-```bash
+```lua
 add_rules("mode.debug", "mode.release")
 
 add_requires("cppfront")
@@ -2146,3 +2146,15 @@ target("test")
     add_packages("cppfront")
 ```
 
+## Cosmocc Program
+
+```lua
+add_rules("mode.debug", "mode.release")
+
+add_requires("cosmocc")
+
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    set_toolchains("@cosmocc")
+```

+ 6 - 0
manual/conditions.md

@@ -141,6 +141,12 @@ In the msys/cygwin subsystem environment, the compiler architecture defaults to
 
 We can also quickly view the current subsystem architecture by executing `xmake l os.subarch`.
 
+### is_cross
+
+#### Determines whether the current platform is cross-compiled or not.
+
+This interface returns true if the current target architecture and platform, which is not the current host platform, is cross-compiled.
+
 ### is_mode
 
 #### Is the current compilation mode

+ 22 - 0
manual/package_dependencies.md

@@ -128,6 +128,28 @@ add_urls("https://github.com/madler/zlib/archive/$(version).tar.gz", {
 
 Used to set the version of each source package and the corresponding sha256 value, as described in [add_urls](#add_urls)
 
+### package:add_versionfiles
+
+#### Adding a list of package versions
+
+Normally we can add package versions through the `add_versions` interface, but if there are more and more versions, the package configuration will be too bloated, at this time, we can use the `add_versionfiles` interface to store a list of all the versions in a separate file to maintain.
+
+For example:
+
+```lua
+package("libcurl")
+    add_versionfiles("versions.txt")
+```
+
+```bash
+8.5.0 ce4b6a6655431147624aaf582632a36fe1ade262d5fab385c60f78942dd8d87b
+8.4.0 e5250581a9c032b1b6ed3cf2f9c114c811fc41881069e9892d115cc73f9e88c6
+8.0.1 9b6b1e96b748d04b968786b6bdf407aa5c75ab53a3d37c1c8c81cdb736555ccf
+7.87.0 5d6e128761b7110946d1276aff6f0f266f2b726f5e619f7e0a057a474155f307
+7.31.0 a73b118eececff5de25111f35d1d0aafe1e71afdbb83082a8e44d847267e3e08
+...
+```
+
 ### package:add_patches
 
 #### Add package patches

+ 16 - 0
manual/project_target.md

@@ -3599,4 +3599,20 @@ Each unit test can be changed to a binary executable program through `kind = "bi
 
 This enables external runnable unit tests in dynamic library targets.
 
+##### Configure run timeout
 
+If some test programs get stuck if they run for a long time without exiting, we can force them to exit and return failure by configuring a timeout.
+
+```lua
+target("test_timeout")
+    set_kind("binary")
+    set_default(false)
+    add_files("src/run_timeout.cpp")
+    add_tests("run_timeout", {run_timeout = 1000})
+``
+
+```bash
+$ xmake test
+[100%]: test_timeout/run_timeout .................................... failed 1.006s
+run failed, exit code: -1, exit error: wait process timeout
+```

+ 5 - 0
mirror/guide/build_policies.html

@@ -263,6 +263,11 @@ set_policy("build.sanitizer.undefined", true)
 <p>Similar to <a href="https://xmake.io/#/guide/build_policies?id=buildsanitizeraddress">build.sanitizer.address</a> for detecting memory leaks.</p>
 <h3 id="buildsanitizerundefined">build.sanitizer.undefined</h3>
 <p>Similar to <a href="https://xmake.io/#/guide/build_policies?id=buildsanitizeraddress">build.sanitizer.address</a> for detecting undefined issues.</p>
+<h3 id="buildalways_update_configfiles">build.always_update_configfiles</h3>
+<p>This policy is used for the automatic generation of <code>add_configfiles</code> configuration files. By default, xmake only triggers the regeneration of configfiles the first time <code>xmake config</code> is done, or if the xmake.lua configuration is changed.</p>
+<p>Each subsequent build will not regenerate configfiles as long as the configuration has not changed.</p>
+<p>However, if we use a variable such as GIT_COMMIT in our configfiles and want to always regenerate the latest configuration for each build, we can configure it.</p>
+<p>For background on how to use it, see: <a href="https://github.com/xmake-io/xmake/issues/4747">#4747</a></p>
 <h3 id="runautobuild">run.autobuild</h3>
 <p>This policy is used to adjust the behaviour of <code>xmake run</code>. By default, running <code>xmake run</code> does not build the target program automatically, but prompts the user to build it manually if it has not been compiled yet.</p>
 <p>By turning on this policy, we can automatically build the target program before running it.</p>

+ 11 - 1
mirror/guide/project_examples.html

@@ -1555,7 +1555,7 @@ hello world!
 </code></pre>
 <p>A more complete example: <a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/embed/verilator">Verilator</a></p>
 <h2 id="cppfrontprogram">Cppfront Program</h2>
-<pre><code class="lang-bash">add_rules("mode.debug", "mode.release")
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
 
 add_requires("cppfront")
 
@@ -1565,6 +1565,16 @@ target("test")
     add_files("src/*.cpp2")
     add_packages("cppfront")
 </code></pre>
+<h2 id="cosmoccprogram">Cosmocc Program</h2>
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
+
+add_requires("cosmocc")
+
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    set_toolchains("@cosmocc")
+</code></pre>
 </article>
 </body>
 </html>

+ 3 - 0
mirror/manual/conditions.html

@@ -240,6 +240,9 @@ end
 <h4 id="determinethearchitectureofthecurrenthostsubsystemenvironment">Determine the architecture of the current host subsystem environment</h4>
 <p>At present, it is mainly used for the detection of the architecture under the subsystem environment such as cygwin and msys2 on the windows system. The msvc tool chain is usually used on the windows compilation platform, and the architecture is x64, x86.<br>In the msys/cygwin subsystem environment, the compiler architecture defaults to x86_64/i386, which is different.</p>
 <p>We can also quickly view the current subsystem architecture by executing <code>xmake l os.subarch</code>.</p>
+<h3 id="is_cross">is_cross</h3>
+<h4 id="determineswhetherthecurrentplatformiscrosscompiledornot">Determines whether the current platform is cross-compiled or not.</h4>
+<p>This interface returns true if the current target architecture and platform, which is not the current host platform, is cross-compiled.</p>
 <h3 id="is_mode">is_mode</h3>
 <h4 id="isthecurrentcompilationmode">Is the current compilation mode</h4>
 <p>You can use this api to check the configuration command: <code>xmake f -m debug</code></p>

+ 14 - 0
mirror/manual/package_dependencies.html

@@ -178,6 +178,20 @@ add_versions("github:4.0.2", "4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1b
 <h3 id="packageadd_versions">package:add_versions</h3>
 <h4 id="addpackageversions">Add package 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>
+<h3 id="packageadd_versionfiles">package:add_versionfiles</h3>
+<h4 id="addingalistofpackageversions">Adding a list of package versions</h4>
+<p>Normally we can add package versions through the <code>add_versions</code> interface, but if there are more and more versions, the package configuration will be too bloated, at this time, we can use the <code>add_versionfiles</code> interface to store a list of all the versions in a separate file to maintain.</p>
+<p>For example:</p>
+<pre><code class="lang-lua">package("libcurl")
+    add_versionfiles("versions.txt")
+</code></pre>
+<pre><code class="lang-bash">8.5.0 ce4b6a6655431147624aaf582632a36fe1ade262d5fab385c60f78942dd8d87b
+8.4.0 e5250581a9c032b1b6ed3cf2f9c114c811fc41881069e9892d115cc73f9e88c6
+8.0.1 9b6b1e96b748d04b968786b6bdf407aa5c75ab53a3d37c1c8c81cdb736555ccf
+7.87.0 5d6e128761b7110946d1276aff6f0f266f2b726f5e619f7e0a057a474155f307
+7.31.0 a73b118eececff5de25111f35d1d0aafe1e71afdbb83082a8e44d847267e3e08
+...
+</code></pre>
 <h3 id="packageadd_patches">package:add_patches</h3>
 <h4 id="addpackagepatches">Add package 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>

+ 14 - 0
mirror/manual/project_target.html

@@ -2886,6 +2886,20 @@ target("doctest_shared")
 </code></pre>
 <p>Each unit test can be changed to a binary executable program through <code>kind = "binary"</code>, and the main entry function can be introduced through DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN.</p>
 <p>This enables external runnable unit tests in dynamic library targets.</p>
+<h5 id="configureruntimeout">Configure run timeout</h5>
+<p>If some test programs get stuck if they run for a long time without exiting, we can force them to exit and return failure by configuring a timeout.</p>
+<pre><code class="lang-lua">target("test_timeout")
+    set_kind("binary")
+    set_default(false)
+    add_files("src/run_timeout.cpp")
+    add_tests("run_timeout", {run_timeout = 1000})
+``
+
+```bash
+$ xmake test
+[100%]: test_timeout/run_timeout .................................... failed 1.006s
+run failed, exit code: -1, exit error: wait process timeout
+</code></pre>
 </article>
 </body>
 </html>

+ 5 - 0
mirror/zh-cn/guide/build_policies.html

@@ -264,6 +264,11 @@ set_policy("build.sanitizer.undefined", true)
 <p>与 <a href="https://xmake.io/#/zh-cn/guide/build_policies?id=buildsanitizeraddress">build.sanitizer.address</a> 类似,用于检测内存泄漏问题。</p>
 <h3 id="buildsanitizerundefined">build.sanitizer.undefined</h3>
 <p>与 <a href="https://xmake.io/#/zh-cn/guide/build_policies?id=buildsanitizeraddress">build.sanitizer.address</a> 类似,用于检测 undefined 问题。</p>
+<h3 id="buildalways_update_configfiles">build.always_update_configfiles</h3>
+<p>这个策略用于对 <code>add_configfiles</code> 配置文件的自动生成行为。默认情况下,xmake 仅仅只会在首次 <code>xmake config</code> 时候,或者 xmake.lua 配置有改动的是否,才会触发 configfiles 的重新生成。</p>
+<p>之后的每次构建,只要配置没有变化,就不会重新生成 configfiles。</p>
+<p>但是,如果我们的 configfiles 中有使用 GIT_COMMIT 等变量,想要每次构建时候,总是重新生成最新的配置,那么可以配置它。</p>
+<p>具体使用背景,可以看下:<a href="https://github.com/xmake-io/xmake/issues/4747">#4747</a></p>
 <h3 id="runautobuild">run.autobuild</h3>
 <p>这个策略用于调整 <code>xmake run</code> 的行为,默认情况下,执行 <code>xmake run</code> 并不会自动构建目标程序,如果程序还没被编译,就是提示用户手动构建一下。</p>
 <p>而开启这个策略,我们就可以在运行程序前,先自动构建对应的目标程序。</p>

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

@@ -1549,7 +1549,7 @@ hello world!
 </code></pre>
 <p>更多完整例子:<a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/embed/verilator">Verilator</a></p>
 <h2 id="cppfront">Cppfront 程序</h2>
-<pre><code class="lang-bash">add_rules("mode.debug", "mode.release")
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
 
 add_requires("cppfront")
 
@@ -1559,6 +1559,16 @@ target("test")
     add_files("src/*.cpp2")
     add_packages("cppfront")
 </code></pre>
+<h2 id="cosmocc">Cosmocc 程序</h2>
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
+
+add_requires("cosmocc")
+
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    set_toolchains("@cosmocc")
+</code></pre>
 </article>
 </body>
 </html>

+ 4 - 57
mirror/zh-cn/manual/conditions.html

@@ -92,63 +92,7 @@
   line-height: 1;
 }
 </style>
-    <p>条件判断的api,一般用于必须要处理特定平台的编译逻辑的场合。。通常跟lua的if语句配合使用。</p>
-<table>
-<thead>
-<tr>
-<th>接口</th>
-<th>描述</th>
-<th>支持版本</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="#is_os">is_os</a></td>
-<td>判断当前构建目标的操作系统</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#is_arch">is_arch</a></td>
-<td>判断当前编译架构</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#is_plat">is_plat</a></td>
-<td>判断当前编译平台</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#is_host">is_host</a></td>
-<td>判断当前主机环境操作系统</td>
-<td>>= 2.1.4</td>
-</tr>
-<tr>
-<td><a href="#is_mode">is_mode</a></td>
-<td>判断当前编译模式</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#is_kind">is_kind</a></td>
-<td>判断当前编译类型</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#is_config">is_config</a></td>
-<td>判断指定配置是否为给定的值</td>
-<td>>= 2.2.2</td>
-</tr>
-<tr>
-<td><a href="#has_config">has_config</a></td>
-<td>判断配置是否启用或者存在</td>
-<td>>= 2.2.2</td>
-</tr>
-<tr>
-<td><a href="#has_package">has_package</a></td>
-<td>判断依赖包是否被启用或者存在</td>
-<td>>= 2.2.3</td>
-</tr>
-</tbody>
-</table>
+    <p>条件判断的api,一般用于必须要处理特定平台的编译逻辑的场合。。通常跟 lua 的 if 语句配合使用。</p>
 <h3 id="is_os">is_os</h3>
 <h4 id="">判断当前构建目标的操作系统</h4>
 <pre><code class="lang-lua">-- 如果当前操作系统是ios
@@ -248,6 +192,9 @@ end
 <h4 id="">判断当前主机子系统环境下的架构</h4>
 <p>目前主要用于 windows 系统上 cygwin, msys2 等子系统环境下架构的探测,通常在 windows 编译平台采用 msvc 工具链,那边编译架构时 x64,x86。<br>而在 msys/cygwin 子系统环境下,编译架构默认为 x86_64/i386,是有差异的。</p>
 <p>我们也可以通过执行 <code>xmake l os.subarch</code> 来快速查看当前的子系统架构。</p>
+<h3 id="is_cross">is_cross</h3>
+<h4 id="">判断当前平台是否为交叉编译</h4>
+<p>如果当前的目标架构和平台,不是当前的主机平台,属于交叉编译,这个接口就会返回 true。</p>
 <h3 id="is_mode">is_mode</h3>
 <h4 id="">判断当前编译模式</h4>
 <p>用于检测编译配置:<code>xmake f -m debug</code></p>

+ 14 - 0
mirror/zh-cn/manual/package_dependencies.html

@@ -176,6 +176,20 @@ add_versions("github:4.0.2", "4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1b
 <h3 id="packageadd_versions">package:add_versions</h3>
 <h4 id="">设置每个源码包的版本</h4>
 <p>它也会设置对应的sha256值,具体描述见:<a href="#packageadd_urls">add_urls</a></p>
+<h3 id="packageadd_versionfiles">package:add_versionfiles</h3>
+<h4 id="">添加包版本列表</h4>
+<p>通常我们可以通过 <code>add_versions</code> 接口添加包版本,但是如果版本越来越多,就会导致包配置太过臃肿,这个时候,我们可以使用 <code>add_versionfiles</code> 接口将所有的版本列表,存储到单独的文件中去维护。</p>
+<p>例如:</p>
+<pre><code class="lang-lua">package("libcurl")
+    add_versionfiles("versions.txt")
+</code></pre>
+<pre><code class="lang-bash">8.5.0 ce4b6a6655431147624aaf582632a36fe1ade262d5fab385c60f78942dd8d87b
+8.4.0 e5250581a9c032b1b6ed3cf2f9c114c811fc41881069e9892d115cc73f9e88c6
+8.0.1 9b6b1e96b748d04b968786b6bdf407aa5c75ab53a3d37c1c8c81cdb736555ccf
+7.87.0 5d6e128761b7110946d1276aff6f0f266f2b726f5e619f7e0a057a474155f307
+7.31.0 a73b118eececff5de25111f35d1d0aafe1e71afdbb83082a8e44d847267e3e08
+...
+</code></pre>
 <h3 id="packageadd_patches">package:add_patches</h3>
 <h4 id="">设置包补丁</h4>
 <p>此接口用于针对源码包,在编译安装前,先打对应设置的补丁包,再对其进行编译,并且可支持同时打多个补丁。</p>

+ 12 - 0
mirror/zh-cn/manual/project_target.html

@@ -2901,6 +2901,18 @@ target("doctest_shared")
 </code></pre>
 <p>通过 <code>kind = "binary"</code> 可以将每个单元测试改为 binary 可执行程序,并通过 DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN 引入 main 入口函数。</p>
 <p>这样就能实现动态库目标中外置可运行的单元测试。</p>
+<h5 id="">配置运行超时</h5>
+<p>如果一些测试程序长时间运行不退出,就会卡住,我们可以通过配置超时时间,强制退出,并返回失败。</p>
+<pre><code class="lang-lua">target("test_timeout")
+    set_kind("binary")
+    set_default(false)
+    add_files("src/run_timeout.cpp")
+    add_tests("run_timeout", {run_timeout = 1000})
+</code></pre>
+<pre><code class="lang-bash">$ xmake test
+[100%]: test_timeout/run_timeout .................................... failed 1.006s
+run failed, exit code: -1, exit error: wait process timeout
+</code></pre>
 </article>
 </body>
 </html>

+ 104 - 104
sitemap.xml

@@ -12,522 +12,522 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2024-02-20T13:53:06+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2024-02-20T13:53:07+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2024-02-20T13:53:07+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/build_policies.html</loc>
-  <lastmod>2024-02-20T13:53:07+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2024-02-20T13:53:07+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2024-02-20T13:53:07+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2024-02-20T13:53:08+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/remote_build.html</loc>
-  <lastmod>2024-02-20T13:53:08+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/unity_build.html</loc>
-  <lastmod>2024-02-20T13:53:08+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/distcc_build.html</loc>
-  <lastmod>2024-02-20T13:53:08+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/trybuild.html</loc>
-  <lastmod>2024-02-20T13:53:08+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/autogen.html</loc>
-  <lastmod>2024-02-20T13:53:08+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/build_cache.html</loc>
-  <lastmod>2024-02-20T13:53:09+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2024-02-20T13:53:09+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2024-02-20T13:53:09+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2024-02-20T13:53:09+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2024-02-20T13:53:09+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2024-02-20T13:53:10+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2024-02-20T13:53:10+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2024-02-20T13:53:10+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2024-02-20T13:53:10+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/who_is_using_xmake.html</loc>
-  <lastmod>2024-02-20T13:53:11+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2024-02-20T13:53:11+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:09+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2024-02-20T13:53:11+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:09+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2024-02-20T13:53:11+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:09+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2024-02-20T13:53:12+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:09+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2024-02-20T13:53:12+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:09+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/build_policies.html</loc>
-  <lastmod>2024-02-20T13:53:12+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:10+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2024-02-20T13:53:12+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:10+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2024-02-20T13:53:12+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:10+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2024-02-20T13:53:13+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:10+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/remote_build.html</loc>
-  <lastmod>2024-02-20T13:53:13+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:10+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/unity_build.html</loc>
-  <lastmod>2024-02-20T13:53:13+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:10+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/distcc_build.html</loc>
-  <lastmod>2024-02-20T13:53:13+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/trybuild.html</loc>
-  <lastmod>2024-02-20T13:53:13+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/autogen.html</loc>
-  <lastmod>2024-02-20T13:53:14+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/build_cache.html</loc>
-  <lastmod>2024-02-20T13:53:14+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2024-02-20T13:53:14+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2024-02-20T13:53:14+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:11+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2024-02-20T13:53:14+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2024-02-20T13:53:15+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2024-02-20T13:53:15+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2024-02-20T13:53:15+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2024-02-20T13:53:15+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/peripheral_items.html</loc>
-  <lastmod>2024-02-20T13:53:16+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:12+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2024-02-20T13:53:16+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/who_is_using_xmake.html</loc>
-  <lastmod>2024-02-20T13:53:16+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2024-02-20T13:53:16+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2024-02-20T13:53:16+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2024-02-20T13:53:17+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2024-02-20T13:53:17+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:13+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2024-02-20T13:53:17+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2024-02-20T13:53:17+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2024-02-20T13:53:17+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2024-02-20T13:53:18+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/target_instance.html</loc>
-  <lastmod>2024-02-20T13:53:18+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2024-02-20T13:53:18+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:14+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2024-02-20T13:53:18+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2024-02-20T13:53:18+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2024-02-20T13:53:19+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2024-02-20T13:53:19+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2024-02-20T13:53:19+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:15+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2024-02-20T13:53:19+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/helper_interfaces.html</loc>
-  <lastmod>2024-02-20T13:53:19+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2024-02-20T13:53:20+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_instance.html</loc>
-  <lastmod>2024-02-20T13:53:20+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/xpack.html</loc>
-  <lastmod>2024-02-20T13:53:20+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/option_instance.html</loc>
-  <lastmod>2024-02-20T13:53:20+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:16+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2024-02-20T13:53:20+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2024-02-20T13:53:21+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_3rd_source_library.html</loc>
-  <lastmod>2024-02-20T13:53:21+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package_old.html</loc>
-  <lastmod>2024-02-20T13:53:21+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2024-02-20T13:53:21+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2024-02-20T13:53:21+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:17+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2024-02-20T13:53:22+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/remote_toolchain.html</loc>
-  <lastmod>2024-02-20T13:53:22+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2024-02-20T13:53:22+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2024-02-20T13:53:22+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2024-02-20T13:53:22+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2024-02-20T13:53:23+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2024-02-20T13:53:23+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2024-02-20T13:53:23+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/target_instance.html</loc>
-  <lastmod>2024-02-20T13:53:23+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2024-02-20T13:53:23+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2024-02-20T13:53:24+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2024-02-20T13:53:24+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2024-02-20T13:53:24+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2024-02-20T13:53:24+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2024-02-20T13:53:25+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2024-02-20T13:53:25+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/helper_interfaces.html</loc>
-  <lastmod>2024-02-20T13:53:25+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2024-02-20T13:53:25+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_instance.html</loc>
-  <lastmod>2024-02-20T13:53:25+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/xpack.html</loc>
-  <lastmod>2024-02-20T13:53:26+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/option_instance.html</loc>
-  <lastmod>2024-02-20T13:53:26+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2024-02-20T13:53:26+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2024-02-20T13:53:26+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_3rd_source_library.html</loc>
-  <lastmod>2024-02-20T13:53:27+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package_old.html</loc>
-  <lastmod>2024-02-20T13:53:27+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2024-02-20T13:53:27+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2024-02-20T13:53:27+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2024-02-20T13:53:28+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/remote_toolchain.html</loc>
-  <lastmod>2024-02-20T13:53:28+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2024-02-20T13:53:28+08:00</lastmod>
+  <lastmod>2024-02-24T22:49:23+08:00</lastmod>
 </url>
 
 </urlset>

+ 10 - 0
zh-cn/guide/build_policies.md

@@ -300,6 +300,16 @@ $ xmake f --policies=build.sanitizer.address,build.sanitizer.undefined
 
 与 [build.sanitizer.address](https://xmake.io/#/zh-cn/guide/build_policies?id=buildsanitizeraddress) 类似,用于检测 undefined 问题。
 
+### build.always_update_configfiles
+
+这个策略用于对 `add_configfiles` 配置文件的自动生成行为。默认情况下,xmake 仅仅只会在首次 `xmake config` 时候,或者 xmake.lua 配置有改动的是否,才会触发 configfiles 的重新生成。
+
+之后的每次构建,只要配置没有变化,就不会重新生成 configfiles。
+
+但是,如果我们的 configfiles 中有使用 GIT_COMMIT 等变量,想要每次构建时候,总是重新生成最新的配置,那么可以配置它。
+
+具体使用背景,可以看下:[#4747](https://github.com/xmake-io/xmake/issues/4747)
+
 ### run.autobuild
 
 这个策略用于调整 `xmake run` 的行为,默认情况下,执行 `xmake run` 并不会自动构建目标程序,如果程序还没被编译,就是提示用户手动构建一下。

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

@@ -2132,7 +2132,7 @@ hello world!
 
 ## Cppfront 程序
 
-```bash
+```lua
 add_rules("mode.debug", "mode.release")
 
 add_requires("cppfront")
@@ -2144,3 +2144,15 @@ target("test")
     add_packages("cppfront")
 ```
 
+## Cosmocc 程序
+
+```lua
+add_rules("mode.debug", "mode.release")
+
+add_requires("cosmocc")
+
+target("test")
+    set_kind("binary")
+    add_files("src/*.c")
+    set_toolchains("@cosmocc")
+```

+ 9 - 15
zh-cn/manual/conditions.md

@@ -1,19 +1,7 @@
 
-条件判断的api,一般用于必须要处理特定平台的编译逻辑的场合。。通常跟lua的if语句配合使用。
-
-| 接口                        | 描述                          | 支持版本                |
-| -------------------------   | ----------------------------- | ----------------------- |
-| [is_os](#is_os)             | 判断当前构建目标的操作系统    | >= 2.0.1                |
-| [is_arch](#is_arch)         | 判断当前编译架构              | >= 2.0.1                |
-| [is_plat](#is_plat)         | 判断当前编译平台              | >= 2.0.1                |
-| [is_host](#is_host)         | 判断当前主机环境操作系统      | >= 2.1.4                |
-| [is_mode](#is_mode)         | 判断当前编译模式              | >= 2.0.1                |
-| [is_kind](#is_kind)         | 判断当前编译类型              | >= 2.0.1                |
-| [is_config](#is_config)     | 判断指定配置是否为给定的值    | >= 2.2.2                |
-| [has_config](#has_config)   | 判断配置是否启用或者存在      | >= 2.2.2                |
-| [has_package](#has_package) | 判断依赖包是否被启用或者存在  | >= 2.2.3                |
-
-### is_os 
+条件判断的api,一般用于必须要处理特定平台的编译逻辑的场合。。通常跟 lua 的 if 语句配合使用。
+
+### is_os
 
 #### 判断当前构建目标的操作系统
 
@@ -154,6 +142,12 @@ end
 
 我们也可以通过执行 `xmake l os.subarch` 来快速查看当前的子系统架构。
 
+### is_cross
+
+#### 判断当前平台是否为交叉编译
+
+如果当前的目标架构和平台,不是当前的主机平台,属于交叉编译,这个接口就会返回 true。
+
 ### is_mode
 
 #### 判断当前编译模式

+ 22 - 0
zh-cn/manual/package_dependencies.md

@@ -125,6 +125,28 @@ add_urls("https://github.com/madler/zlib/archive/$(version).tar.gz", {
 
 它也会设置对应的sha256值,具体描述见:[add_urls](#packageadd_urls)
 
+### package:add_versionfiles
+
+#### 添加包版本列表
+
+通常我们可以通过 `add_versions` 接口添加包版本,但是如果版本越来越多,就会导致包配置太过臃肿,这个时候,我们可以使用 `add_versionfiles` 接口将所有的版本列表,存储到单独的文件中去维护。
+
+例如:
+
+```lua
+package("libcurl")
+    add_versionfiles("versions.txt")
+```
+
+```bash
+8.5.0 ce4b6a6655431147624aaf582632a36fe1ade262d5fab385c60f78942dd8d87b
+8.4.0 e5250581a9c032b1b6ed3cf2f9c114c811fc41881069e9892d115cc73f9e88c6
+8.0.1 9b6b1e96b748d04b968786b6bdf407aa5c75ab53a3d37c1c8c81cdb736555ccf
+7.87.0 5d6e128761b7110946d1276aff6f0f266f2b726f5e619f7e0a057a474155f307
+7.31.0 a73b118eececff5de25111f35d1d0aafe1e71afdbb83082a8e44d847267e3e08
+...
+```
+
 ### package:add_patches
 
 #### 设置包补丁

+ 18 - 0
zh-cn/manual/project_target.md

@@ -3602,3 +3602,21 @@ target("doctest_shared")
 通过 `kind = "binary"` 可以将每个单元测试改为 binary 可执行程序,并通过 DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN 引入 main 入口函数。
 
 这样就能实现动态库目标中外置可运行的单元测试。
+
+##### 配置运行超时
+
+如果一些测试程序长时间运行不退出,就会卡住,我们可以通过配置超时时间,强制退出,并返回失败。
+
+```lua
+target("test_timeout")
+    set_kind("binary")
+    set_default(false)
+    add_files("src/run_timeout.cpp")
+    add_tests("run_timeout", {run_timeout = 1000})
+```
+
+```bash
+$ xmake test
+[100%]: test_timeout/run_timeout .................................... failed 1.006s
+run failed, exit code: -1, exit error: wait process timeout
+```