Browse Source

update docs

ruki 1 year ago
parent
commit
68ff7951fe

+ 7 - 3
manual/project_target.md

@@ -1677,11 +1677,15 @@ target("test")
 
 Specify the test program to load the dynamic library file of `lib/*.[so|dylib]` in the current execution directory, which will help to improve the portability of the program without writing dead absolute paths and relative paths, resulting in program and directory switching. Causes the program to load the dynamic library failed.
 
-<p class="tip">
-It should be noted that under macos, if the add_rpathdirs setting is in effect, you need to do some preprocessing on dylib and add the `@rpath/xxx` path setting:
+!> It should be noted that under macos, if the add_rpathdirs setting is in effect, you need to do some preprocessing on dylib and add the `@rpath/xxx` path setting:
 `$install_name_tool -add_rpath @rpath/libxxx.dylib xxx/libxxx.dylib`
 We can also check if there is a path with @rpath via `otool -L libxxx.dylib`
-</p>
+
+In addition, for gcc, `add_rpathdirs` defaults to runpath. If you want to configure it explicitly, use `-Wl,--enable-new-dtags`, `-Wl,--disable-new-dtags` to configure rpath. Or runpath
+
+We can specify it through additional parameters, `add_rpathdirs("xxx", {runpath = true})`
+
+For relevant background details, see: [#5109](https://github.com/xmake-io/xmake/issues/5109)
 
 ### target:add_includedirs
 

+ 4 - 3
mirror/manual/project_target.html

@@ -1573,9 +1573,10 @@ add_files("src/*.cpp|test.cpp|hello.cpp|xx_*.cpp")
     add_rpathdirs("@loader_path/lib")
 </code></pre>
 <p>Specify the test program to load the dynamic library file of <code>lib/*.[so|dylib]</code> in the current execution directory, which will help to improve the portability of the program without writing dead absolute paths and relative paths, resulting in program and directory switching. Causes the program to load the dynamic library failed.</p>
-<p><p class="tip"><br>It should be noted that under macos, if the add_rpathdirs setting is in effect, you need to do some preprocessing on dylib and add the <code>@rpath/xxx</code> path setting:<br><code>$install_name_tool -add_rpath @rpath/libxxx.dylib xxx/libxxx.dylib</code><br>We can also check if there is a path with @rpath via <code>otool -L libxxx.dylib</code><br></p>
-
-</p>
+<p>!> It should be noted that under macos, if the add_rpathdirs setting is in effect, you need to do some preprocessing on dylib and add the <code>@rpath/xxx</code> path setting:<br><code>$install_name_tool -add_rpath @rpath/libxxx.dylib xxx/libxxx.dylib</code><br>We can also check if there is a path with @rpath via <code>otool -L libxxx.dylib</code></p>
+<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>
 <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>

+ 5 - 6
mirror/zh-cn/manual/project_target.html

@@ -1224,9 +1224,7 @@ target("demo")
     add_deps("test1", "test2")
 </code></pre>
 <p>上面的例子,在编译目标demo的时候,需要先编译test1, test2目标,因为demo会去用到他们</p>
-<p><p class="tip"><br>target会自动继承依赖目标中的配置和属性,不需要额外调用<code>add_links</code>, <code>add_linkdirs</code>和<code>add_rpathdirs</code>等接口去关联依赖目标了。<br></p>
-
-</p>
+<p>!> target会自动继承依赖目标中的配置和属性,不需要额外调用<code>add_links</code>, <code>add_linkdirs</code>和<code>add_rpathdirs</code>等接口去关联依赖目标了。</p>
 <p>并且继承关系是支持级联的,例如:</p>
 <pre><code class="lang-lua">target("library1")
     set_kind("static")
@@ -1546,9 +1544,10 @@ add_files("src/*.cpp|test.cpp|hello.cpp|xx_*.cpp")
     add_rpathdirs("@loader_path/lib")
 </code></pre>
 <p>指定test程序加载当前执行目录下<code>lib/*.[so|dylib]</code>的动态库文件,这将有助于提升程序的可移植性,不用写死绝对路径和相对路径,导致程序和目录切换引起程序加载动态库失败。</p>
-<p><p class="tip"><br>需要注意的是,在macos下,要想add_rpathdirs设置生效,需要对dylib做一些预处理,添加<code>@rpath/xxx</code>路径设置:<br><code>$install_name_tool -add_rpath @rpath/libxxx.dylib xxx/libxxx.dylib</code><br>我们也可以通过<code>otool -L libxxx.dylib</code>查看是否存在带@rpath的路径<br></p>
-
-</p>
+<p>!> 需要注意的是,在macos下,要想 add_rpathdirs 设置生效,需要对dylib做一些预处理,添加<code>@rpath/xxx</code>路径设置:<br><code>$install_name_tool -add_rpath @rpath/libxxx.dylib xxx/libxxx.dylib</code><br>我们也可以通过<code>otool -L libxxx.dylib</code>查看是否存在带@rpath的路径</p>
+<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>
 <h3 id="targetadd_includedirs">target:add_includedirs</h3>
 <h4 id="">添加头文件搜索目录</h4>
 <p>设置头文件的搜索目录,这个接口的使用方式如下:</p>

+ 106 - 106
sitemap.xml

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

+ 8 - 6
zh-cn/manual/project_target.md

@@ -1247,9 +1247,7 @@ target("demo")
 
 上面的例子,在编译目标demo的时候,需要先编译test1, test2目标,因为demo会去用到他们
 
-<p class="tip">
-target会自动继承依赖目标中的配置和属性,不需要额外调用`add_links`, `add_linkdirs`和`add_rpathdirs`等接口去关联依赖目标了。
-</p>
+!> target会自动继承依赖目标中的配置和属性,不需要额外调用`add_links`, `add_linkdirs`和`add_rpathdirs`等接口去关联依赖目标了。
 
 并且继承关系是支持级联的,例如:
 
@@ -1668,11 +1666,15 @@ target("test")
 
 指定test程序加载当前执行目录下`lib/*.[so|dylib]`的动态库文件,这将有助于提升程序的可移植性,不用写死绝对路径和相对路径,导致程序和目录切换引起程序加载动态库失败。
 
-<p class="tip">
-需要注意的是,在macos下,要想add_rpathdirs设置生效,需要对dylib做一些预处理,添加`@rpath/xxx`路径设置:
+!> 需要注意的是,在macos下,要想 add_rpathdirs 设置生效,需要对dylib做一些预处理,添加`@rpath/xxx`路径设置:
 `$install_name_tool -add_rpath @rpath/libxxx.dylib xxx/libxxx.dylib`
 我们也可以通过`otool -L libxxx.dylib`查看是否存在带@rpath的路径
-</p>
+
+另外,对于 gcc, `add_rpathdirs` 默认设置的是 runpath,如果想要显式的配置上 `-Wl,--enable-new-dtags`, `-Wl,--disable-new-dtags` 去配置 rpath 还是 runpath
+
+我们可以通过额外的参数指定,`add_rpathdirs("xxx", {runpath = true})`
+
+相关背景细节见:[#5109](https://github.com/xmake-io/xmake/issues/5109)
 
 ### target:add_includedirs