ruki преди 4 години
родител
ревизия
24c8b686a5

+ 1 - 1
_coverpage.md

@@ -1,6 +1,6 @@
 <img src="/assets/img/logo.svg" width="16%" />
 
-# xmake <small>2.5.5</small>
+# xmake <small>2.5.6</small>
 
 > A cross-platform build utility based on Lua
 

+ 19 - 0
about/changelog.md

@@ -1,3 +1,22 @@
+## v2.5.6
+
+### New features
+
+* [#1483](https://github.com/xmake-io/xmake/issues/1483): Add `os.joinenvs()` and improve package tools envirnoments
+* [#1523](https://github.com/xmake-io/xmake/issues/1523): Add `set_allowedmodes`, `set_allowedplats` and `set_allowedarchs`
+* [#1523](https://github.com/xmake-io/xmake/issues/1523): Add `set_defaultmode`, `set_defaultplat` and `set_defaultarch`
+
+### Change
+
+* Improve vs/vsxmake project generator to support vs2022
+* [#1513](https://github.com/xmake-io/xmake/issues/1513): Improve precompiled binary package compatibility on windows/msvc
+* Improve to find vcpkg root directory on windows
+* Improve to support Qt6
+
+### Bugs fixed
+
+* [#489](https://github.com/xmake-io/xmake-repo/pull/489): Fix run os.execv with too long envirnoment value on windows
+
 ## v2.5.5
 
 ### New features

+ 99 - 53
manual/global_interfaces.md

@@ -1,21 +1,6 @@
 
 The global interface affects the whole project description scope and all sub-project files.
 
-| Interfaces                            | Description                                              | Version  |
-| ------------------------------------- | -------------------------------------                    | -------- |
-| [includes](#includes)                 | Add sub-project files and directories                    | >= 2.1.5 |
-| [set_project](#set_project)           | Set project name                                         | >= 2.0.1 |
-| [set_version](#set_version)           | Set project version                                      | >= 2.0.1 |
-| [set_xmakever](#set_xmakever)         | Set minimal xmake version                                | >= 2.1.1 |
-| [add_moduledirs](#add_moduledirs)     | Add module directories                                   | >= 2.1.5 |
-| [add_plugindirs](#add_plugindirs)     | Add plugin directories                                   | >= 2.0.1 |
-| [add_packagedirs](#add_packagedirs)   | Add package directories                                  | >= 2.0.1 |
-| [get_config](#get_config)             | Get the configuration value                              | >= 2.2.2 |
-| [set_config](#set_config)             | Set the default configuration value                      | >= 2.2.2 |
-| [add_requires](#add_requires)         | Add required package dependencies                        | >= 2.2.2 |
-| [add_requireconfs](#add_requireconfs) | Set the configuration of the specified dependent package | >= 2.5.1 |
-| [add_repositories](#add_repositories) | Add 3rd package repositories                             | >= 2.2.2 |
-
 ### includes
 
 #### Add sub-project files and directories
@@ -59,6 +44,8 @@ target("test")
     add_files("src/*.c")
 ```
 
+#### Builtin help functions
+
 In addition, in 2.2.5 and later, this interface provides some built-in helper functions, which can be used directly after the include, specifically which built-in functions can be seen at: https://github.com/xmake-io/xmake/tree/master/xmake/includes
 
 For a more complete description of this, see: [https://github.com/xmake-io/xmake/issues/342](https://github.com/xmake-io/xmake/issues/342 )
@@ -184,44 +171,6 @@ add_plugindirs("$(projectdir)/plugins")
 ```
 xmake will load all plugins in the given directory.
 
-### add_packagedirs
-
-#### Add package directories
-
-By setting up a dependency package directory, you can easily integrate some third-party dependent libraries.
-Taking the tbox project as an example, its package directory is as follows:
-
-
-```
-tbox.pkg
-- base.pkg
-- zlib.pkg
-- polarssl.pkg
-- openssl.pkg
-- mysql.pkg
-- pcre.pkg
-- ...
-```
-
-If you want the current project to load these packages, first specify the package directory path, for example:
-
-```lua
-add_packagedirs("pkg")
-```
-
-Then, please add these packages to the given target by [add_packages](#add_packages):
-
-```lua
-target("tbox")
-    add_packages("zlib", "polarssl", "pcre", "mysql")
-```
-
-xmake will check these packages automatically and link with them if they exist, and we can disable them manually.
-
-```bash
-$ xmake f --openssl=n
-```
-
 ### get_config
 
 #### Get the configuration value
@@ -600,3 +549,100 @@ add_repositories("my-repo myrepo")
 ```
 
 This can be referred to [benchbox](https://github.com/tboox/benchbox) project, which has a built-in private repository.
+
+### set_defaultplat
+
+#### Set the default compilation platform
+
+Only supported by v2.5.6 and above, it is used to set the default compilation platform of the project. If it is not set, the default platform follows the current system platform, which is os.host().
+
+For example, the default compilation platform on macOS is macosx, if the current project is an ios project, you can set the default compilation platform to iphoneos.
+
+```lua
+set_defaultplat("iphoneos")
+```
+
+It is equivalent to `xmake f -p iphoneos`.
+
+### set_defaultarch
+
+#### Set the default compilation architecture
+
+Only supported by v2.5.6 and above, it is used to set the default compilation architecture of the project. If it is not set, the default platform follows the current system architecture, which is os.arch().
+
+```lua
+set_defaultplat("iphoneos")
+set_defaultarch("arm64")
+```
+
+It is equivalent to `xmake f -p iphoneos -a arm64`.
+
+We can also set the default architecture under multiple platforms.
+
+```lua
+set_defaultarch("iphoneos|arm64", "windows|x64")
+```
+
+The arm64 architecture is compiled by default on iphoneos, and the x64 architecture is compiled by default on windows.
+
+### set_defaultmode
+
+#### Set the default compilation mode
+
+Only supported by v2.5.6 and above, it is used to set the default compilation mode of the project. If it is not set, the default is to compile in release mode.
+
+```lua
+set_defaultmode("releasedbg")
+```
+
+It is equivalent to `xmake f -m releasedbg`.
+
+### set_allowedplats
+
+#### Set the list of platforms allowed to compile
+
+It is only supported by v2.5.6 and above. It is used to set the list of compilation platforms supported by the project. If the user specifies other platforms, an error will be prompted. This is usually used to restrict the user from specifying the wrong invalid platform.
+
+If it is not set, then there are no platform restrictions.
+
+```lua
+set_allowedplats("windows", "mingw")
+```
+
+Set the current project to only support windows and mingw platforms.
+
+### set_allowedarchs
+
+#### Set the platform architecture that allows compilation
+
+Only supported by v2.5.6 and above. It is used to set the list of compiled architectures supported by the project. If the user specifies other architectures, an error will be prompted. This is usually used to restrict users from specifying incorrect invalid architectures.
+
+If it is not set, then there are no architectural restrictions.
+
+```lua
+set_allowedarchs("x64", "x86")
+```
+
+The current project only supports x64/x86 platforms.
+
+We can also specify the list of architectures allowed under multiple platforms at the same time.
+
+```lua
+set_allowedarchs("windows|x64", "iphoneos|arm64")
+```
+
+Set the current project to only support x64 architecture on windows, and only support arm64 architecture on iphoneos.
+
+### set_allowedmodes
+
+#### Set the list of allowed compilation modes
+
+It is only supported by v2.5.6 and above. It is used to set the list of compilation modes supported by the project. If the user specifies other modes, an error will be prompted. This is usually used to restrict the user from specifying incorrect invalid modes.
+
+If it is not set, then there is no mode restriction.
+
+```lua
+set_allowedmodes("release", "releasedbg")
+```
+
+Set the current project to only support the two compilation modes release/releasedbg.

+ 19 - 1
mirror/about/changelog.html

@@ -90,7 +90,25 @@
   line-height: 1;
 }
 </style>
-    <h2 id="v255">v2.5.5</h2>
+    <h2 id="v256">v2.5.6</h2>
+<h3 id="newfeatures">New features</h3>
+<ul>
+<li><a href="https://github.com/xmake-io/xmake/issues/1483">#1483</a>: Add <code>os.joinenvs()</code> and improve package tools envirnoments</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/1523">#1523</a>: Add <code>set_allowedmodes</code>, <code>set_allowedplats</code> and <code>set_allowedarchs</code></li>
+<li><a href="https://github.com/xmake-io/xmake/issues/1523">#1523</a>: Add <code>set_defaultmode</code>, <code>set_defaultplat</code> and <code>set_defaultarch</code></li>
+</ul>
+<h3 id="change">Change</h3>
+<ul>
+<li>Improve vs/vsxmake project generator to support vs2022</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/1513">#1513</a>: Improve precompiled binary package compatibility on windows/msvc</li>
+<li>Improve to find vcpkg root directory on windows</li>
+<li>Improve to support Qt6</li>
+</ul>
+<h3 id="bugsfixed">Bugs fixed</h3>
+<ul>
+<li><a href="https://github.com/xmake-io/xmake-repo/pull/489">#489</a>: Fix run os.execv with too long envirnoment value on windows</li>
+</ul>
+<h2 id="v255">v2.5.5</h2>
 <h3 id="newfeatures">New features</h3>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake/issues/1421">#1421</a>: Add prefix, suffix and extension options for target names</li>

+ 50 - 92
mirror/manual/global_interfaces.html

@@ -91,77 +91,6 @@
 }
 </style>
     <p>The global interface affects the whole project description scope and all sub-project files.</p>
-<table>
-<thead>
-<tr>
-<th>Interfaces</th>
-<th>Description</th>
-<th>Version</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="#includes">includes</a></td>
-<td>Add sub-project files and directories</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#set_project">set_project</a></td>
-<td>Set project name</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#set_version">set_version</a></td>
-<td>Set project version</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#set_xmakever">set_xmakever</a></td>
-<td>Set minimal xmake version</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="#add_moduledirs">add_moduledirs</a></td>
-<td>Add module directories</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#add_plugindirs">add_plugindirs</a></td>
-<td>Add plugin directories</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#add_packagedirs">add_packagedirs</a></td>
-<td>Add package directories</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#get_config">get_config</a></td>
-<td>Get the configuration value</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>>= 2.2.2</td>
-</tr>
-<tr>
-<td><a href="#add_requires">add_requires</a></td>
-<td>Add required package dependencies</td>
-<td>>= 2.2.2</td>
-</tr>
-<tr>
-<td><a href="#add_requireconfs">add_requireconfs</a></td>
-<td>Set the configuration of the specified dependent package</td>
-<td>>= 2.5.1</td>
-</tr>
-<tr>
-<td><a href="#add_repositories">add_repositories</a></td>
-<td>Add 3rd package repositories</td>
-<td>>= 2.2.2</td>
-</tr>
-</tbody>
-</table>
 <h3 id="includes">includes</h3>
 <h4 id="addsubprojectfilesanddirectories">Add sub-project files and directories</h4>
 <p>We can use this interfaces to add sub-project files (xmake.lua) or directories with xmake.lua.</p>
@@ -190,6 +119,7 @@ target("test")
     set_kind("binary")
     add_files("src/*.c")
 </code></pre>
+<h4 id="builtinhelpfunctions">Builtin help functions</h4>
 <p>In addition, in 2.2.5 and later, this interface provides some built-in helper functions, which can be used directly after the include, specifically which built-in functions can be seen at: <a href="https://github.com/xmake-io/xmake/tree/master/xmake/includes">https://github.com/xmake-io/xmake/tree/master/xmake/includes</a></p>
 <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>
@@ -274,27 +204,6 @@ set_xmakever("2.1.0")
 <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>
-<h4 id="addpackagedirectories">Add package directories</h4>
-<p>By setting up a dependency package directory, you can easily integrate some third-party dependent libraries.<br>Taking the tbox project as an example, its package directory is as follows:</p>
-<pre><code>tbox.pkg
-- base.pkg
-- zlib.pkg
-- polarssl.pkg
-- openssl.pkg
-- mysql.pkg
-- 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("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("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
-</code></pre>
 <h3 id="get_config">get_config</h3>
 <h4 id="gettheconfigurationvalue">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>
@@ -517,6 +426,55 @@ add_requireconfs("libwebp.*|cmake", {debug = true})
 <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>
+<h3 id="set_defaultplat">set_defaultplat</h3>
+<h4 id="setthedefaultcompilationplatform">Set the default compilation platform</h4>
+<p>Only supported by v2.5.6 and above, it is used to set the default compilation platform of the project. If it is not set, the default platform follows the current system platform, which is os.host().</p>
+<p>For example, the default compilation platform on macOS is macosx, if the current project is an ios project, you can set the default compilation platform to iphoneos.</p>
+<pre><code class="lang-lua">set_defaultplat("iphoneos")
+</code></pre>
+<p>It is equivalent to <code>xmake f -p iphoneos</code>.</p>
+<h3 id="set_defaultarch">set_defaultarch</h3>
+<h4 id="setthedefaultcompilationarchitecture">Set the default compilation architecture</h4>
+<p>Only supported by v2.5.6 and above, it is used to set the default compilation architecture of the project. If it is not set, the default platform follows the current system architecture, which is os.arch().</p>
+<pre><code class="lang-lua">set_defaultplat("iphoneos")
+set_defaultarch("arm64")
+</code></pre>
+<p>It is equivalent to <code>xmake f -p iphoneos -a arm64</code>.</p>
+<p>We can also set the default architecture under multiple platforms.</p>
+<pre><code class="lang-lua">set_defaultarch("iphoneos|arm64", "windows|x64")
+</code></pre>
+<p>The arm64 architecture is compiled by default on iphoneos, and the x64 architecture is compiled by default on windows.</p>
+<h3 id="set_defaultmode">set_defaultmode</h3>
+<h4 id="setthedefaultcompilationmode">Set the default compilation mode</h4>
+<p>Only supported by v2.5.6 and above, it is used to set the default compilation mode of the project. If it is not set, the default is to compile in release mode.</p>
+<pre><code class="lang-lua">set_defaultmode("releasedbg")
+</code></pre>
+<p>It is equivalent to <code>xmake f -m releasedbg</code>.</p>
+<h3 id="set_allowedplats">set_allowedplats</h3>
+<h4 id="setthelistofplatformsallowedtocompile">Set the list of platforms allowed to compile</h4>
+<p>It is only supported by v2.5.6 and above. It is used to set the list of compilation platforms supported by the project. If the user specifies other platforms, an error will be prompted. This is usually used to restrict the user from specifying the wrong invalid platform.</p>
+<p>If it is not set, then there are no platform restrictions.</p>
+<pre><code class="lang-lua">set_allowedplats("windows", "mingw")
+</code></pre>
+<p>Set the current project to only support windows and mingw platforms.</p>
+<h3 id="set_allowedarchs">set_allowedarchs</h3>
+<h4 id="settheplatformarchitecturethatallowscompilation">Set the platform architecture that allows compilation</h4>
+<p>Only supported by v2.5.6 and above. It is used to set the list of compiled architectures supported by the project. If the user specifies other architectures, an error will be prompted. This is usually used to restrict users from specifying incorrect invalid architectures.</p>
+<p>If it is not set, then there are no architectural restrictions.</p>
+<pre><code class="lang-lua">set_allowedarchs("x64", "x86")
+</code></pre>
+<p>The current project only supports x64/x86 platforms.</p>
+<p>We can also specify the list of architectures allowed under multiple platforms at the same time.</p>
+<pre><code class="lang-lua">set_allowedarchs("windows|x64", "iphoneos|arm64")
+</code></pre>
+<p>Set the current project to only support x64 architecture on windows, and only support arm64 architecture on iphoneos.</p>
+<h3 id="set_allowedmodes">set_allowedmodes</h3>
+<h4 id="setthelistofallowedcompilationmodes">Set the list of allowed compilation modes</h4>
+<p>It is only supported by v2.5.6 and above. It is used to set the list of compilation modes supported by the project. If the user specifies other modes, an error will be prompted. This is usually used to restrict the user from specifying incorrect invalid modes.</p>
+<p>If it is not set, then there is no mode restriction.</p>
+<pre><code class="lang-lua">set_allowedmodes("release", "releasedbg")
+</code></pre>
+<p>Set the current project to only support the two compilation modes release/releasedbg.</p>
 </article>
 </body>
 </html>

+ 19 - 1
mirror/zh-cn/about/changelog.html

@@ -90,7 +90,25 @@
   line-height: 1;
 }
 </style>
-    <h2 id="v255">v2.5.5</h2>
+    <h2 id="v256">v2.5.6</h2>
+<h3 id="">新特性</h3>
+<ul>
+<li><a href="https://github.com/xmake-io/xmake/issues/1483">#1483</a>: 添加 <code>os.joinenvs()</code> 和改进包工具环境</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/1523">#1523</a>: 添加 <code>set_allowedmodes</code>, <code>set_allowedplats</code> 和 <code>set_allowedarchs</code></li>
+<li><a href="https://github.com/xmake-io/xmake/issues/1523">#1523</a>: 添加 <code>set_defaultmode</code>, <code>set_defaultplat</code> 和 <code>set_defaultarch</code></li>
+</ul>
+<h3 id="">改进</h3>
+<ul>
+<li>改进 vs/vsxmake 工程插件支持 vs2022</li>
+<li><a href="https://github.com/xmake-io/xmake/issues/1513">#1513</a>: 改进 windows 预编译包的兼容性问题</li>
+<li>改进 vcpkg 包在 windows 上的查找</li>
+<li>改进对 Qt6 的支持</li>
+</ul>
+<h3 id="bugs">Bugs 修复</h3>
+<ul>
+<li><a href="https://github.com/xmake-io/xmake-repo/pull/489">#489</a>: 修复 run os.execv 带有过长环境变量值出现的一些问题</li>
+</ul>
+<h2 id="v255">v2.5.5</h2>
 <h3 id="">新特性</h3>
 <ul>
 <li><a href="https://github.com/xmake-io/xmake/issues/1421">#1421</a>: 针对 target 目标,增加目标文件名的前缀,后缀和扩展名设置接口。</li>

+ 50 - 88
mirror/zh-cn/manual/global_interfaces.html

@@ -91,77 +91,6 @@
 }
 </style>
     <p>全局接口影响整个工程描述,被调用后,后面被包含进来的所有子<code>xmake.lua</code>都会受影响。</p>
-<table>
-<thead>
-<tr>
-<th>接口</th>
-<th>描述</th>
-<th>支持版本</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="#includes">includes</a></td>
-<td>添加子工程文件和目录</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#set_project">set_project</a></td>
-<td>设置工程名</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#set_version">set_version</a></td>
-<td>设置工程版本</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#set_xmakever">set_xmakever</a></td>
-<td>设置最小xmake版本</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="#add_moduledirs">add_moduledirs</a></td>
-<td>添加模块目录</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#add_plugindirs">add_plugindirs</a></td>
-<td>添加插件目录</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#add_packagedirs">add_packagedirs</a></td>
-<td>添加包目录</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#get_config">get_config</a></td>
-<td>获取给的配置值</td>
-<td>>= 2.2.2</td>
-</tr>
-<tr>
-<td><a href="#set_config">set_config</a></td>
-<td>设置默认的配置值</td>
-<td>>= 2.2.2</td>
-</tr>
-<tr>
-<td><a href="#add_requires">add_requires</a></td>
-<td>添加需要的依赖包</td>
-<td>>= 2.2.2</td>
-</tr>
-<tr>
-<td><a href="#add_requireconfs">add_requireconfs</a></td>
-<td>设置指定依赖包的配置</td>
-<td>>= 2.5.1</td>
-</tr>
-<tr>
-<td><a href="#add_repositories">add_repositories</a></td>
-<td>添加依赖包仓库</td>
-<td>>= 2.2.2</td>
-</tr>
-</tbody>
-</table>
 <h3 id="includes">includes</h3>
 <h4 id="">添加子工程文件和目录</h4>
 <p>我们能够使用此接口添加工程子文件(xmake.lua)或者带有xmake.lua的工程子目录。</p>
@@ -190,6 +119,7 @@ target("test")
     set_kind("binary")
     add_files("src/*.c")
 </code></pre>
+<h4 id="">内置的辅助接口</h4>
 <p>另外,此接口在2.2.5之后的版本,提供了一些内置的辅助函数,可以直接includes后使用,具体有哪些内置函数可以看下:<a href="https://github.com/xmake-io/xmake/tree/master/xmake/includes">https://github.com/xmake-io/xmake/tree/master/xmake/includes</a></p>
 <p>关于这块的更加完整的说明,可以看下:<a href="https://github.com/xmake-io/xmake/issues/342">https://github.com/xmake-io/xmake/issues/342</a></p>
 <p>例子:</p>
@@ -279,23 +209,6 @@ set_xmakever("2.1.0")
 add_plugindirs("$(projectdir)/plugins")
 </code></pre>
 <p>这样,xmake在编译此工程的时候,也就加载这些插件。</p>
-<h3 id="add_packagedirs">add_packagedirs</h3>
-<h4 id="">添加包目录</h4>
-<p>通过设置依赖包目录,可以方便的集成一些第三方的依赖库,以tbox工程为例,其依赖包如下:</p>
-<pre><code>- base.pkg
-- zlib.pkg
-- polarssl.pkg
-- openssl.pkg
-- mysql.pkg
-- pcre.pkg
-- ...
-</code></pre><p>如果要让当前工程识别加载这些包,首先要指定包目录路径,例如:</p>
-<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("tbox")
-    add_packages("zlib", "polarssl", "pcre", "mysql")
-</code></pre>
 <h3 id="get_config">get_config</h3>
 <h4 id="">获取给定的配置值</h4>
 <p>此接口从2.2.2版本开始引入,用于快速获取给定的配置值,可用于描述域。</p>
@@ -525,6 +438,55 @@ add_requireconfs("libwebp.*|cmake", {debug = true})
 <pre><code class="lang-lua">add_repositories("my-repo myrepo")
 </code></pre>
 <p>这个可以参考<a href="https://github.com/tboox/benchbox">benchbox</a>项目,里面就内置了一个私有仓库。</p>
+<h3 id="set_defaultplat">set_defaultplat</h3>
+<h4 id="">设置默认的编译平台</h4>
+<p>v2.5.6 以上版本才支持,用于设置工程默认的编译平台,如果没有设置,默认平台跟随当前系统平台,也就是 os.host()。</p>
+<p>比如,在 macOS 上默认编译平台是 macosx,如果当前项目是 ios 项目,那么可以设置默认编译平台为 iphoneos。</p>
+<pre><code class="lang-lua">set_defaultplat("iphoneos")
+</code></pre>
+<p>它等价于,<code>xmake f -p iphoneos</code>。</p>
+<h3 id="set_defaultarch">set_defaultarch</h3>
+<h4 id="">设置默认的编译架构</h4>
+<p>v2.5.6 以上版本才支持,用于设置工程默认的编译架构,如果没有设置,默认平台跟随当前系统架构,也就是 os.arch()。</p>
+<pre><code class="lang-lua">set_defaultplat("iphoneos")
+set_defaultarch("arm64")
+</code></pre>
+<p>它等价于,<code>xmake f -p iphoneos -a arm64</code>。</p>
+<p>我们也可以设置多个平台下的默认架构。</p>
+<pre><code class="lang-lua">set_defaultarch("iphoneos|arm64", "windows|x64")
+</code></pre>
+<p>在 iphoneos 上默认编译 arm64 架构,在 windows 上默认编译 x64 架构。</p>
+<h3 id="set_defaultmode">set_defaultmode</h3>
+<h4 id="">设置默认的编译模式</h4>
+<p>v2.5.6 以上版本才支持,用于设置工程默认的编译模式,如果没有设置,默认是 release 模式编译。</p>
+<pre><code class="lang-lua">set_defaultmode("releasedbg")
+</code></pre>
+<p>它等价于,<code>xmake f -m releasedbg</code>。</p>
+<h3 id="set_allowedplats">set_allowedplats</h3>
+<h4 id="">设置允许编译的平台列表</h4>
+<p>v2.5.6 以上版本才支持,用于设置工程支持的编译平台列表,如果用户指定了其他平台,会提示错误,这通常用于限制用户指定错误的无效平台。</p>
+<p>如果没有设置,那么没有任何平台限制。</p>
+<pre><code class="lang-lua">set_allowedplats("windows", "mingw")
+</code></pre>
+<p>设置当前项目仅仅支持 windows 和 mingw 平台。</p>
+<h3 id="set_allowedarchs">set_allowedarchs</h3>
+<h4 id="">设置允许编译的平台架构</h4>
+<p>v2.5.6 以上版本才支持,用于设置工程支持的编译架构列表,如果用户指定了其他架构,会提示错误,这通常用于限制用户指定错误的无效架构。</p>
+<p>如果没有设置,那么没有任何架构限制。</p>
+<pre><code class="lang-lua">set_allowedarchs("x64", "x86")
+</code></pre>
+<p>当前项目,仅仅支持 x64/x86 平台。</p>
+<p>我们也可以同时指定多个平台下允许的架构列表。</p>
+<pre><code class="lang-lua">set_allowedarchs("windows|x64", "iphoneos|arm64")
+</code></pre>
+<p>设置当前项目在 windows 上仅仅支持 x64 架构,并且在 iphoneos 上仅仅支持 arm64 架构。</p>
+<h3 id="set_allowedmodes">set_allowedmodes</h3>
+<h4 id="">设置允许的编译模式列表</h4>
+<p>v2.5.6 以上版本才支持,用于设置工程支持的编译模式列表,如果用户指定了其他模式,会提示错误,这通常用于限制用户指定错误的无效模式。</p>
+<p>如果没有设置,那么没有任何模式限制。</p>
+<pre><code class="lang-lua">set_allowedmodes("release", "releasedbg")
+</code></pre>
+<p>设置当前项目仅仅支持 release/releasedbg 两个编译模式。</p>
 </article>
 </body>
 </html>

+ 77 - 77
sitemap.xml

@@ -12,387 +12,387 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2021-07-01T09:53:10+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/other_features.html</loc>
-  <lastmod>2021-07-01T09:53:10+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2021-07-01T09:53:11+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2021-07-01T09:53:11+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2021-07-01T09:53:11+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2021-07-01T09:53:11+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2021-07-01T09:53:11+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2021-07-01T09:53:11+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2021-07-01T09:53:11+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2021-07-01T09:53:12+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2021-07-01T09:53:12+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2021-07-01T09:53:12+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2021-07-01T09:53:12+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2021-07-01T09:53:12+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2021-07-01T09:53:12+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/who_is_using_xmake.html</loc>
-  <lastmod>2021-07-01T09:53:13+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2021-07-01T09:53:13+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2021-07-01T09:53:13+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/other_features.html</loc>
-  <lastmod>2021-07-01T09:53:13+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2021-07-01T09:53:13+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2021-07-01T09:53:13+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2021-07-01T09:53:14+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2021-07-01T09:53:14+08:00</lastmod>
+  <lastmod>2021-07-26T15:48:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2021-07-01T09:53:14+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2021-07-01T09:53:14+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2021-07-01T09:53:14+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2021-07-01T09:53:14+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2021-07-01T09:53:14+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2021-07-01T09:53:15+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2021-07-01T09:53:15+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2021-07-01T09:53:15+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/peripheral_items.html</loc>
-  <lastmod>2021-07-01T09:53:15+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2021-07-01T09:53:15+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/who_is_using_xmake.html</loc>
-  <lastmod>2021-07-01T09:53:15+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2021-07-01T09:53:16+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2021-07-01T09:53:16+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2021-07-01T09:53:16+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2021-07-01T09:53:16+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2021-07-01T09:53:16+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2021-07-01T09:53:16+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2021-07-01T09:53:16+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2021-07-01T09:53:17+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2021-07-01T09:53:17+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2021-07-01T09:53:17+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2021-07-01T09:53:17+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2021-07-01T09:53:17+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2021-07-01T09:53:17+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2021-07-01T09:53:18+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:04+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2021-07-01T09:53:18+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:04+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2021-07-01T09:53:18+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:04+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2021-07-01T09:53:18+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:04+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2021-07-01T09:53:18+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:04+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package_old.html</loc>
-  <lastmod>2021-07-01T09:53:18+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:04+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2021-07-01T09:53:19+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2021-07-01T09:53:19+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2021-07-01T09:53:19+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2021-07-01T09:53:19+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2021-07-01T09:53:19+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2021-07-01T09:53:19+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2021-07-01T09:53:19+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2021-07-01T09:53:20+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2021-07-01T09:53:20+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_interface.html</loc>
-  <lastmod>2021-07-01T09:53:20+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2021-07-01T09:53:20+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2021-07-01T09:53:20+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2021-07-01T09:53:20+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2021-07-01T09:53:21+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2021-07-01T09:53:21+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2021-07-01T09:53:21+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2021-07-01T09:53:21+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2021-07-01T09:53:21+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2021-07-01T09:53:21+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2021-07-01T09:53:21+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package_old.html</loc>
-  <lastmod>2021-07-01T09:53:22+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2021-07-01T09:53:22+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2021-07-01T09:53:22+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2021-07-01T09:53:22+08:00</lastmod>
+  <lastmod>2021-07-26T15:49:09+08:00</lastmod>
 </url>
 
 </urlset>

+ 1 - 1
zh-cn/_coverpage.md

@@ -1,6 +1,6 @@
 <img src="/assets/img/logo.svg" width="16%" />
 
-# xmake <small>2.5.5</small>
+# xmake <small>2.5.6</small>
 
 > 一个基于Lua的轻量级跨平台自动构建工具
 

+ 18 - 0
zh-cn/about/changelog.md

@@ -1,3 +1,21 @@
+## v2.5.6
+
+### 新特性
+
+* [#1483](https://github.com/xmake-io/xmake/issues/1483): 添加 `os.joinenvs()` 和改进包工具环境
+* [#1523](https://github.com/xmake-io/xmake/issues/1523): 添加 `set_allowedmodes`, `set_allowedplats` 和 `set_allowedarchs`
+* [#1523](https://github.com/xmake-io/xmake/issues/1523): 添加 `set_defaultmode`, `set_defaultplat` 和 `set_defaultarch`
+
+### 改进
+
+* 改进 vs/vsxmake 工程插件支持 vs2022
+* [#1513](https://github.com/xmake-io/xmake/issues/1513): 改进 windows 预编译包的兼容性问题
+* 改进 vcpkg 包在 windows 上的查找
+* 改进对 Qt6 的支持
+
+### Bugs 修复
+
+* [#489](https://github.com/xmake-io/xmake-repo/pull/489): 修复 run os.execv 带有过长环境变量值出现的一些问题
 
 ## v2.5.5
 

+ 98 - 44
zh-cn/manual/global_interfaces.md

@@ -1,21 +1,6 @@
 
 全局接口影响整个工程描述,被调用后,后面被包含进来的所有子`xmake.lua`都会受影响。
 
-| 接口                                  | 描述                          | 支持版本 |
-| ------------------------------------- | ----------------------------- | -------- |
-| [includes](#includes)                 | 添加子工程文件和目录          | >= 2.1.5 |
-| [set_project](#set_project)           | 设置工程名                    | >= 2.0.1 |
-| [set_version](#set_version)           | 设置工程版本                  | >= 2.0.1 |
-| [set_xmakever](#set_xmakever)         | 设置最小xmake版本             | >= 2.1.1 |
-| [add_moduledirs](#add_moduledirs)     | 添加模块目录                  | >= 2.1.5 |
-| [add_plugindirs](#add_plugindirs)     | 添加插件目录                  | >= 2.0.1 |
-| [add_packagedirs](#add_packagedirs)   | 添加包目录                    | >= 2.0.1 |
-| [get_config](#get_config)             | 获取给的配置值                | >= 2.2.2 |
-| [set_config](#set_config)             | 设置默认的配置值              | >= 2.2.2 |
-| [add_requires](#add_requires)         | 添加需要的依赖包              | >= 2.2.2 |
-| [add_requireconfs](#add_requireconfs) | 设置指定依赖包的配置          | >= 2.5.1 |
-| [add_repositories](#add_repositories) | 添加依赖包仓库                | >= 2.2.2 |
-
 ### includes
 
 #### 添加子工程文件和目录
@@ -59,6 +44,8 @@ target("test")
     add_files("src/*.c")
 ```
 
+#### 内置的辅助接口
+
 另外,此接口在2.2.5之后的版本,提供了一些内置的辅助函数,可以直接includes后使用,具体有哪些内置函数可以看下:https://github.com/xmake-io/xmake/tree/master/xmake/includes
 
 关于这块的更加完整的说明,可以看下:[https://github.com/xmake-io/xmake/issues/342](https://github.com/xmake-io/xmake/issues/342)
@@ -198,35 +185,6 @@ add_plugindirs("$(projectdir)/plugins")
 
 这样,xmake在编译此工程的时候,也就加载这些插件。
 
-### add_packagedirs
-
-#### 添加包目录
-
-通过设置依赖包目录,可以方便的集成一些第三方的依赖库,以tbox工程为例,其依赖包如下:
-
-```
-- base.pkg
-- zlib.pkg
-- polarssl.pkg
-- openssl.pkg
-- mysql.pkg
-- pcre.pkg
-- ...
-```
-
-如果要让当前工程识别加载这些包,首先要指定包目录路径,例如:
-
-```lua
-add_packagedirs("packages")
-```
-
-指定好后,就可以在target作用域中,通过[add_packages](#add_packages)接口,来添加集成包依赖了,例如:
-
-```lua
-target("tbox")
-    add_packages("zlib", "polarssl", "pcre", "mysql")
-```
-
 ### get_config
 
 #### 获取给定的配置值
@@ -617,3 +575,99 @@ add_repositories("my-repo myrepo")
 
 这个可以参考[benchbox](https://github.com/tboox/benchbox)项目,里面就内置了一个私有仓库。
 
+### set_defaultplat
+
+#### 设置默认的编译平台
+
+v2.5.6 以上版本才支持,用于设置工程默认的编译平台,如果没有设置,默认平台跟随当前系统平台,也就是 os.host()。
+
+比如,在 macOS 上默认编译平台是 macosx,如果当前项目是 ios 项目,那么可以设置默认编译平台为 iphoneos。
+
+```lua
+set_defaultplat("iphoneos")
+```
+
+它等价于,`xmake f -p iphoneos`。
+
+### set_defaultarch
+
+#### 设置默认的编译架构
+
+v2.5.6 以上版本才支持,用于设置工程默认的编译架构,如果没有设置,默认平台跟随当前系统架构,也就是 os.arch()。
+
+```lua
+set_defaultplat("iphoneos")
+set_defaultarch("arm64")
+```
+
+它等价于,`xmake f -p iphoneos -a arm64`。
+
+我们也可以设置多个平台下的默认架构。
+
+```lua
+set_defaultarch("iphoneos|arm64", "windows|x64")
+```
+
+在 iphoneos 上默认编译 arm64 架构,在 windows 上默认编译 x64 架构。
+
+### set_defaultmode
+
+#### 设置默认的编译模式
+
+v2.5.6 以上版本才支持,用于设置工程默认的编译模式,如果没有设置,默认是 release 模式编译。
+
+```lua
+set_defaultmode("releasedbg")
+```
+
+它等价于,`xmake f -m releasedbg`。
+
+### set_allowedplats
+
+#### 设置允许编译的平台列表
+
+v2.5.6 以上版本才支持,用于设置工程支持的编译平台列表,如果用户指定了其他平台,会提示错误,这通常用于限制用户指定错误的无效平台。
+
+如果没有设置,那么没有任何平台限制。
+
+```lua
+set_allowedplats("windows", "mingw")
+```
+
+设置当前项目仅仅支持 windows 和 mingw 平台。
+
+### set_allowedarchs
+
+#### 设置允许编译的平台架构
+
+v2.5.6 以上版本才支持,用于设置工程支持的编译架构列表,如果用户指定了其他架构,会提示错误,这通常用于限制用户指定错误的无效架构。
+
+如果没有设置,那么没有任何架构限制。
+
+```lua
+set_allowedarchs("x64", "x86")
+```
+
+当前项目,仅仅支持 x64/x86 平台。
+
+我们也可以同时指定多个平台下允许的架构列表。
+
+```lua
+set_allowedarchs("windows|x64", "iphoneos|arm64")
+```
+
+设置当前项目在 windows 上仅仅支持 x64 架构,并且在 iphoneos 上仅仅支持 arm64 架构。
+
+### set_allowedmodes
+
+#### 设置允许的编译模式列表
+
+v2.5.6 以上版本才支持,用于设置工程支持的编译模式列表,如果用户指定了其他模式,会提示错误,这通常用于限制用户指定错误的无效模式。
+
+如果没有设置,那么没有任何模式限制。
+
+```lua
+set_allowedmodes("release", "releasedbg")
+```
+
+设置当前项目仅仅支持 release/releasedbg 两个编译模式。