From a1df6b818541aaa6b892f50f4b3c58ec76edacd1 Mon Sep 17 00:00:00 2001 From: renpeiying Date: Wed, 18 Sep 2024 16:57:39 +0800 Subject: [PATCH] docs: Update CN translation for api-guides/build-system.rst --- docs/en/api-guides/build-system.rst | 4 ++-- docs/zh_CN/api-guides/build-system.rst | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/en/api-guides/build-system.rst b/docs/en/api-guides/build-system.rst index ed9862198d..66c821acdd 100644 --- a/docs/en/api-guides/build-system.rst +++ b/docs/en/api-guides/build-system.rst @@ -247,7 +247,7 @@ These variables all have default values that can be overridden for custom behavi - ``BOOTLOADER_IGNORE_EXTRA_COMPONENT``: Optional list of components, placed in ``bootloader_components/``, that should be ignored by the bootloader compilation. Use this variable if a bootloader component needs to be included conditionally inside the project. -- ``BOOTLOADER_EXTRA_COMPONENT_DIRS``: Optional list of additional directories to search for components to be compiled as part of the bootloader. Paths can be relative to the project directory, or absolute. +- ``BOOTLOADER_EXTRA_COMPONENT_DIRS``: Optional list of additional directories to search for components to be compiled as part of the bootloader. Any paths in these variables can be absolute paths, or set relative to the project directory. @@ -791,7 +791,7 @@ Similarly to regular applications, it is possible to include external components project(main) -See :example:`custom_bootloader/bootloader_extra_dir` for an example of adding extra components the bootloader build. +See :example:`custom_bootloader/bootloader_extra_dir` for an example of adding extra components to the bootloader build. .. _config_only_component: diff --git a/docs/zh_CN/api-guides/build-system.rst b/docs/zh_CN/api-guides/build-system.rst index 05620dded9..9f90e9c122 100644 --- a/docs/zh_CN/api-guides/build-system.rst +++ b/docs/zh_CN/api-guides/build-system.rst @@ -245,7 +245,9 @@ ESP-IDF 适用于 Python 3.8 以上版本。 - ``COMPONENTS``:要构建进项目中的组件名称列表,默认为 ``COMPONENT_DIRS`` 目录下检索到的所有组件。使用此变量可以“精简”项目以缩短构建时间。请注意,如果一个组件通过 ``COMPONENT_REQUIRES`` 指定了它依赖的另一个组件,则会自动将其添加到 ``COMPONENTS`` 中,所以 ``COMPONENTS`` 列表可能会非常短。 -- ``BOOTLOADER_IGNORE_EXTRA_COMPONENT``:引导加载程序编译时应忽略的组件列表,位于 ``bootloader_components/`` 目录中。使用这一变量可以将一个组件有条件地包含在项目中。 +- ``BOOTLOADER_IGNORE_EXTRA_COMPONENT``:可选组件列表,位于 ``bootloader_components/`` 目录中,引导加载程序编译时会被忽略。使用这一变量可以将一个组件有条件地包含在项目中。 + +- ``BOOTLOADER_EXTRA_COMPONENT_DIRS``:可选目录列表,用于搜索要作为引导程序的一部分进行编译的组件。 以上变量中的路径可以是绝对路径,或者是相对于项目目录的相对路径。 @@ -781,6 +783,15 @@ KConfig.projbuild 请参考 :example:`custom_bootloader/bootloader_override` 查看覆盖默认引导加载程序的示例。 +与常规应用程序类似,通过 CMake 变量 ``BOOTLOADER_EXTRA_COMPONENT_DIRS`` 可以将不在 `bootloader_component` 中的外部组件作为引导加载程序的一部分进行构建。可以只引用一个组件,也可以引用包含多个组件的路径。例如: + + include($ENV{IDF_PATH}/tools/cmake/project.cmake) + + set(BOOTLOADER_EXTRA_COMPONENT_DIRS "/path/to/extra/component/") + + project(main) + +请参考 :example:`custom_bootloader/bootloader_extra_dir` 查看向引导加载程序构建过程添加额外组件的示例。 .. _config_only_component: