ruki 5 роки тому
батько
коміт
abb5fa2858

+ 32 - 0
manual/conditions.md

@@ -110,6 +110,38 @@ Support hosts:
 
 We can also get it from [$(host)](/manual/builtin_variables?id=varhost) or [os.host](/manual/builtin_modules?id=oshost).
 
+### is_subhost
+
+#### Determine the subsystem environment of the current host
+
+At present, it is mainly used for detection of cygwin, msys2 and other subsystem environments on windows systems. If you run xmake in the msys2 shell environment, then `is_subhost("windows")` will return false, and `is_host("windows")` It will still return true.
+
+Currently supported subsystems:
+
+* msys
+* cygwin
+
+Configuration example:
+
+```lua
+if is_subhost("msys", "cygwin") then
+    - Currently in the shell environment of msys2/cygwin
+end
+```
+
+We can also quickly check the current subsystem platform by executing `xmake l os.subhost`.
+
+!> It may also support other subsystem environments under linux and macos systems later, if they exist.
+
+### is_subarch
+
+#### Determine the architecture of the current host subsystem environment
+
+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.
+In the msys/cygwin subsystem environment, the compiler architecture defaults to x86_64/i386, which is different.
+
+We can also quickly view the current subsystem architecture by executing `xmake l os.subarch`.
+
 ### is_mode
 
 #### Is the current compilation mode

+ 19 - 0
mirror/manual/conditions.html

@@ -224,6 +224,25 @@ end
 <li>macosx</li>
 </ul>
 <p>We can also get it from <a href="/mirror/manual/builtin_variables.html#varhost">$(host)</a> or <a href="/mirror/manual/builtin_modules.html#oshost">os.host</a>.</p>
+<h3 id="is_subhost">is_subhost</h3>
+<h4 id="determinethesubsystemenvironmentofthecurrenthost">Determine the subsystem environment of the current host</h4>
+<p>At present, it is mainly used for detection of cygwin, msys2 and other subsystem environments on windows systems. If you run xmake in the msys2 shell environment, then <code>is_subhost("windows")</code> will return false, and <code>is_host("windows")</code> It will still return true.</p>
+<p>Currently supported subsystems:</p>
+<ul>
+<li>msys</li>
+<li>cygwin</li>
+</ul>
+<p>Configuration example:</p>
+<pre><code class="lang-lua">if is_subhost("msys", "cygwin") then
+    - Currently in the shell environment of msys2/cygwin
+end
+</code></pre>
+<p>We can also quickly check the current subsystem platform by executing <code>xmake l os.subhost</code>.</p>
+<p>!> It may also support other subsystem environments under linux and macos systems later, if they exist.</p>
+<h3 id="is_subarch">is_subarch</h3>
+<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_mode">is_mode</h3>
 <h4 id="isthecurrentcompilationmode">Is the current compilation mode</h4>
 <p>You can this api to check the configuration command: <code>xmake f -m debug</code></p>

+ 19 - 0
mirror/zh-cn/manual/conditions.html

@@ -232,6 +232,25 @@ end
 <li>macosx</li>
 </ul>
 <p>你也可以通过<a href="/mirror/zh-cn/manual/builtin_variables.html#varhost">$(host)</a>内置变量或者<a href="/mirror/zh-cn/manual/builtin_modules.html#oshost">os.host</a>接口,来进行获取</p>
+<h3 id="is_subhost">is_subhost</h3>
+<h4 id="">判断当前主机的子系统环境</h4>
+<p>目前主要用于 windows 系统上 cygwin, msys2 等子系统环境的探测,如果在 msys2 shell 环境下运行 xmake,那么 <code>is_subhost("windows")</code> 想将会返回 false,而 <code>is_host("windows")</code> 依旧会返回 true。</p>
+<p>目前支持的子系统:</p>
+<ul>
+<li>msys</li>
+<li>cygwin</li>
+</ul>
+<p>配置例子:</p>
+<pre><code class="lang-lua">if is_subhost("msys", "cygwin") then
+    -- 当前在 msys2/cygwin 的 shell 环境下
+end
+</code></pre>
+<p>我们也可以通过执行 <code>xmake l os.subhost</code> 来快速查看当前的子系统平台。</p>
+<p>!> 后期也有可能会支持 linux 和 macos 系统下的其他子系统环境,如果存在话。</p>
+<h3 id="is_subarch">is_subarch</h3>
+<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_mode">is_mode</h3>
 <h4 id="">判断当前编译模式</h4>
 <p>用于检测编译配置:<code>xmake f -m debug</code></p>

+ 74 - 74
sitemap.xml

@@ -12,372 +12,372 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2020-09-14T20:06:38+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/other_features.html</loc>
-  <lastmod>2020-09-14T20:06:39+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2020-09-14T20:06:39+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2020-09-14T20:06:39+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2020-09-14T20:06:39+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2020-09-14T20:06:39+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2020-09-14T20:06:39+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2020-09-14T20:06:40+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2020-09-14T20:06:40+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2020-09-14T20:06:40+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/zh/plugins.html</loc>
-  <lastmod>2020-09-14T20:06:40+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/zh/manual.html</loc>
-  <lastmod>2020-09-14T20:06:40+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/plugins.html</loc>
-  <lastmod>2020-09-14T20:06:41+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/manual.html</loc>
-  <lastmod>2020-09-14T20:06:41+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2020-09-14T20:06:41+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2020-09-14T20:06:41+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2020-09-14T20:06:41+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2020-09-14T20:06:42+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2020-09-14T20:06:42+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2020-09-14T20:06:42+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2020-09-14T20:06:42+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2020-09-14T20:06:42+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/other_features.html</loc>
-  <lastmod>2020-09-14T20:06:42+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2020-09-14T20:06:43+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2020-09-14T20:06:43+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2020-09-14T20:06:43+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2020-09-14T20:06:43+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2020-09-14T20:06:43+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2020-09-14T20:06:43+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2020-09-14T20:06:44+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2020-09-14T20:06:44+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2020-09-14T20:06:44+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2020-09-14T20:06:44+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2020-09-14T20:06:44+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2020-09-14T20:06:44+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2020-09-14T20:06:45+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2020-09-14T20:06:45+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2020-09-14T20:06:45+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2020-09-14T20:06:45+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2020-09-14T20:06:45+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2020-09-14T20:06:45+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2020-09-14T20:06:46+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2020-09-14T20:06:46+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2020-09-14T20:06:46+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2020-09-14T20:06:46+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2020-09-14T20:06:46+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2020-09-14T20:06:47+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2020-09-14T20:06:47+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2020-09-14T20:06:47+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2020-09-14T20:06:47+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2020-09-14T20:06:47+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2020-09-14T20:06:47+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2020-09-14T20:06:48+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2020-09-14T20:06:48+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2020-09-14T20:06:48+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2020-09-14T20:06:48+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2020-09-14T20:06:48+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2020-09-14T20:06:48+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2020-09-14T20:06:49+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2020-09-14T20:06:49+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2020-09-14T20:06:49+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2020-09-14T20:06:49+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2020-09-14T20:06:49+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2020-09-14T20:06:49+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2020-09-14T20:06:50+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2020-09-14T20:06:50+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2020-09-14T20:06:50+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2020-09-14T20:06:50+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2020-09-14T20:06:50+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2020-09-14T20:06:51+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2020-09-14T20:06:51+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2020-09-14T20:06:51+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2020-09-14T20:06:51+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2020-09-14T20:06:51+08:00</lastmod>
+  <lastmod>2020-09-14T20:44:51+08:00</lastmod>
 </url>
 
 </urlset>

+ 32 - 0
zh-cn/manual/conditions.md

@@ -123,6 +123,38 @@ end
 
 你也可以通过[$(host)](/zh-cn/manual/builtin_variables?id=varhost)内置变量或者[os.host](/zh-cn/manual/builtin_modules?id=oshost)接口,来进行获取
 
+### is_subhost
+
+#### 判断当前主机的子系统环境
+
+目前主要用于 windows 系统上 cygwin, msys2 等子系统环境的探测,如果在 msys2 shell 环境下运行 xmake,那么 `is_subhost("windows")` 想将会返回 false,而 `is_host("windows")` 依旧会返回 true。
+
+目前支持的子系统:
+
+* msys
+* cygwin
+
+配置例子:
+
+```lua
+if is_subhost("msys", "cygwin") then
+    -- 当前在 msys2/cygwin 的 shell 环境下
+end
+```
+
+我们也可以通过执行 `xmake l os.subhost` 来快速查看当前的子系统平台。
+
+!> 后期也有可能会支持 linux 和 macos 系统下的其他子系统环境,如果存在话。
+
+### is_subarch
+
+#### 判断当前主机子系统环境下的架构
+
+目前主要用于 windows 系统上 cygwin, msys2 等子系统环境下架构的探测,通常在 windows 编译平台采用 msvc 工具链,那边编译架构时 x64,x86。
+而在 msys/cygwin 子系统环境下,编译架构默认为 x86_64/i386,是有差异的。
+
+我们也可以通过执行 `xmake l os.subarch` 来快速查看当前的子系统架构。
+
 ### is_mode
 
 #### 判断当前编译模式