Browse Source

update docs

ruki 2 years ago
parent
commit
544a4261c6

+ 1 - 1
guide/project_examples.md

@@ -704,7 +704,7 @@ target("cuda_console")
 ```
 
 !> Starting with v2.2.7, the default build will enable device-link. (see [Separate Compilation and Linking of CUDA C++ Device Code](https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/))
-If you want to disable device-link, you can set it with `add_values("cuda.build.devlink", false)`.
+If you want to disable device-link, you can set it with `set_policy("build.cuda.devlink", false)`.
 
 !> Device functions in cuda source files should be device-linked once and only once. On targets with kind `binary` or `shared` xmake will automatically perform the device-link which takes the static libraries they depend into account, while for `static` targets by default will not be device-linked. However, if the final `binary` or `shared` target do not contain any cuda files, the device-link stage could be missing, resulting in an undefined reference error. In this case the static target should be set `add_values("cuda.build.devlink", true)` manually.
 

+ 20 - 5
manual/project_target.md

@@ -2172,9 +2172,7 @@ target("test")
 In the above code example, it can be seen that when the target applies the markdown rule, some flag values are set by set_values and provided to the markdown rule for processing.
 In the rule script, you can get the extended flag value set in the target by `target:values("markdown.flags")`.
 
-<p class="tip">
-The specific extension configuration name will be different according to different rules. Currently, you can refer to the description of related rules: [built-in rules](#built-in rules)
-</p>
+!> The specific extension configuration name will be different according to different rules. Currently, you can refer to the description of related rules: [built-in rules](#built-in rules)
 
 The following is a list of some built-in extended configuration items currently supported by xmake.
 
@@ -2187,7 +2185,6 @@ The following is a list of some built-in extended configuration items currently
 | xcode.bundle_identifier     | Set the Bundle Identifier of the xcode toolchain       |
 | xcode.mobile_provision      | Set the certificate information of the xcode toolchain |
 | xcode.codesign_identity     | Set the code signing identity of the xcode toolchain   |
-| cuda.build.devlink          | Set to enable or disable cuda's device link            |
 | wdk.env.winver              | Set the win support version of wdk                     |
 | wdk.umdf.sdkver             | Set the umdf sdk version of wdk                        |
 | wdk.kmdf.sdkver             | Set the kmdf sdk version of wdk                        |
@@ -2811,6 +2808,22 @@ We can also turn it on quickly via the command line option.
 $ xmake f --policies=build.optimization.lto
 ```
 
+##### build.cuda.devlink
+
+Version 2.7.7 can be configured to show that device links to specific targets are turned on.
+
+This is typically used for Cuda project builds, and for non-Cuda binary/shared dependencies on Cuda static targets, where the Cuda static target needs to show this configuration to turn on device linking.
+
+```lua
+target("test")
+    set_kind("static")
+    set_policy("build.cuda.devlink", true)
+```
+
+Whereas by default Cuda binary/shared is devlink enabled, we can also disable it via the policy display.
+
+For a detailed background on this, see: [#1976](https://github.com/xmake-io/xmake/issues/1976)
+
 ##### preprocessor.linemarkers
 
 If this policy is turned off, then the cache will generate preprocessor files without linemarkers, which will greatly reduce the size of the preprocessor files.
@@ -2908,7 +2921,9 @@ target("demo")
     add_packages("foo")
 ```
 
-##### Setting http headers for package downloads
+##### package.download.http_headers
+
+Setting http headers for package downloads
 
 If some packages have url downloads that require specific http headers to be set in order to pass the download, this policy can be specified.
 

+ 1 - 1
mirror/guide/project_examples.html

@@ -550,7 +550,7 @@ target("cuda_console")
     -- generate PTX code for the virtual architecture to guarantee compatibility
     add_cugencodes("compute_30")
 </code></pre>
-<p>!> Starting with v2.2.7, the default build will enable device-link. (see <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>If you want to disable device-link, you can set it with <code>add_values("cuda.build.devlink", false)</code>.</p>
+<p>!> Starting with v2.2.7, the default build will enable device-link. (see <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>If you want to disable device-link, you can set it with <code>set_policy("build.cuda.devlink", false)</code>.</p>
 <p>!> Device functions in cuda source files should be device-linked once and only once. On targets with kind <code>binary</code> or <code>shared</code> xmake will automatically perform the device-link which takes the static libraries they depend into account, while for <code>static</code> targets by default will not be device-linked. However, if the final <code>binary</code> or <code>shared</code> target do not contain any cuda files, the device-link stage could be missing, resulting in an undefined reference error. In this case the static target should be set <code>add_values("cuda.build.devlink", true)</code> manually.</p>
 <p>xmake will detect Cuda SDK automatically and we can also set the SDK directory (or SDK version for default installations) manually.</p>
 <pre><code class="lang-console">$ xmake f --cuda=/usr/local/cuda-9.1/

+ 12 - 8
mirror/manual/project_target.html

@@ -1876,9 +1876,7 @@ target("test")
     set_values("markdown.flags", "xxx", "xxx")
 </code></pre>
 <p>In the above code example, it can be seen that when the target applies the markdown rule, some flag values are set by set_values and provided to the markdown rule for processing.<br>In the rule script, you can get the extended flag value set in the target by <code>target:values("markdown.flags")</code>.</p>
-<p><p class="tip"><br>The specific extension configuration name will be different according to different rules. Currently, you can refer to the description of related rules: <a href="#built-in rules">built-in rules</a><br></p>
-
-</p>
+<p>!> The specific extension configuration name will be different according to different rules. Currently, you can refer to the description of related rules: <a href="#built-in rules">built-in rules</a></p>
 <p>The following is a list of some built-in extended configuration items currently supported by xmake.</p>
 <table>
 <thead>
@@ -1917,10 +1915,6 @@ target("test")
 <td>Set the code signing identity of the xcode toolchain</td>
 </tr>
 <tr>
-<td>cuda.build.devlink</td>
-<td>Set to enable or disable cuda&#39;s device link</td>
-</tr>
-<tr>
 <td>wdk.env.winver</td>
 <td>Set the win support version of wdk</td>
 </tr>
@@ -2317,6 +2311,15 @@ set_warnings("all", "extra")
 <p>We can also turn it on quickly via the command line option.</p>
 <pre><code class="lang-console">$ xmake f --policies=build.optimization.lto
 </code></pre>
+<h5 id="buildcudadevlink">build.cuda.devlink</h5>
+<p>Version 2.7.7 can be configured to show that device links to specific targets are turned on.</p>
+<p>This is typically used for Cuda project builds, and for non-Cuda binary/shared dependencies on Cuda static targets, where the Cuda static target needs to show this configuration to turn on device linking.</p>
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    set_policy("build.cuda.devlink", true)
+</code></pre>
+<p>Whereas by default Cuda binary/shared is devlink enabled, we can also disable it via the policy display.</p>
+<p>For a detailed background on this, see: <a href="https://github.com/xmake-io/xmake/issues/1976">#1976</a></p>
 <h5 id="preprocessorlinemarkers">preprocessor.linemarkers</h5>
 <p>If this policy is turned off, then the cache will generate preprocessor files without linemarkers, which will greatly reduce the size of the preprocessor files.<br>This will greatly reduce the size of the preprocessor file and improve the efficiency of the cache, but the downside is that the source line information will be lost and if you encounter a compilation error, you will not be able to see the exact line of code that went wrong.</p>
 <h5 id="preprocessorgccdirectives_only">preprocessor.gcc.directives_only</h5>
@@ -2379,7 +2382,8 @@ target("demo")
     add_files("src/main.c")
     add_packages("foo")
 </code></pre>
-<h5 id="settinghttpheadersforpackagedownloads">Setting http headers for package downloads</h5>
+<h5 id="packagedownloadhttp_headers">package.download.http_headers</h5>
+<p>Setting http headers for package downloads</p>
 <p>If some packages have url downloads that require specific http headers to be set in order to pass the download, this policy can be specified.</p>
 <pre><code class="lang-lua">package("xxx")
     set_policy("package.download.http_headers", "TEST1: foo", "TEST2: bar")

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

@@ -553,7 +553,7 @@ target("cuda_console")
     -- generate PTX code for the virtual architecture to guarantee compatibility
     add_cugencodes("compute_30")
 </code></pre>
-<p>!> 从v2.2.7版本开始,默认构建会启用device-link。(参见 <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>如果要显式禁用device-link,可以通过 <code>add_values("cuda.devlink", false)</code> 来设置。</p>
+<p>!> 从v2.2.7版本开始,默认构建会启用device-link。(参见 <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>如果要显式禁用device-link,可以通过 <code>set_policy("build.cuda.devlink", false)</code> 来设置。</p>
 <p>!> cuda 源文件中的 device 函数需要被 device-link 且只 device-link 一次。在 <code>shared</code> 或 <code>binary</code> 的 target 上 xmake 会自动进行 device-link ,这时它们依赖的 <code>static</code> target 也会同时被 device-link ,因此默认情况下 <code>static</code> target 不会被 device-link。然而,如果最终的 <code>shared</code> 或 <code>binary</code> 的 target 不包含任何 cuda 源文件,则不会发生 device-link 阶段,导致出现 undefined reference 错误。这种情况下,需要手动为 <code>static</code> target 指定 <code>add_values("cuda.build.devlink", true)</code>.</p>
 <p>默认会自动探测cuda环境,当然也可以指定Cuda SDK环境目录,或者指定cuda版本(此时将在默认安装目录进行查找):</p>
 <pre><code class="lang-console">$ xmake f --cuda=/usr/local/cuda-9.1/

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

@@ -1891,9 +1891,7 @@ target("test")
     set_values("markdown.flags", "xxx", "xxx")
 </code></pre>
 <p>上述代码例子中,可以看出,在target应用markdown规则的时候,通过set_values去设置一些flags值,提供给markdown规则去处理。<br>在规则脚本中可以通过<code>target:values("markdown.flags")</code>获取到target中设置的扩展flags值。</p>
-<p><p class="tip"><br>具体扩展配置名,根据不同的rule,会有所不同,目前有哪些,可以参考相关规则的描述:<a href="#内建规则">内建规则</a><br></p>
-
-</p>
+<p>!> 具体扩展配置名,根据不同的rule,会有所不同,目前有哪些,可以参考相关规则的描述:<a href="#内建规则">内建规则</a></p>
 <p>下面是一些 xmake 目前支持的一些内置的扩展配置项列表。</p>
 <table>
 <thead>
@@ -1932,10 +1930,6 @@ target("test")
 <td>设置 xcode 工具链的代码签名标识</td>
 </tr>
 <tr>
-<td>cuda.build.devlink</td>
-<td>设置启用或禁用 cuda 的设备链接</td>
-</tr>
-<tr>
 <td>wdk.env.winver</td>
 <td>设置 wdk 的 win 支持版本</td>
 </tr>
@@ -2334,6 +2328,15 @@ set_warnings("all", "extra")
 <p>我们也可以通过命令行选项快速开启。</p>
 <pre><code class="lang-console">$ xmake f --policies=build.optimization.lto
 </code></pre>
+<h5 id="buildcudadevlink">build.cuda.devlink</h5>
+<p>2.7.7 版本可以通过这个配置,显示开启对特定目标的设备链接。</p>
+<p>这通常用于 Cuda 项目的构建,以及非 Cuda binary/shared 依赖 Cuda static 目标的情况,这个时候,Cuda static 目标就需要显示配置这个,开启设备链接。</p>
+<pre><code class="lang-lua">target("test")
+    set_kind("static")
+    set_policy("build.cuda.devlink", true)
+</code></pre>
+<p>而默认 Cuda binary/shared 是开启 devlink 的,我们也可以通过策略显示禁用它。</p>
+<p>关于这个的详细背景说明,见:<a href="https://github.com/xmake-io/xmake/issues/1976">#1976</a></p>
 <h5 id="preprocessorlinemarkers">preprocessor.linemarkers</h5>
 <p>通常用户编译缓存中,预处理器的生成策略,默认开启,如果配置关闭这个策略,那么缓存生成的预处理文件内容将不包含 linemarkers 信息,这会极大减少预处理文件大小。<br>也会提升缓存的处理效率,但是缺点就是会丢失源码行信息,如果遇到编译错误,将无法看到准确的出错代码行。</p>
 <h5 id="preprocessorgccdirectives_only">preprocessor.gcc.directives_only</h5>
@@ -2396,7 +2399,8 @@ target("demo")
     add_files("src/main.c")
     add_packages("foo")
 </code></pre>
-<h5 id="httpheaders">设置包下载的 http headers</h5>
+<h5 id="packagedownloadhttp_headers">package.download.http_headers</h5>
+<p>设置包下载的 http headers</p>
 <p>如果有些包的 url 下载,需要设置特定 http headers,才能通过下载,可以通过这个策略来指定。</p>
 <pre><code class="lang-lua">package("xxx")
     set_policy("package.download.http_headers", "TEST1: foo", "TEST2: bar")

+ 100 - 100
sitemap.xml

@@ -12,502 +12,502 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2023-02-21T10:29:41+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2023-02-21T10:29:41+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2023-02-21T10:29:42+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2023-02-21T10:29:42+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2023-02-21T10:29:42+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2023-02-21T10:29:42+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/remote_build.html</loc>
-  <lastmod>2023-02-21T10:29:42+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/unity_build.html</loc>
-  <lastmod>2023-02-21T10:29:43+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/distcc_build.html</loc>
-  <lastmod>2023-02-21T10:29:43+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/trybuild.html</loc>
-  <lastmod>2023-02-21T10:29:43+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/autogen.html</loc>
-  <lastmod>2023-02-21T10:29:43+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/build_cache.html</loc>
-  <lastmod>2023-02-21T10:29:43+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2023-02-21T10:29:44+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2023-02-21T10:29:44+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2023-02-21T10:29:44+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2023-02-21T10:29:44+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2023-02-21T10:29:45+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2023-02-21T10:29:45+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2023-02-21T10:29:45+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2023-02-21T10:29:45+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/who_is_using_xmake.html</loc>
-  <lastmod>2023-02-21T10:29:45+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2023-02-21T10:29:46+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2023-02-21T10:29:46+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2023-02-21T10:29:46+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2023-02-21T10:29:46+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2023-02-21T10:29:46+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2023-02-21T10:29:47+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2023-02-21T10:29:47+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2023-02-21T10:29:47+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/remote_build.html</loc>
-  <lastmod>2023-02-21T10:29:47+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/unity_build.html</loc>
-  <lastmod>2023-02-21T10:29:47+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/distcc_build.html</loc>
-  <lastmod>2023-02-21T10:29:48+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/trybuild.html</loc>
-  <lastmod>2023-02-21T10:29:48+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/autogen.html</loc>
-  <lastmod>2023-02-21T10:29:48+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/build_cache.html</loc>
-  <lastmod>2023-02-21T10:29:48+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2023-02-21T10:29:48+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2023-02-21T10:29:49+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2023-02-21T10:29:49+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2023-02-21T10:29:49+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2023-02-21T10:29:49+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2023-02-21T10:29:50+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2023-02-21T10:29:50+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/peripheral_items.html</loc>
-  <lastmod>2023-02-21T10:29:50+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2023-02-21T10:29:50+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/who_is_using_xmake.html</loc>
-  <lastmod>2023-02-21T10:29:50+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2023-02-21T10:29:51+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2023-02-21T10:29:51+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2023-02-21T10:29:51+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2023-02-21T10:29:51+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2023-02-21T10:29:51+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2023-02-21T10:29:52+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2023-02-21T10:29:52+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2023-02-21T10:29:52+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/target_instance.html</loc>
-  <lastmod>2023-02-21T10:29:52+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2023-02-21T10:29:53+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2023-02-21T10:29:53+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2023-02-21T10:29:53+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2023-02-21T10:29:53+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2023-02-21T10:29:53+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2023-02-21T10:29:54+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2023-02-21T10:29:54+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/helper_interfaces.html</loc>
-  <lastmod>2023-02-21T10:29:54+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2023-02-21T10:29:54+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_instance.html</loc>
-  <lastmod>2023-02-21T10:29:54+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/option_instance.html</loc>
-  <lastmod>2023-02-21T10:29:55+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2023-02-21T10:29:55+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2023-02-21T10:29:55+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_3rd_source_library.html</loc>
-  <lastmod>2023-02-21T10:29:55+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package_old.html</loc>
-  <lastmod>2023-02-21T10:29:56+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2023-02-21T10:29:56+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2023-02-21T10:29:56+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2023-02-21T10:29:56+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/remote_toolchain.html</loc>
-  <lastmod>2023-02-21T10:29:56+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2023-02-21T10:29:57+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2023-02-21T10:29:57+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2023-02-21T10:29:57+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2023-02-21T10:29:57+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2023-02-21T10:29:58+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2023-02-21T10:29:58+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/target_instance.html</loc>
-  <lastmod>2023-02-21T10:29:58+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2023-02-21T10:29:58+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2023-02-21T10:29:59+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2023-02-21T10:29:59+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2023-02-21T10:29:59+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2023-02-21T10:29:59+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2023-02-21T10:30:00+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2023-02-21T10:30:00+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/helper_interfaces.html</loc>
-  <lastmod>2023-02-21T10:30:00+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2023-02-21T10:30:00+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_instance.html</loc>
-  <lastmod>2023-02-21T10:30:01+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/option_instance.html</loc>
-  <lastmod>2023-02-21T10:30:01+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2023-02-21T10:30:01+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2023-02-21T10:30:01+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_3rd_source_library.html</loc>
-  <lastmod>2023-02-21T10:30:02+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package_old.html</loc>
-  <lastmod>2023-02-21T10:30:02+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2023-02-21T10:30:02+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2023-02-21T10:30:02+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2023-02-21T10:30:02+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/remote_toolchain.html</loc>
-  <lastmod>2023-02-21T10:30:03+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2023-02-21T10:30:03+08:00</lastmod>
+  <lastmod>2023-02-21T12:18:55+08:00</lastmod>
 </url>
 
 </urlset>

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

@@ -710,7 +710,7 @@ target("cuda_console")
 ```
 
 !> 从v2.2.7版本开始,默认构建会启用device-link。(参见 [Separate Compilation and Linking of CUDA C++ Device Code](https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/))
-如果要显式禁用device-link,可以通过 `add_values("cuda.devlink", false)` 来设置。
+如果要显式禁用device-link,可以通过 `set_policy("build.cuda.devlink", false)` 来设置。
 
 !> cuda 源文件中的 device 函数需要被 device-link 且只 device-link 一次。在 `shared` 或 `binary` 的 target 上 xmake 会自动进行 device-link ,这时它们依赖的 `static` target 也会同时被 device-link ,因此默认情况下 `static` target 不会被 device-link。然而,如果最终的 `shared` 或 `binary` 的 target 不包含任何 cuda 源文件,则不会发生 device-link 阶段,导致出现 undefined reference 错误。这种情况下,需要手动为 `static` target 指定 `add_values("cuda.build.devlink", true)`.
 

+ 20 - 5
zh-cn/manual/project_target.md

@@ -2173,9 +2173,7 @@ target("test")
 上述代码例子中,可以看出,在target应用markdown规则的时候,通过set_values去设置一些flags值,提供给markdown规则去处理。
 在规则脚本中可以通过`target:values("markdown.flags")`获取到target中设置的扩展flags值。
 
-<p class="tip">
-具体扩展配置名,根据不同的rule,会有所不同,目前有哪些,可以参考相关规则的描述:[内建规则](#内建规则)
-</p>
+!> 具体扩展配置名,根据不同的rule,会有所不同,目前有哪些,可以参考相关规则的描述:[内建规则](#内建规则)
 
 下面是一些 xmake 目前支持的一些内置的扩展配置项列表。
 
@@ -2188,7 +2186,6 @@ target("test")
 | xcode.bundle_identifier | 设置 xcode 工具链的 Bundle Identifier |
 | xcode.mobile_provision  | 设置 xcode 工具链的证书信息           |
 | xcode.codesign_identity | 设置 xcode 工具链的代码签名标识       |
-| cuda.build.devlink      | 设置启用或禁用 cuda 的设备链接        |
 | wdk.env.winver          | 设置 wdk 的 win 支持版本              |
 | wdk.umdf.sdkver         | 设置 wdk 的 umdf sdk 版本             |
 | wdk.kmdf.sdkver         | 设置 wdk 的 kmdf sdk 版本             |
@@ -2815,6 +2812,22 @@ set_policy("build.optimization.lto")
 $ xmake f --policies=build.optimization.lto
 ```
 
+##### build.cuda.devlink
+
+2.7.7 版本可以通过这个配置,显示开启对特定目标的设备链接。
+
+这通常用于 Cuda 项目的构建,以及非 Cuda binary/shared 依赖 Cuda static 目标的情况,这个时候,Cuda static 目标就需要显示配置这个,开启设备链接。
+
+```lua
+target("test")
+    set_kind("static")
+    set_policy("build.cuda.devlink", true)
+```
+
+而默认 Cuda binary/shared 是开启 devlink 的,我们也可以通过策略显示禁用它。
+
+关于这个的详细背景说明,见:[#1976](https://github.com/xmake-io/xmake/issues/1976)
+
 ##### preprocessor.linemarkers
 
 通常用户编译缓存中,预处理器的生成策略,默认开启,如果配置关闭这个策略,那么缓存生成的预处理文件内容将不包含 linemarkers 信息,这会极大减少预处理文件大小。
@@ -2910,7 +2923,9 @@ target("demo")
     add_packages("foo")
 ```
 
-##### 设置包下载的 http headers
+##### package.download.http_headers
+
+设置包下载的 http headers
 
 如果有些包的 url 下载,需要设置特定 http headers,才能通过下载,可以通过这个策略来指定。