Browse Source

update docs

ruki 4 years ago
parent
commit
6aadf37ecb

+ 40 - 56
manual/configuration_option.md

@@ -1,10 +1,8 @@
 
 Define and set option switches. Each `option` corresponds to an option that can be used to customize the build configuration options and switch settings.
 
-<p class="tip">
-All domain interfaces except `target`, such as `option`, `task`, etc., cannot be placed in the outer global scope by default (unless some interfaces are shared with the target).
+!> All domain interfaces except `target`, such as `option`, `task`, etc., cannot be placed in the outer global scope by default (unless some interfaces are shared with the target).
 If you want to set the value to affect all options such as `option`, `task`, you can set it by anonymous global domain.
-</p>
 
 E.g:
 
@@ -21,59 +19,7 @@ option("test2")
     -- ...
 ```
 
-<p class="tip">
-The `option` field can be repeatedly entered to implement separate settings. If you want to display the scope settings away from the current option, you can manually call the [option_end](#option_end) interface.
-</p>
-
-
-| Interface                                             | Description                                       | Supported Versions |
-| ----------------------------------------------------- | --------------------------------------------      | --------           |
-| [option](#option)                                     | Define Options                                    | >= 2.0.1           |
-| [option_end](#option_end)                             | End Definition Options                            | >= 2.1.1           |
-| [add_deps](#optionadd_deps)                           | Add Options Dependencies                          | >= 2.1.5           |
-| [before_check](#optionbefore_check)                   | Execute this script before option detection       | >= 2.1.5           |
-| [on_check](#optionon_check)                           | Custom Option Detection Script                    | >= 2.1.5           |
-| [after_check](#optionafter_check)                     | Execute this script after option detection        | >= 2.1.5           |
-| [set_values](#optionset_values)                       | Setting the list of option values ​​    | >= 2.1.9           |
-| [set_default](#optionset_default)                     | Set Defaults                                      | >= 2.0.1           |
-| [set_showmenu](#optionset_showmenu)                   | Set whether to enable menu display                | >= 1.0.1           |
-| [set_category](#optionset_category)                   | Set option categories, only for menu display      | >= 1.0.1           |
-| [set_description](#optionset_description)             | Settings Menu Display Description                 | >= 1.0.1           |
-| [add_links](#optionadd_links)                         | Add Linked Library Detection                      | >= 1.0.1           |
-| [add_linkdirs](#optionadd_linkdirs)                   | Add a search directory for link library detection | >= 1.0.1           |
-| [add_rpathdirs](#optionadd_rpathdirs)                 | Add runtime dynamic link library search directory | >= 2.1.3           |
-| [add_cincludes](#optionadd_cincludes)                 | Add c header file detection                       | >= 1.0.1           |
-| [add_cxxincludes](#optionadd_cxxincludes)             | Add c++ header file detection                     | >= 1.0.1           |
-| [add_ctypes](#optionadd_ctypes)                       | Add c type detection                              | >= 1.0.1           |
-| [add_cxxtypes](#optionadd_cxxtypes)                   | Add c++ type detection                            | >= 1.0.1           |
-| [add_csnippets](#optionadd_csnippets)                   | Add c-code snippets detection                     | >= 2.1.5           |
-| [add_cxxsnippets](#optionadd_cxxsnippets)               | Add c++ code snippet detection                    | >= 2.1.5           |
-| [set_warnings](/manual/project_target?id=targetset_warnings)                   | Setting the warning level                         | >= 1.0.1           |
-| [set_optimize](/manual/project_target?id=targetset_optimize)                   | Setting the optimization level                    | >= 1.0.1           |
-| [set_languages](/manual/project_target?id=targetset_languages)                 | Setting the Code Language Standard                | >= 1.0.1           |
-| [add_includedirs](/manual/project_target?id=targetadd_includedirs)             | Add Header Search Directory                       | >= 1.0.1           |
-| [add_defines](/manual/project_target?id=targetadd_defines)                     | Add Macro Definition                              | >= 1.0.1           |
-| [add_undefines](/manual/project_target?id=targetadd_undefines)                 | Cancel Macro Definition                           | >= 1.0.1           |
-| [add_cflags](/manual/project_target?id=targetadd_cflags)                       | Add c Compile Options                             | >= 1.0.1           |
-| [add_cxflags](/manual/project_target?id=targetadd_cxflags)                     | Add c/c++ Compile Options                         | >= 1.0.1           |
-| [add_cxxflags](/manual/project_target?id=targetadd_cxxflags)                   | Add c++ Compile Options                           | >= 1.0.1           |
-| [add_mflags](/manual/project_target?id=targetadd_mflags)                       | Add objc compile options                          | >= 2.0.1           |
-| [add_mxflags](/manual/project_target?id=targetadd_mxflags)                     | Add objc/objc++ Compile Options                   | >= 2.0.1           |
-| [add_mxxflags](/manual/project_target?id=targetadd_mxxflags)                   | Add objc++ Compile Options                        | >= 2.0.1           |
-| [add_scflags](/manual/project_target?id=targetadd_scflags)                     | Add swift compile options                         | >= 2.1.1           |
-| [add_asflags](/manual/project_target?id=targetadd_asflags)                     | Add assembly compile options                      | >= 2.1.1           |
-| [add_gcflags](/manual/project_target?id=targetadd_gcflags)                     | Add go compile options                            | >= 2.1.1           |
-| [add_dcflags](/manual/project_target?id=targetadd_dcflags)                     | Add dlang compile options                         | >= 2.1.1           |
-| [add_rcflags](/manual/project_target?id=targetadd_rcflags)                     | Add rust compile option                           | >= 2.1.1           |
-| [add_cuflags](/manual/project_target?id=targetadd_cuflags)                     | Add cuda compile options                          | >= 2.2.1           |
-| [add_culdflags](/manual/project_target?id=targetadd_culdflags)                 | Add cuda device-link options                      | >= 2.2.7           |
-| [add_ldflags](/manual/project_target?id=targetadd_ldflags)                     | Add Link Options                                  | >= 2.1.1           |
-| [add_arflags](/manual/project_target?id=targetadd_arflags)                     | Add Static Library Archive Options                | >= 2.1.1           |
-| [add_shflags](/manual/project_target?id=targetadd_shflags)                     | Add Dynamic Library Link Options                  | >= 2.0.1           |
-| [add_languages](/manual/project_target?id=targetadd_languages)                 | Add Language Standards                            | >= 2.0.1           |
-| [add_vectorexts](/manual/project_target?id=targetadd_vectorexts)               | Add Vector Extension Instructions                 | >= 2.0.1           |
-| [add_frameworks](/manual/project_target?id=targetadd_frameworks)               | Add Linked Framework                              | >= 2.1.1           |
-| [add_frameworkdirs](/manual/project_target?id=targetadd_frameworkdirs)         | Add Linked Framework                              | >= 2.1.5           |
+!> The `option` field can be repeatedly entered to implement separate settings. If you want to display the scope settings away from the current option, you can manually call the [option_end](#option_end) interface.
 
 ### option
 
@@ -604,3 +550,41 @@ if is_config("test", "8") tben
 end
 ```
 
+### option:add_cfuncs
+
+#### Add c library function detection
+
+```lua
+option("setjmp")
+    set_default(false)
+    add_cincludes("setjmp.h")
+    add_cfuncs("sigsetjmp", "setjmp")
+    add_defines("HAVE_SETJMP")
+
+target("test")
+    add_options("setjmp")
+```
+
+This option detects whether there are some interfaces of `setjmp`. If the test passes, the target program of `test` will add the macro definition of `HAVE_SETJMP`.
+
+The function fragments inside support the following syntax formats:
+
+```lua
+-- Simply detect whether the function address exists, and internally will try to determine its address
+sigsetjmp
+
+-- If some functions are defined by macro wrap, the detection can be bypassed in this way
+sigsetjmp((void*)0, 0)
+
+-- You can also specify a complete function statement, for example: funcname{codebody}
+sigsetjmp{sigsetjmp((void*)0, 0);}
+sigsetjmp{int a = 0; sigsetjmp((void*)a, a);}
+```
+
+Note that the detected function usually needs to be accompanied by `add_cincludes` to ensure that the function can be included normally, otherwise the detection will fail.
+
+### option:add_cxxfuncs
+
+#### Add c++ library function detection
+
+The usage is consistent with [option:add_cfuncs](#optionadd_cxxfuncs).

+ 29 - 248
mirror/manual/configuration_option.html

@@ -91,9 +91,7 @@
 }
 </style>
     <p>Define and set option switches. Each <code>option</code> corresponds to an option that can be used to customize the build configuration options and switch settings.</p>
-<p><p class="tip"><br>All domain interfaces except <code>target</code>, such as <code>option</code>, <code>task</code>, etc., cannot be placed in the outer global scope by default (unless some interfaces are shared with the target).<br>If you want to set the value to affect all options such as <code>option</code>, <code>task</code>, you can set it by anonymous global domain.<br></p>
-
-</p>
+<p>!> All domain interfaces except <code>target</code>, such as <code>option</code>, <code>task</code>, etc., cannot be placed in the outer global scope by default (unless some interfaces are shared with the target).<br>If you want to set the value to affect all options such as <code>option</code>, <code>task</code>, you can set it by anonymous global domain.</p>
 <p>E.g:</p>
 <pre><code class="lang-lua">-- Enter the anonymous global domain of the option, the settings inside will affect the test and test2 options.
 option()
@@ -106,251 +104,7 @@ option("test")
 option("test2")
     -- ...
 </code></pre>
-<p><p class="tip"><br>The <code>option</code> field can be repeatedly entered to implement separate settings. If you want to display the scope settings away from the current option, you can manually call the <a href="#option_end">option_end</a> interface.<br></p>
-
-
-</p>
-<table>
-<thead>
-<tr>
-<th>Interface</th>
-<th>Description</th>
-<th>Supported Versions</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="#option">option</a></td>
-<td>Define Options</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#option_end">option_end</a></td>
-<td>End Definition Options</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_deps">add_deps</a></td>
-<td>Add Options Dependencies</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionbefore_check">before_check</a></td>
-<td>Execute this script before option detection</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionon_check">on_check</a></td>
-<td>Custom Option Detection Script</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionafter_check">after_check</a></td>
-<td>Execute this script after option detection</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionset_values">set_values</a></td>
-<td>Setting the list of option values ​​</td>
-<td>>= 2.1.9</td>
-</tr>
-<tr>
-<td><a href="#optionset_default">set_default</a></td>
-<td>Set Defaults</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionset_showmenu">set_showmenu</a></td>
-<td>Set whether to enable menu display</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionset_category">set_category</a></td>
-<td>Set option categories, only for menu display</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionset_description">set_description</a></td>
-<td>Settings Menu Display Description</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_links">add_links</a></td>
-<td>Add Linked Library Detection</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_linkdirs">add_linkdirs</a></td>
-<td>Add a search directory for link library detection</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_rpathdirs">add_rpathdirs</a></td>
-<td>Add runtime dynamic link library search directory</td>
-<td>>= 2.1.3</td>
-</tr>
-<tr>
-<td><a href="#optionadd_cincludes">add_cincludes</a></td>
-<td>Add c header file detection</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_cxxincludes">add_cxxincludes</a></td>
-<td>Add c++ header file detection</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_ctypes">add_ctypes</a></td>
-<td>Add c type detection</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_cxxtypes">add_cxxtypes</a></td>
-<td>Add c++ type detection</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_csnippets">add_csnippets</a></td>
-<td>Add c-code snippets detection</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionadd_cxxsnippets">add_cxxsnippets</a></td>
-<td>Add c++ code snippet detection</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetset_warnings">set_warnings</a></td>
-<td>Setting the warning level</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetset_optimize">set_optimize</a></td>
-<td>Setting the optimization level</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetset_languages">set_languages</a></td>
-<td>Setting the Code Language Standard</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_includedirs">add_includedirs</a></td>
-<td>Add Header Search Directory</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_defines">add_defines</a></td>
-<td>Add Macro Definition</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_undefines">add_undefines</a></td>
-<td>Cancel Macro Definition</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_cflags">add_cflags</a></td>
-<td>Add c Compile Options</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_cxflags">add_cxflags</a></td>
-<td>Add c/c++ Compile Options</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_cxxflags">add_cxxflags</a></td>
-<td>Add c++ Compile Options</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_mflags">add_mflags</a></td>
-<td>Add objc compile options</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_mxflags">add_mxflags</a></td>
-<td>Add objc/objc++ Compile Options</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_mxxflags">add_mxxflags</a></td>
-<td>Add objc++ Compile Options</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_scflags">add_scflags</a></td>
-<td>Add swift compile options</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_asflags">add_asflags</a></td>
-<td>Add assembly compile options</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_gcflags">add_gcflags</a></td>
-<td>Add go compile options</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_dcflags">add_dcflags</a></td>
-<td>Add dlang compile options</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_rcflags">add_rcflags</a></td>
-<td>Add rust compile option</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_cuflags">add_cuflags</a></td>
-<td>Add cuda compile options</td>
-<td>>= 2.2.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_culdflags">add_culdflags</a></td>
-<td>Add cuda device-link options</td>
-<td>>= 2.2.7</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_ldflags">add_ldflags</a></td>
-<td>Add Link Options</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_arflags">add_arflags</a></td>
-<td>Add Static Library Archive Options</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_shflags">add_shflags</a></td>
-<td>Add Dynamic Library Link Options</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_languages">add_languages</a></td>
-<td>Add Language Standards</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_vectorexts">add_vectorexts</a></td>
-<td>Add Vector Extension Instructions</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_frameworks">add_frameworks</a></td>
-<td>Add Linked Framework</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/manual/project_target.html#targetadd_frameworkdirs">add_frameworkdirs</a></td>
-<td>Add Linked Framework</td>
-<td>>= 2.1.5</td>
-</tr>
-</tbody>
-</table>
+<p>!> The <code>option</code> field can be repeatedly entered to implement separate settings. If you want to display the scope settings away from the current option, you can manually call the <a href="#option_end">option_end</a> interface.</p>
 <h3 id="option">option</h3>
 <h4 id="definingoptions">Defining options</h4>
 <p>Define and set option switches for custom compilation configuration options, switch settings.</p>
@@ -737,6 +491,33 @@ target("test")
      - xxx
 end
 </code></pre>
+<h3 id="optionadd_cfuncs">option:add_cfuncs</h3>
+<h4 id="addclibraryfunctiondetection">Add c library function detection</h4>
+<pre><code class="lang-lua">option("setjmp")
+    set_default(false)
+    add_cincludes("setjmp.h")
+    add_cfuncs("sigsetjmp", "setjmp")
+    add_defines("HAVE_SETJMP")
+
+target("test")
+    add_options("setjmp")
+</code></pre>
+<p>This option detects whether there are some interfaces of <code>setjmp</code>. If the test passes, the target program of <code>test</code> will add the macro definition of <code>HAVE_SETJMP</code>.</p>
+<p>The function fragments inside support the following syntax formats:</p>
+<pre><code class="lang-lua">-- Simply detect whether the function address exists, and internally will try to determine its address
+sigsetjmp
+
+-- If some functions are defined by macro wrap, the detection can be bypassed in this way
+sigsetjmp((void*)0, 0)
+
+-- You can also specify a complete function statement, for example: funcname{codebody}
+sigsetjmp{sigsetjmp((void*)0, 0);}
+sigsetjmp{int a = 0; sigsetjmp((void*)a, a);}
+</code></pre>
+<p>Note that the detected function usually needs to be accompanied by <code>add_cincludes</code> to ensure that the function can be included normally, otherwise the detection will fail.</p>
+<h3 id="optionadd_cxxfuncs">option:add_cxxfuncs</h3>
+<h4 id="addclibraryfunctiondetection">Add c++ library function detection</h4>
+<p>The usage is consistent with <a href="#optionadd_cxxfuncs">option:add_cfuncs</a>.</p>
 </article>
 </body>
 </html>

+ 28 - 245
mirror/zh-cn/manual/configuration_option.html

@@ -106,251 +106,7 @@ option("test")
 option("test2")
     -- ...
 </code></pre>
-<p><p class="tip"><br><code>option</code>域是可以重复进入来实现分离设置的,如果要显示离开当前选项的作用域设置,可以手动调用<a href="#option_end">option_end</a>接口。<br></p>
-
-
-</p>
-<table>
-<thead>
-<tr>
-<th>接口</th>
-<th>描述</th>
-<th>支持版本</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="#option">option</a></td>
-<td>定义选项</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#option_end">option_end</a></td>
-<td>结束定义选项</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_deps">add_deps</a></td>
-<td>添加选项依赖</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionbefore_check">before_check</a></td>
-<td>选项检测之前执行此脚本</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionon_check">on_check</a></td>
-<td>自定义选项检测脚本</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionafter_check">after_check</a></td>
-<td>选项检测之后执行此脚本</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionset_values">set_values</a></td>
-<td>设置选项值列表</td>
-<td>>= 2.1.9</td>
-</tr>
-<tr>
-<td><a href="#optionset_default">set_default</a></td>
-<td>设置默认值</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionset_showmenu">set_showmenu</a></td>
-<td>设置是否启用菜单显示</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionset_category">set_category</a></td>
-<td>设置选项分类,仅用于菜单显示</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionset_description">set_description</a></td>
-<td>设置菜单显示描述</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_links">add_links</a></td>
-<td>添加链接库检测</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_linkdirs">add_linkdirs</a></td>
-<td>添加链接库检测需要的搜索目录</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_rpathdirs">add_rpathdirs</a></td>
-<td>添加运行时候动态链接库搜索目录</td>
-<td>>= 2.1.3</td>
-</tr>
-<tr>
-<td><a href="#optionadd_cincludes">add_cincludes</a></td>
-<td>添加c头文件检测</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_cxxincludes">add_cxxincludes</a></td>
-<td>添加c++头文件检测</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_ctypes">add_ctypes</a></td>
-<td>添加c类型检测</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_cxxtypes">add_cxxtypes</a></td>
-<td>添加c++类型检测</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="#optionadd_csnippets">add_csnippets</a></td>
-<td>添加c代码片段检测</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="#optionadd_cxxsnippets">add_cxxsnippets</a></td>
-<td>添加c++代码片段检测</td>
-<td>>= 2.1.5</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetset_warnings">set_warnings</a></td>
-<td>设置警告级别</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetset_optimize">set_optimize</a></td>
-<td>设置优化级别</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetset_languages">set_languages</a></td>
-<td>设置代码语言标准</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_includedirs">add_includedirs</a></td>
-<td>添加头文件搜索目录</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_defines">add_defines</a></td>
-<td>添加宏定义</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_undefines">add_undefines</a></td>
-<td>取消宏定义</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_cflags">add_cflags</a></td>
-<td>添加c编译选项</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_cxflags">add_cxflags</a></td>
-<td>添加c/c++编译选项</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_cxxflags">add_cxxflags</a></td>
-<td>添加c++编译选项</td>
-<td>>= 1.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_mflags">add_mflags</a></td>
-<td>添加objc编译选项</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_mxflags">add_mxflags</a></td>
-<td>添加objc/objc++编译选项</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_mxxflags">add_mxxflags</a></td>
-<td>添加objc++编译选项</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_scflags">add_scflags</a></td>
-<td>添加swift编译选项</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_asflags">add_asflags</a></td>
-<td>添加汇编编译选项</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_gcflags">add_gcflags</a></td>
-<td>添加go编译选项</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_dcflags">add_dcflags</a></td>
-<td>添加dlang编译选项</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_rcflags">add_rcflags</a></td>
-<td>添加rust编译选项</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_cuflags">add_cuflags</a></td>
-<td>添加cuda编译选项</td>
-<td>>= 2.2.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_culdflags">add_culdflags</a></td>
-<td>添加cuda设备链接选项</td>
-<td>>= 2.2.7</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_ldflags">add_ldflags</a></td>
-<td>添加链接选项</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_arflags">add_arflags</a></td>
-<td>添加静态库归档选项</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_shflags">add_shflags</a></td>
-<td>添加动态库链接选项</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_languages">add_languages</a></td>
-<td>添加语言标准</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_vectorexts">add_vectorexts</a></td>
-<td>添加向量扩展指令</td>
-<td>>= 2.0.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_frameworks">add_frameworks</a></td>
-<td>添加链接框架</td>
-<td>>= 2.1.1</td>
-</tr>
-<tr>
-<td><a href="/mirror/zh-cn/manual/project_target.html#targetadd_frameworkdirs">add_frameworkdirs</a></td>
-<td>添加链接框架</td>
-<td>>= 2.1.5</td>
-</tr>
-</tbody>
-</table>
+<p>!> <code>option</code>域是可以重复进入来实现分离设置的,如果要显示离开当前选项的作用域设置,可以手动调用<a href="#option_end">option_end</a>接口。</p>
 <h3 id="option">option</h3>
 <h4 id="">定义选项</h4>
 <p>定义和设置选项开关,可用于自定义编译配置选项、开关设置。</p>
@@ -700,6 +456,33 @@ target("test")
     -- xxx
 end
 </code></pre>
+<h3 id="optionadd_cfuncs">option:add_cfuncs</h3>
+<h4 id="c">添加c库函数检测</h4>
+<pre><code class="lang-lua">option("setjmp")
+    set_default(false)
+    add_cincludes("setjmp.h")
+    add_cfuncs("sigsetjmp", "setjmp")
+    add_defines("HAVE_SETJMP")
+
+target("test")
+    add_options("setjmp")
+</code></pre>
+<p>此选项检测是否存在<code>setjmp</code>的一些接口,如果检测通过那么<code>test</code> 目标程序将会加上 <code>HAVE_SETJMP</code> 的宏定义。</p>
+<p>里面的函数片段支持下面几种语法格式:</p>
+<pre><code class="lang-lua">-- 单纯检测函数地址是否存在,内部会尝试去它的地址来判断
+sigsetjmp
+
+-- 如果有些函数是宏定义 wrap 的,可以通过这种方式绕通过检测
+sigsetjmp((void*)0, 0)
+
+-- 也可以指定一个完整函数语句,例如:funcname{codebody}
+sigsetjmp{sigsetjmp((void*)0, 0);}
+sigsetjmp{int a = 0; sigsetjmp((void*)a, a);}
+</code></pre>
+<p>注意,检测的函数通常需要附带 <code>add_cincludes</code> 确保函数能够被正常 include 进来,否则检测会失败。</p>
+<h3 id="optionadd_cxxfuncs">option:add_cxxfuncs</h3>
+<h4 id="c">添加c++库函数检测</h4>
+<p>用法跟 <a href="#optionadd_cxxfuncs">option:add_cfuncs</a> 一致。</p>
 </article>
 </body>
 </html>

+ 91 - 91
sitemap.xml

@@ -7,457 +7,457 @@
     
 <url>
   <loc>https://xmake.io</loc>
-  <lastmod>2021-10-09T20:09:31+08:00</lastmod>
+  <lastmod>2021-11-04T21:31:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2021-10-31T20:46:13+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/other_features.html</loc>
-  <lastmod>2021-10-31T20:46:13+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2021-10-31T20:46:13+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2021-10-31T20:46:13+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2021-10-31T20:46:13+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2021-10-31T20:46:14+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2021-10-31T20:46:14+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2021-10-31T20:46:14+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2021-10-31T20:46:14+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2021-10-31T20:46:14+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2021-10-31T20:46:14+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2021-10-31T20:46:15+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2021-10-31T20:46:15+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2021-10-31T20:46:15+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2021-10-31T20:46:15+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/who_is_using_xmake.html</loc>
-  <lastmod>2021-10-31T20:46:15+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2021-10-31T20:46:16+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2021-10-31T20:46:16+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/other_features.html</loc>
-  <lastmod>2021-10-31T20:46:16+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2021-10-31T20:46:16+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2021-10-31T20:46:16+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2021-10-31T20:46:16+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2021-10-31T20:46:17+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2021-10-31T20:46:17+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2021-10-31T20:46:17+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2021-10-31T20:46:17+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2021-10-31T20:46:18+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2021-10-31T20:46:18+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2021-10-31T20:46:18+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2021-10-31T20:46:18+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2021-10-31T20:46:18+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/peripheral_items.html</loc>
-  <lastmod>2021-10-31T20:46:19+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2021-10-31T20:46:19+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/who_is_using_xmake.html</loc>
-  <lastmod>2021-10-31T20:46:19+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2021-10-31T20:46:19+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2021-10-31T20:46:19+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2021-10-31T20:46:20+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2021-10-31T20:46:20+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2021-10-31T20:46:20+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2021-10-31T20:46:20+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2021-10-31T20:46:20+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/target_instance.html</loc>
-  <lastmod>2021-10-31T20:46:21+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2021-10-31T20:46:21+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2021-10-31T20:46:21+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2021-10-31T20:46:21+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2021-10-31T20:46:21+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2021-10-31T20:46:22+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2021-10-31T20:46:22+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2021-10-31T20:46:22+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/helper_interfaces.html</loc>
-  <lastmod>2021-10-31T20:46:22+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2021-10-31T20:46:22+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_instance.html</loc>
-  <lastmod>2021-10-31T20:46:22+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/option_instance.html</loc>
-  <lastmod>2021-10-31T20:46:23+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2021-10-31T20:46:23+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2021-10-31T20:46:23+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2021-10-31T20:46:23+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_3rd_source_library.html</loc>
-  <lastmod>2021-10-31T20:46:23+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package_old.html</loc>
-  <lastmod>2021-10-31T20:46:24+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2021-10-31T20:46:24+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2021-10-31T20:46:24+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2021-10-31T20:46:24+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/remote_toolchain.html</loc>
-  <lastmod>2021-10-31T20:46:24+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2021-10-31T20:46:24+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2021-10-31T20:46:25+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:58+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2021-10-31T20:46:25+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2021-10-31T20:46:25+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2021-10-31T20:46:25+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2021-10-31T20:46:25+08:00</lastmod>
+  <lastmod>2021-11-04T21:40:59+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/target_instance.html</loc>
-  <lastmod>2021-10-31T20:46:26+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2021-10-31T20:46:26+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2021-10-31T20:46:26+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2021-10-31T20:46:26+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2021-10-31T20:46:26+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:00+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2021-10-31T20:46:27+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2021-10-31T20:46:27+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2021-10-31T20:46:27+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/helper_interfaces.html</loc>
-  <lastmod>2021-10-31T20:46:27+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2021-10-31T20:46:27+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_instance.html</loc>
-  <lastmod>2021-10-31T20:46:28+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:01+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/option_instance.html</loc>
-  <lastmod>2021-10-31T20:46:28+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2021-10-31T20:46:28+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2021-10-31T20:46:28+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2021-10-31T20:46:28+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_3rd_source_library.html</loc>
-  <lastmod>2021-10-31T20:46:28+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:02+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package_old.html</loc>
-  <lastmod>2021-10-31T20:46:29+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2021-10-31T20:46:29+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2021-10-31T20:46:29+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2021-10-31T20:46:29+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/remote_toolchain.html</loc>
-  <lastmod>2021-10-31T20:46:29+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2021-10-31T20:46:30+08:00</lastmod>
+  <lastmod>2021-11-04T21:41:03+08:00</lastmod>
 </url>
 
 </urlset>

+ 40 - 52
zh-cn/manual/configuration_option.md

@@ -21,59 +21,8 @@ option("test2")
     -- ...
 ```
 
-<p class="tip">
-`option`域是可以重复进入来实现分离设置的,如果要显示离开当前选项的作用域设置,可以手动调用[option_end](#option_end)接口。
-</p>
-
+!> `option`域是可以重复进入来实现分离设置的,如果要显示离开当前选项的作用域设置,可以手动调用[option_end](#option_end)接口。
 
-| 接口                                                                         | 描述                                         | 支持版本 |
-| -----------------------------------------------------                        | -------------------------------------------- | -------- |
-| [option](#option)                                                            | 定义选项                                     | >= 2.0.1 |
-| [option_end](#option_end)                                                    | 结束定义选项                                 | >= 2.1.1 |
-| [add_deps](#optionadd_deps)                                                  | 添加选项依赖                                 | >= 2.1.5 |
-| [before_check](#optionbefore_check)                                          | 选项检测之前执行此脚本                       | >= 2.1.5 |
-| [on_check](#optionon_check)                                                  | 自定义选项检测脚本                           | >= 2.1.5 |
-| [after_check](#optionafter_check)                                            | 选项检测之后执行此脚本                       | >= 2.1.5 |
-| [set_values](#optionset_values)                                              | 设置选项值列表                               | >= 2.1.9 |
-| [set_default](#optionset_default)                                            | 设置默认值                                   | >= 2.0.1 |
-| [set_showmenu](#optionset_showmenu)                                          | 设置是否启用菜单显示                         | >= 1.0.1 |
-| [set_category](#optionset_category)                                          | 设置选项分类,仅用于菜单显示                 | >= 1.0.1 |
-| [set_description](#optionset_description)                                    | 设置菜单显示描述                             | >= 1.0.1 |
-| [add_links](#optionadd_links)                                                | 添加链接库检测                               | >= 1.0.1 |
-| [add_linkdirs](#optionadd_linkdirs)                                          | 添加链接库检测需要的搜索目录                 | >= 1.0.1 |
-| [add_rpathdirs](#optionadd_rpathdirs)                                        | 添加运行时候动态链接库搜索目录               | >= 2.1.3 |
-| [add_cincludes](#optionadd_cincludes)                                        | 添加c头文件检测                              | >= 1.0.1 |
-| [add_cxxincludes](#optionadd_cxxincludes)                                    | 添加c++头文件检测                            | >= 1.0.1 |
-| [add_ctypes](#optionadd_ctypes)                                              | 添加c类型检测                                | >= 1.0.1 |
-| [add_cxxtypes](#optionadd_cxxtypes)                                          | 添加c++类型检测                              | >= 1.0.1 |
-| [add_csnippets](#optionadd_csnippets)                                          | 添加c代码片段检测                            | >= 2.1.5 |
-| [add_cxxsnippets](#optionadd_cxxsnippets)                                      | 添加c++代码片段检测                          | >= 2.1.5 |
-| [set_warnings](/zh-cn/manual/project_target?id=targetset_warnings)           | 设置警告级别                                 | >= 1.0.1 |
-| [set_optimize](/zh-cn/manual/project_target?id=targetset_optimize)           | 设置优化级别                                 | >= 1.0.1 |
-| [set_languages](/zh-cn/manual/project_target?id=targetset_languages)         | 设置代码语言标准                             | >= 1.0.1 |
-| [add_includedirs](/zh-cn/manual/project_target?id=targetadd_includedirs)     | 添加头文件搜索目录                           | >= 1.0.1 |
-| [add_defines](/zh-cn/manual/project_target?id=targetadd_defines)             | 添加宏定义                                   | >= 1.0.1 |
-| [add_undefines](/zh-cn/manual/project_target?id=targetadd_undefines)         | 取消宏定义                                   | >= 1.0.1 |
-| [add_cflags](/zh-cn/manual/project_target?id=targetadd_cflags)               | 添加c编译选项                                | >= 1.0.1 |
-| [add_cxflags](/zh-cn/manual/project_target?id=targetadd_cxflags)             | 添加c/c++编译选项                            | >= 1.0.1 |
-| [add_cxxflags](/zh-cn/manual/project_target?id=targetadd_cxxflags)           | 添加c++编译选项                              | >= 1.0.1 |
-| [add_mflags](/zh-cn/manual/project_target?id=targetadd_mflags)               | 添加objc编译选项                             | >= 2.0.1 |
-| [add_mxflags](/zh-cn/manual/project_target?id=targetadd_mxflags)             | 添加objc/objc++编译选项                      | >= 2.0.1 |
-| [add_mxxflags](/zh-cn/manual/project_target?id=targetadd_mxxflags)           | 添加objc++编译选项                           | >= 2.0.1 |
-| [add_scflags](/zh-cn/manual/project_target?id=targetadd_scflags)             | 添加swift编译选项                            | >= 2.1.1 |
-| [add_asflags](/zh-cn/manual/project_target?id=targetadd_asflags)             | 添加汇编编译选项                             | >= 2.1.1 |
-| [add_gcflags](/zh-cn/manual/project_target?id=targetadd_gcflags)             | 添加go编译选项                               | >= 2.1.1 |
-| [add_dcflags](/zh-cn/manual/project_target?id=targetadd_dcflags)             | 添加dlang编译选项                            | >= 2.1.1 |
-| [add_rcflags](/zh-cn/manual/project_target?id=targetadd_rcflags)             | 添加rust编译选项                             | >= 2.1.1 |
-| [add_cuflags](/zh-cn/manual/project_target?id=targetadd_cuflags)             | 添加cuda编译选项                             | >= 2.2.1 |
-| [add_culdflags](/zh-cn/manual/project_target?id=targetadd_culdflags)         | 添加cuda设备链接选项                         | >= 2.2.7 |
-| [add_ldflags](/zh-cn/manual/project_target?id=targetadd_ldflags)             | 添加链接选项                                 | >= 2.1.1 |
-| [add_arflags](/zh-cn/manual/project_target?id=targetadd_arflags)             | 添加静态库归档选项                           | >= 2.1.1 |
-| [add_shflags](/zh-cn/manual/project_target?id=targetadd_shflags)             | 添加动态库链接选项                           | >= 2.0.1 |
-| [add_languages](/zh-cn/manual/project_target?id=targetadd_languages)         | 添加语言标准                                 | >= 2.0.1 |
-| [add_vectorexts](/zh-cn/manual/project_target?id=targetadd_vectorexts)       | 添加向量扩展指令                             | >= 2.0.1 |
-| [add_frameworks](/zh-cn/manual/project_target?id=targetadd_frameworks)       | 添加链接框架                                 | >= 2.1.1 |
-| [add_frameworkdirs](/zh-cn/manual/project_target?id=targetadd_frameworkdirs) | 添加链接框架                                 | >= 2.1.5 |
 
 ### option
 
@@ -547,3 +496,42 @@ if is_config("test", "8") tben
     -- xxx
 end
 ```
+
+### option:add_cfuncs
+
+#### 添加c库函数检测
+
+```lua
+option("setjmp")
+    set_default(false)
+    add_cincludes("setjmp.h")
+    add_cfuncs("sigsetjmp", "setjmp")
+    add_defines("HAVE_SETJMP")
+
+target("test")
+    add_options("setjmp")
+```
+
+此选项检测是否存在`setjmp`的一些接口,如果检测通过那么`test` 目标程序将会加上 `HAVE_SETJMP` 的宏定义。
+
+里面的函数片段支持下面几种语法格式:
+
+```lua
+-- 单纯检测函数地址是否存在,内部会尝试去它的地址来判断
+sigsetjmp
+
+-- 如果有些函数是宏定义 wrap 的,可以通过这种方式绕通过检测
+sigsetjmp((void*)0, 0)
+
+-- 也可以指定一个完整函数语句,例如:funcname{codebody}
+sigsetjmp{sigsetjmp((void*)0, 0);}
+sigsetjmp{int a = 0; sigsetjmp((void*)a, a);}
+```
+
+注意,检测的函数通常需要附带 `add_cincludes` 确保函数能够被正常 include 进来,否则检测会失败。
+
+### option:add_cxxfuncs
+
+#### 添加c++库函数检测
+
+用法跟 [option:add_cfuncs](#optionadd_cxxfuncs) 一致。