mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-19 23:45:28 +02:00
docs: update CN translation for build-system.rst
This commit is contained in:
committed by
Ivan Grokhotkov
parent
d89652b382
commit
256c8a103e
@@ -605,6 +605,23 @@ CMake 通常会在链接器命令行上重复两次组件库名称来自动处
|
||||
- 项目导入 :ref:`project_include.cmake` 文件的顺序。
|
||||
- 生成用于编译(通过 ``-I`` 参数)的头文件路径列表的顺序。请注意,对于给定组件的源文件,仅需将该组件的依赖组件的头文件路径告知编译器。
|
||||
|
||||
添加链接时依赖项
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. highlight:: cmake
|
||||
|
||||
ESP-IDF 的 CMake 辅助函数 ``idf_component_add_link_dependency`` 可以在组件之间添加仅作用于链接时的依赖关系。绝大多数情况下,我们都建议您使用 ``idf_component_register`` 中的 ``PRIV_REQUIRES`` 功能来构建依赖关系。然而在某些情况下,还是有必要添加另一个组件对当前组件的链接时依赖,即反转 ``PRIV_REQUIRES`` 中的依赖关系(参考示例::doc:`/api-reference/storage/spi_flash_override_driver`)。
|
||||
|
||||
要使另一个组件在链接时依赖于这个组件::
|
||||
|
||||
idf_component_add_link_dependency(FROM other_component)
|
||||
|
||||
请将上述行置于 ``idf_component_register`` 行之后。
|
||||
|
||||
也可以通过名称指定两个组件::
|
||||
|
||||
idf_component_add_link_dependency(FROM other_component TO that_component)
|
||||
|
||||
.. _override_project_config:
|
||||
|
||||
覆盖项目的部分设置
|
||||
|
||||
Reference in New Issue
Block a user