ruki hai 1 ano
pai
achega
dc58630110

+ 16 - 0
guide/build_policies.md

@@ -364,6 +364,22 @@ build/
 └─ test
 ```
 
+### build.rpath
+
+Configures to enable or disable the target rpath setting during build.
+
+By default, if `target(foo)` depends on the dynamic library bar, the generated foo executable file will automatically add bar's rpath, which ensures that users can directly execute the foo program and find bar correctly.
+
+If you want to disable this behavior, you can explicitly configure it.
+
+### install.rpath
+
+Although the rpath will be set for the built program, the rpath when it is built may not be completely applicable after `xmake install` is installed, so xmake will automatically modify and adjust the rpath so that the installed program can also find its dependent libraries.
+
+However, the premise is that the user must first configure an independent installation rpath through `add_rpathdirs("/xxx", {installonly = true})`.
+
+And we can also use this policy to disable the default installation phase rpath setting behavior.
+
 ### run.autobuild
 
 This policy is used to adjust the behaviour of `xmake run`. By default, running `xmake run` does not build the target program automatically, but prompts the user to build it manually if it has not been compiled yet.

+ 60 - 0
manual/project_target.md

@@ -1687,6 +1687,8 @@ We can specify it through additional parameters, `add_rpathdirs("xxx", {runpath
 
 For relevant background details, see: [#5109](https://github.com/xmake-io/xmake/issues/5109)
 
+After 2.9.4, we added `add_rpathdirs("xxx", {install_only = true})`, which can configure the installed rpath path separately.
+
 ### target:add_includedirs
 
 #### Add include search directories
@@ -2487,6 +2489,64 @@ target("test")
 By default, `xmake install` will be installed to the system `/usr/local` directory. We can specify other installation directories except `xmake install -o /usr/local`.
 You can also set a different installation directory for the target in xmake.lua instead of the default directory.
 
+### target:set_prefixdir
+
+#### Set the installation prefix subdirectory
+
+Although the installation root directory is set by `set_installdir` and `xmake install -o [installdir]`, if we still want to further adjust the subpaths of bin, lib and include.
+
+Then, we can use this interface. By default, the installation directory will follow this structure:
+
+```bash
+installdir
+- bin
+- lib
+- include
+```
+
+If we configure:
+
+```lua
+set_prefix("prefixdir")
+```
+
+It is to add a general subdirectory:
+
+```bash
+installdir
+- prefixdir
+- bin
+- lib
+- include
+```
+
+We can also configure bin, lib and include subdirectories separately, for example:
+
+```lua
+set_prefix("prefixdir", {bindir = "mybin", libdir = "mylib", includedir = "myinc"})
+```
+
+```bash
+installdir
+- prefixdir
+- mybin
+- mylib
+- myinc
+```
+
+If we do not configure prefixdir and only modify the bin subdirectory, we can configure prefixdir to `/`.
+
+```lua
+set_prefix("/", {bindir = "mybin", libdir = "mylib", includedir = "myinc"})
+```
+
+```bash
+installdir
+  - mybin
+  - mylib
+  - myinc
+```
+
 ### target:add_installfiles
 
 #### Add installation files

+ 8 - 0
mirror/guide/build_policies.html

@@ -306,6 +306,14 @@ set_policy("build.sanitizer.undefined", true)
 <pre><code class="lang-bash">build/
 └─ test
 </code></pre>
+<h3 id="buildrpath">build.rpath</h3>
+<p>Configures to enable or disable the target rpath setting during build.</p>
+<p>By default, if <code>target(foo)</code> depends on the dynamic library bar, the generated foo executable file will automatically add bar&#39;s rpath, which ensures that users can directly execute the foo program and find bar correctly.</p>
+<p>If you want to disable this behavior, you can explicitly configure it.</p>
+<h3 id="installrpath">install.rpath</h3>
+<p>Although the rpath will be set for the built program, the rpath when it is built may not be completely applicable after <code>xmake install</code> is installed, so xmake will automatically modify and adjust the rpath so that the installed program can also find its dependent libraries.</p>
+<p>However, the premise is that the user must first configure an independent installation rpath through <code>add_rpathdirs("/xxx", {installonly = true})</code>.</p>
+<p>And we can also use this policy to disable the default installation phase rpath setting behavior.</p>
 <h3 id="runautobuild">run.autobuild</h3>
 <p>This policy is used to adjust the behaviour of <code>xmake run</code>. By default, running <code>xmake run</code> does not build the target program automatically, but prompts the user to build it manually if it has not been compiled yet.</p>
 <p>By turning on this policy, we can automatically build the target program before running it.</p>

+ 37 - 0
mirror/manual/project_target.html

@@ -1577,6 +1577,7 @@ add_files("src/*.cpp|test.cpp|hello.cpp|xx_*.cpp")
 <p>In addition, for gcc, <code>add_rpathdirs</code> defaults to runpath. If you want to configure it explicitly, use <code>-Wl,--enable-new-dtags</code>, <code>-Wl,--disable-new-dtags</code> to configure rpath. Or runpath</p>
 <p>We can specify it through additional parameters, <code>add_rpathdirs("xxx", {runpath = true})</code></p>
 <p>For relevant background details, see: <a href="https://github.com/xmake-io/xmake/issues/5109">#5109</a></p>
+<p>After 2.9.4, we added <code>add_rpathdirs("xxx", {install_only = true})</code>, which can configure the installed rpath path separately.</p>
 <h3 id="targetadd_includedirs">target:add_includedirs</h3>
 <h4 id="addincludesearchdirectories">Add include search directories</h4>
 <p>Set the search directory for the header file. This interface is used as follows:</p>
@@ -2165,6 +2166,42 @@ target("test")
 <h3 id="targetset_installdir">target:set_installdir</h3>
 <h4 id="settheinstallationdirectory">Set the installation directory</h4>
 <p>By default, <code>xmake install</code> will be installed to the system <code>/usr/local</code> directory. We can specify other installation directories except <code>xmake install -o /usr/local</code>.<br>You can also set a different installation directory for the target in xmake.lua instead of the default directory.</p>
+<h3 id="targetset_prefixdir">target:set_prefixdir</h3>
+<h4 id="settheinstallationprefixsubdirectory">Set the installation prefix subdirectory</h4>
+<p>Although the installation root directory is set by <code>set_installdir</code> and <code>xmake install -o [installdir]</code>, if we still want to further adjust the subpaths of bin, lib and include.</p>
+<p>Then, we can use this interface. By default, the installation directory will follow this structure:</p>
+<pre><code class="lang-bash">installdir
+- bin
+- lib
+- include
+</code></pre>
+<p>If we configure:</p>
+<pre><code class="lang-lua">set_prefix("prefixdir")
+</code></pre>
+<p>It is to add a general subdirectory:</p>
+<pre><code class="lang-bash">installdir
+- prefixdir
+- bin
+- lib
+- include
+</code></pre>
+<p>We can also configure bin, lib and include subdirectories separately, for example:</p>
+<pre><code class="lang-lua">set_prefix("prefixdir", {bindir = "mybin", libdir = "mylib", includedir = "myinc"})
+</code></pre>
+<pre><code class="lang-bash">installdir
+- prefixdir
+- mybin
+- mylib
+- myinc
+</code></pre>
+<p>If we do not configure prefixdir and only modify the bin subdirectory, we can configure prefixdir to <code>/</code>.</p>
+<pre><code class="lang-lua">set_prefix("/", {bindir = "mybin", libdir = "mylib", includedir = "myinc"})
+</code></pre>
+<pre><code class="lang-bash">installdir
+  - mybin
+  - mylib
+  - myinc
+</code></pre>
 <h3 id="targetadd_installfiles">target:add_installfiles</h3>
 <h4 id="addinstallationfiles">Add installation files</h4>
 <p>2.2.5 version of the new interface, used to set the corresponding file for each target, generally used for the <code>xmake install/uninstall</code> command.</p>

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

@@ -307,6 +307,14 @@ set_policy("build.sanitizer.undefined", true)
 <pre><code class="lang-bash">build/
 └─ test
 </code></pre>
+<h3 id="buildrpath">build.rpath</h3>
+<p>配置启用或者禁用构建时的 target rpath 设置。</p>
+<p>默认情况下,如果 <code>target(foo)</code> 依赖动态库 bar,那么生成的 foo 可执行文件会自动加上 bar 的 rpath,这能保证用户直接执行 foo 程序,也能正确找到 bar。</p>
+<p>如果你想禁用这个行为,可以显式配置禁用它。</p>
+<h3 id="installrpath">install.rpath</h3>
+<p>尽管构建后的程序,会被设置 rpath,但是当 <code>xmake install</code> 安装后,它构建时候的 rpath 就不一定完全适用了,因此 xmake 会自动修改调整 rpath,使得安装后的程序,同样可以找到它的依赖库。</p>
+<p>不过前提是,用户自己先得通过 <code>add_rpathdirs("/xxx", {installonly = true})</code> 去配置独立的安装 rpath。</p>
+<p>而我们也可以通过这个 policy 去禁用默认的安装阶段 rpath 设置行为。</p>
 <h3 id="runautobuild">run.autobuild</h3>
 <p>这个策略用于调整 <code>xmake run</code> 的行为,默认情况下,执行 <code>xmake run</code> 并不会自动构建目标程序,如果程序还没被编译,就是提示用户手动构建一下。</p>
 <p>而开启这个策略,我们就可以在运行程序前,先自动构建对应的目标程序。</p>

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

@@ -1548,6 +1548,7 @@ add_files("src/*.cpp|test.cpp|hello.cpp|xx_*.cpp")
 <p>另外,对于 gcc, <code>add_rpathdirs</code> 默认设置的是 runpath,如果想要显式的配置上 <code>-Wl,--enable-new-dtags</code>, <code>-Wl,--disable-new-dtags</code> 去配置 rpath 还是 runpath</p>
 <p>我们可以通过额外的参数指定,<code>add_rpathdirs("xxx", {runpath = true})</code></p>
 <p>相关背景细节见:<a href="https://github.com/xmake-io/xmake/issues/5109">#5109</a></p>
+<p>2.9.4 之后,我们新增了 <code>add_rpathdirs("xxx", {install_only = true})</code> ,可以单独配置安装后的 rpath 路径。</p>
 <h3 id="targetadd_includedirs">target:add_includedirs</h3>
 <h4 id="">添加头文件搜索目录</h4>
 <p>设置头文件的搜索目录,这个接口的使用方式如下:</p>
@@ -2137,6 +2138,42 @@ target("test")
 <p>2.2.5版本新增接口,用于针对每个target设置不同的默认安装目录,一般用于<code>xmake install/uninstall</code>命令。</p>
 <p>默认情况下执行<code>xmake install</code>会安装到系统<code>/usr/local</code>目录,我们除了可以通过<code>xmake install -o /usr/local</code>指定其他安装目录外,<br>还可以在xmake.lua中针对target设置不同的安装目录来替代默认目录。</p>
 <p>除了上述两种方式,我们也可以通过<code>INSTALLDIR</code>和<code>DESTDIR</code>环境变量设置默认的安装目录。</p>
+<h3 id="targetset_prefixdir">target:set_prefixdir</h3>
+<h4 id="">设置安装前置子目录</h4>
+<p>尽管通过 <code>set_installdir</code> 和 <code>xmake install -o [installdir]</code> 设置了安装根目录,但是如果我们还想进一步调整 bin, lib 和 include 的子路径。</p>
+<p>那么,我们可以使用这个接口,默认情况下,安装目录会按照这个结构:</p>
+<pre><code class="lang-bash">installdir
+  - bin
+  - lib
+  - include
+</code></pre>
+<p>如果我们配置:</p>
+<pre><code class="lang-lua">set_prefix("prefixdir")
+</code></pre>
+<p>就是增加一个总的子目录:</p>
+<pre><code class="lang-bash">installdir
+  - prefixdir
+    - bin
+    - lib
+    - include
+</code></pre>
+<p>我们还可以单独配置 bin, lib 和 include 子目录,例如:</p>
+<pre><code class="lang-lua">set_prefix("prefixdir", {bindir = "mybin", libdir = "mylib", includedir = "myinc"})
+</code></pre>
+<pre><code class="lang-bash">installdir
+  - prefixdir
+    - mybin
+    - mylib
+    - myinc
+</code></pre>
+<p>如果,我们不配置 prefixdir,仅仅修改 bin 子目录,可以将 prefixdir 配置成 <code>/</code>。</p>
+<pre><code class="lang-lua">set_prefix("/", {bindir = "mybin", libdir = "mylib", includedir = "myinc"})
+</code></pre>
+<pre><code class="lang-bash">installdir
+  - mybin
+  - mylib
+  - myinc
+</code></pre>
 <h3 id="targetadd_installfiles">target:add_installfiles</h3>
 <h4 id="">添加安装文件</h4>
 <p>2.2.5版本新增接口,用于针对每个target设置对应需要安装的文件,一般用于<code>xmake install/uninstall</code>命令。</p>

+ 106 - 106
sitemap.xml

@@ -12,532 +12,532 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2024-07-28T22:50:01+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:34+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2024-07-28T22:50:01+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:34+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2024-07-28T22:50:01+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:35+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/build_policies.html</loc>
-  <lastmod>2024-07-28T22:50:02+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:35+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2024-07-28T22:50:02+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:35+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2024-07-28T22:50:02+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:35+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2024-07-28T22:50:02+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/remote_build.html</loc>
-  <lastmod>2024-07-28T22:50:02+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/unity_build.html</loc>
-  <lastmod>2024-07-28T22:50:03+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/distcc_build.html</loc>
-  <lastmod>2024-07-28T22:50:03+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/trybuild.html</loc>
-  <lastmod>2024-07-28T22:50:03+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:36+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/autogen.html</loc>
-  <lastmod>2024-07-28T22:50:03+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/features/build_cache.html</loc>
-  <lastmod>2024-07-28T22:50:03+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2024-07-28T22:50:04+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2024-07-28T22:50:04+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2024-07-28T22:50:04+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:37+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2024-07-28T22:50:04+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2024-07-28T22:50:04+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2024-07-28T22:50:05+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2024-07-28T22:50:05+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2024-07-28T22:50:05+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:38+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/who_is_using_xmake.html</loc>
-  <lastmod>2024-07-28T22:50:05+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2024-07-28T22:50:05+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2024-07-28T22:50:06+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2024-07-28T22:50:06+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2024-07-28T22:50:06+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:39+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2024-07-28T22:50:06+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/build_policies.html</loc>
-  <lastmod>2024-07-28T22:50:06+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2024-07-28T22:50:06+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2024-07-28T22:50:07+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2024-07-28T22:50:07+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:40+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/remote_build.html</loc>
-  <lastmod>2024-07-28T22:50:07+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/unity_build.html</loc>
-  <lastmod>2024-07-28T22:50:07+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/distcc_build.html</loc>
-  <lastmod>2024-07-28T22:50:07+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/trybuild.html</loc>
-  <lastmod>2024-07-28T22:50:08+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/autogen.html</loc>
-  <lastmod>2024-07-28T22:50:08+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/features/build_cache.html</loc>
-  <lastmod>2024-07-28T22:50:08+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2024-07-28T22:50:08+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2024-07-28T22:50:08+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2024-07-28T22:50:09+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2024-07-28T22:50:09+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2024-07-28T22:50:09+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2024-07-28T22:50:09+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2024-07-28T22:50:09+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/peripheral_items.html</loc>
-  <lastmod>2024-07-28T22:50:10+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2024-07-28T22:50:10+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/who_is_using_xmake.html</loc>
-  <lastmod>2024-07-28T22:50:10+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2024-07-28T22:50:10+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2024-07-28T22:50:10+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2024-07-28T22:50:11+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2024-07-28T22:50:11+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/native_modules.html</loc>
-  <lastmod>2024-07-28T22:50:11+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2024-07-28T22:50:11+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2024-07-28T22:50:11+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2024-07-28T22:50:12+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2024-07-28T22:50:12+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/target_instance.html</loc>
-  <lastmod>2024-07-28T22:50:12+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2024-07-28T22:50:12+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2024-07-28T22:50:12+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2024-07-28T22:50:13+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2024-07-28T22:50:13+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2024-07-28T22:50:13+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2024-07-28T22:50:13+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2024-07-28T22:50:13+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/helper_interfaces.html</loc>
-  <lastmod>2024-07-28T22:50:14+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2024-07-28T22:50:14+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_instance.html</loc>
-  <lastmod>2024-07-28T22:50:14+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/xpack.html</loc>
-  <lastmod>2024-07-28T22:50:14+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/option_instance.html</loc>
-  <lastmod>2024-07-28T22:50:14+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2024-07-28T22:50:15+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2024-07-28T22:50:15+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_3rd_source_library.html</loc>
-  <lastmod>2024-07-28T22:50:15+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package_old.html</loc>
-  <lastmod>2024-07-28T22:50:15+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2024-07-28T22:50:15+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2024-07-28T22:50:16+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2024-07-28T22:50:16+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/remote_toolchain.html</loc>
-  <lastmod>2024-07-28T22:50:16+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2024-07-28T22:50:16+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2024-07-28T22:50:16+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/native_modules.html</loc>
-  <lastmod>2024-07-28T22:50:17+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2024-07-28T22:50:17+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2024-07-28T22:50:17+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2024-07-28T22:50:17+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2024-07-28T22:50:17+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/target_instance.html</loc>
-  <lastmod>2024-07-28T22:50:18+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2024-07-28T22:50:18+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2024-07-28T22:50:18+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2024-07-28T22:50:18+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2024-07-28T22:50:18+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2024-07-28T22:50:19+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2024-07-28T22:50:19+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2024-07-28T22:50:19+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/helper_interfaces.html</loc>
-  <lastmod>2024-07-28T22:50:19+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2024-07-28T22:50:19+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_instance.html</loc>
-  <lastmod>2024-07-28T22:50:20+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/xpack.html</loc>
-  <lastmod>2024-07-28T22:50:20+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/option_instance.html</loc>
-  <lastmod>2024-07-28T22:50:20+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2024-07-28T22:50:20+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2024-07-28T22:50:20+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_3rd_source_library.html</loc>
-  <lastmod>2024-07-28T22:50:20+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package_old.html</loc>
-  <lastmod>2024-07-28T22:50:21+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2024-07-28T22:50:21+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2024-07-28T22:50:21+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2024-07-28T22:50:21+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/remote_toolchain.html</loc>
-  <lastmod>2024-07-28T22:50:21+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:57+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/toolchain/builtin_toolchains.html</loc>
-  <lastmod>2024-07-28T22:50:22+08:00</lastmod>
+  <lastmod>2024-07-28T23:13:57+08:00</lastmod>
 </url>
 
 </urlset>

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

@@ -367,6 +367,22 @@ build/
 └─ test
 ```
 
+### build.rpath
+
+配置启用或者禁用构建时的 target rpath 设置。
+
+默认情况下,如果 `target(foo)` 依赖动态库 bar,那么生成的 foo 可执行文件会自动加上 bar 的 rpath,这能保证用户直接执行 foo 程序,也能正确找到 bar。
+
+如果你想禁用这个行为,可以显式配置禁用它。
+
+### install.rpath
+
+尽管构建后的程序,会被设置 rpath,但是当 `xmake install` 安装后,它构建时候的 rpath 就不一定完全适用了,因此 xmake 会自动修改调整 rpath,使得安装后的程序,同样可以找到它的依赖库。
+
+不过前提是,用户自己先得通过 `add_rpathdirs("/xxx", {installonly = true})` 去配置独立的安装 rpath。
+
+而我们也可以通过这个 policy 去禁用默认的安装阶段 rpath 设置行为。
+
 ### run.autobuild
 
 这个策略用于调整 `xmake run` 的行为,默认情况下,执行 `xmake run` 并不会自动构建目标程序,如果程序还没被编译,就是提示用户手动构建一下。

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

@@ -1676,6 +1676,8 @@ target("test")
 
 相关背景细节见:[#5109](https://github.com/xmake-io/xmake/issues/5109)
 
+2.9.4 之后,我们新增了 `add_rpathdirs("xxx", {install_only = true})` ,可以单独配置安装后的 rpath 路径。
+
 ### target:add_includedirs
 
 #### 添加头文件搜索目录
@@ -2478,6 +2480,64 @@ target("test")
 
 除了上述两种方式,我们也可以通过`INSTALLDIR`和`DESTDIR`环境变量设置默认的安装目录。
 
+### target:set_prefixdir
+
+#### 设置安装前置子目录
+
+尽管通过 `set_installdir` 和 `xmake install -o [installdir]` 设置了安装根目录,但是如果我们还想进一步调整 bin, lib 和 include 的子路径。
+
+那么,我们可以使用这个接口,默认情况下,安装目录会按照这个结构:
+
+```bash
+installdir
+  - bin
+  - lib
+  - include
+```
+
+如果我们配置:
+
+```lua
+set_prefix("prefixdir")
+```
+
+就是增加一个总的子目录:
+
+```bash
+installdir
+  - prefixdir
+    - bin
+    - lib
+    - include
+```
+
+我们还可以单独配置 bin, lib 和 include 子目录,例如:
+
+```lua
+set_prefix("prefixdir", {bindir = "mybin", libdir = "mylib", includedir = "myinc"})
+```
+
+```bash
+installdir
+  - prefixdir
+    - mybin
+    - mylib
+    - myinc
+```
+
+如果,我们不配置 prefixdir,仅仅修改 bin 子目录,可以将 prefixdir 配置成 `/`。
+
+```lua
+set_prefix("/", {bindir = "mybin", libdir = "mylib", includedir = "myinc"})
+```
+
+```bash
+installdir
+  - mybin
+  - mylib
+  - myinc
+```
+
 ### target:add_installfiles
 
 #### 添加安装文件