mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'docs/update_build_system' into 'master'
docs: udpate CN translation for build-system See merge request espressif/esp-idf!18378
This commit is contained in:
commit
b264d46d20
@ -928,9 +928,9 @@ Custom sdkconfig defaults
|
||||
|
||||
For example projects or other projects where you don't want to specify a full sdkconfig configuration, but you do want to override some key values from the ESP-IDF defaults, it is possible to create a file ``sdkconfig.defaults`` in the project directory. This file will be used when creating a new config from scratch, or when any new config value hasn't yet been set in the ``sdkconfig`` file.
|
||||
|
||||
To override the name of this file or to specify multiple files, set the ``SDKCONFIG_DEFAULTS`` environment variable or set ``SDKCONFIG_DEFAULTS`` in top-level CMakeLists.txt. File names not specified as full paths are resolved relative to current project.
|
||||
To override the name of this file or to specify multiple files, set the ``SDKCONFIG_DEFAULTS`` environment variable or set ``SDKCONFIG_DEFAULTS`` in top-level ``CMakeLists.txt``. File names that are not specified as full paths are resolved relative to current project's diretory.
|
||||
|
||||
If specifying multiple files, use semicolon as the list separator. Files listed first will be applied first. If there is a key with different values existing in different default files, the value in latter file of the list will override the value in the former file.
|
||||
When specifying multiple files, use a semicolon as the list separator. Files listed first will be applied first. If a particular key is defined in multiple files, the definition in the latter file will overide definitions from former files.
|
||||
|
||||
Some of the IDF examples include a ``sdkconfig.ci`` file. This is part of the continuous integration (CI) test framework and is ignored by the normal build process.
|
||||
|
||||
@ -1478,6 +1478,7 @@ No Longer Necessary
|
||||
|
||||
- In the legacy Make-based build system, it is required to also set ``COMPONENT_SRCDIRS`` if ``COMPONENT_SRCS`` is set. In CMake, the equivalent is not necessary i.e. specifying ``SRC_DIRS`` to ``idf_component_register`` if ``SRCS`` is also specified (in fact, ``SRCS`` is ignored if ``SRC_DIRS`` is specified).
|
||||
|
||||
|
||||
Flashing from make
|
||||
------------------
|
||||
|
||||
|
@ -664,7 +664,7 @@ KConfig.projbuild
|
||||
CMake 调试
|
||||
----------
|
||||
|
||||
请查看 `CMake v3.5 官方文档`_ 获取更多关于 CMake_ 和 CMake 命令的信息。
|
||||
请查看 `CMake v3.16 官方文档`_ 获取更多关于 CMake_ 和 CMake 命令的信息。
|
||||
|
||||
调试 ESP-IDF CMake 构建系统的一些技巧:
|
||||
|
||||
@ -928,7 +928,9 @@ ExternalProject 的依赖与构建清理
|
||||
|
||||
对于示例工程或者其他您不想指定完整 sdkconfig 配置的项目,但是您确实希望覆盖 ESP-IDF 默认值中的某些键值,则可以在项目中创建 ``sdkconfig.defaults`` 文件。重新创建新配置时将会用到此文件,另外在 ``sdkconfig`` 没有设置新配置值时,上述文件也会被用到。
|
||||
|
||||
如若需要覆盖此文件的名称或指定多个文件,请设置 ``SDKCONFIG_DEFAULTS`` 环境变量或在顶层 CMakeLists.txt 文件中设置 ``SDKCONFIG_DEFAULTS``。在指定多个文件时,使用分号作为分隔符。未指定完整路径的文件名将以当前项目的相对路径来解析。
|
||||
如若需要覆盖此文件的名称或指定多个文件,请设置 ``SDKCONFIG_DEFAULTS`` 环境变量或在顶层 CMakeLists.txt 文件中设置 ``SDKCONFIG_DEFAULTS``。非绝对路径的文件名将以当前项目的相对路径来解析。
|
||||
|
||||
在指定多个文件时,使用分号作为分隔符。先列出的文件将会先应用。如果某个键值在多个文件里定义,后面文件的定义会覆盖前面文件的定义。
|
||||
|
||||
一些 IDF 示例中包含了 ``sdkconfig.ci`` 文件。该文件是 CI(持续集成)测试框架的一部分,在正常构建过程中会被忽略。
|
||||
|
||||
@ -937,7 +939,9 @@ ExternalProject 的依赖与构建清理
|
||||
|
||||
除了 ``sdkconfig.defaults`` 之外,构建系统还将从 ``sdkconfig.defaults.TARGET_NAME`` 文件加载默认值,其中 ``IDF_TARGET`` 的值为 ``TARGET_NAME``。例如,对于 ``ESP32`` 这个硬件目标,sdkconfig 的默认值会首先从 ``sdkconfig.defaults`` 获取,然后再从 ``sdkconfig.defaults.esp32`` 获取。
|
||||
|
||||
如果使用 ``SDKCONFIG_DEFAULTS`` 覆盖了 sdkconfig 默认文件的名称,则硬件目标的 sdkconfig 默认文件名也会从 ``SDKCONFIG_DEFAULTS`` 值中派生。
|
||||
如果使用 ``SDKCONFIG_DEFAULTS`` 覆盖默认文件的名称,则硬件目标的默认文件名也会从 ``SDKCONFIG_DEFAULTS`` 值中派生。如果 ``SDKCONFIG_DEFAULTS`` 中有多个文件,硬件目标文件会在引入该硬件目标文件的文件之后应用, 而 ``SDKCONFIG_DEFAULTS`` 中所有其它后续文件则会在硬件目标文件之后应用 。
|
||||
|
||||
例如,如果 ``SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig_devkit1"``,并且在同一文件夹中有一个 ``sdkconfig.defaults.esp32`` 文件,那么这些文件将按以下顺序应用:(1) sdkconfig.defaults (2) sdkconfig.defaults.esp32 (3) sdkconfig_devkit1。
|
||||
|
||||
.. _flash_parameters:
|
||||
|
||||
@ -1179,6 +1183,7 @@ idf 构建属性
|
||||
- EXECUTABLE - 项目可执行文件;通过调用 ``idf_build_executable`` 设置。
|
||||
- EXECUTABLE_NAME - 不含扩展名的项目可执行文件的名称;通过调用 ``idf_build_executable`` 设置。
|
||||
- EXECUTABLE_DIR - 输出的可执行文件的路径
|
||||
- IDF_COMPONENT_MANAGER - 默认启用组件管理器,但如果设置这个属性为`0``,则会被 IDF_COMPONENT_MANAGER 环境变量禁用。
|
||||
- IDF_PATH - ESP-IDF 路径;由 IDF_PATH 环境变量设置,或者从 ``idf.cmake`` 的位置推断。
|
||||
- IDF_TARGET - 构建的目标芯片;由 ``idf_build_process`` 的目标参数设置。
|
||||
- IDF_VER - ESP-IDF 版本;由版本文件或 IDF_PATH 仓库的 Git 版本设置。
|
||||
@ -1279,10 +1284,12 @@ idf 组件属性
|
||||
- KCONFIG - 组件 Kconfig 文件;由 ``idf_build_component`` 设置。
|
||||
- KCONFIG_PROJBUILD - 组件 Kconfig.projbuild;由 ``idf_build_component`` 设置。
|
||||
- LDFRAGMENTS - 组件链接器片段文件列表;由 ``idf_component_register`` LDFRAGMENTS 参数设置。
|
||||
- MANAGED_PRIV_REQUIRES - IDF 组件管理器从``idf_component.yml``清单文件中的依赖关系中添加的私有组件依赖关系列表。
|
||||
- MANAGED_REQUIRES - IDF 组件管理器从 ``idf_component.yml`` 清单文件的依赖关系中添加的公共组件依赖关系列表。
|
||||
- PRIV_INCLUDE_DIRS - 组件私有 include 目录列表;在 LIBRARY 类型的组件 ``idf_component_register`` PRIV_INCLUDE_DIRS 参数中设置。
|
||||
- PRIV_REQUIRES - 私有组件依赖关系列表;由 ``idf_component_register`` PRIV_REQUIRES 参数设置。
|
||||
- PRIV_REQUIRES - 私有组件依赖关系列表;根据 ``idf_component_register`` PRIV_REQUIRES 参数的值以及 ``idf_component.yml`` 清单文件中的依赖关系设置。
|
||||
- REQUIRED_IDF_TARGETS - 组件支持的目标列表;由 ``idf_component_register`` EMBED_TXTFILES 参数设置。
|
||||
- REQUIRES - 公共组件依赖关系列表;由 ``idf_component_register`` REQUIRES 参数设置。
|
||||
- REQUIRES - 公共组件依赖关系列表;根据 ``idf_component_register`` REQUIRES 参数的值以及 ``idf_component.yml`` 清单文件中的依赖关系设置。
|
||||
- SRCS - 组件源文件列表;由 ``idf_component_register`` 的 SRCS 或 SRC_DIRS/EXCLUDE_SRCS 参数设置。
|
||||
- WHOLE_ARCHIVE - 如果该属性被设置为 ``TRUE`` (或是其他 CMake 布尔“真”值:1、``ON``、``YES``、``Y`` 等),链接时会在组件库的前后分别添加 ``-Wl,--whole-archive`` 和 ``-Wl,--no-whole-archive`` 选项。这可以强制链接器将每个目标文件包含到可执行文件中,即使该目标文件没有解析来自应用程序其余部分的任何引用。当组件中包含依赖链接时注册的插件或模块时,通常会使用该方法。默认情况下,此属性为 ``FALSE``。可以从组件的 CMakeLists.txt 文件中将其设置为 ``TRUE``。
|
||||
|
||||
@ -1471,6 +1478,7 @@ CMake 中不可用的功能
|
||||
|
||||
在 CMake 构建系统中,如果设置了 ``COMPONENT_SRCS``,就不需要再设置 ``COMPONENT_SRCDIRS``。实际上,CMake 构建系统中如果设置了 ``COMPONENT_SRCDIRS``,那么 ``COMPONENT_SRCS`` 就会被忽略。
|
||||
|
||||
|
||||
从 Make 中烧录
|
||||
--------------
|
||||
|
||||
@ -1480,23 +1488,23 @@ CMake 中不可用的功能
|
||||
.. _Cmake: https://cmake.org
|
||||
.. _ninja: https://ninja-build.org
|
||||
.. _esptool.py: https://github.com/espressif/esptool/#readme
|
||||
.. _CMake v3.5 官方文档: https://cmake.org/cmake/help/v3.5/index.html
|
||||
.. _cmake 命令行文档: https://cmake.org/cmake/help/v3.5/manual/cmake.1.html#options
|
||||
.. _cmake add_library: https://cmake.org/cmake/help/v3.5/command/add_library.html
|
||||
.. _cmake if: https://cmake.org/cmake/help/v3.5/command/if.html
|
||||
.. _cmake list: https://cmake.org/cmake/help/v3.5/command/list.html
|
||||
.. _cmake project: https://cmake.org/cmake/help/v3.5/command/project.html
|
||||
.. _cmake set: https://cmake.org/cmake/help/v3.5/command/set.html
|
||||
.. _cmake string: https://cmake.org/cmake/help/v3.5/command/string.html
|
||||
.. _CMake v3.16 官方文档: https://cmake.org/cmake/help/v3.16/index.html
|
||||
.. _cmake 命令行文档: https://cmake.org/cmake/help/v3.16/manual/cmake.1.html#options
|
||||
.. _cmake add_library: https://cmake.org/cmake/help/v3.16/command/add_library.html
|
||||
.. _cmake if: https://cmake.org/cmake/help/v3.16/command/if.html
|
||||
.. _cmake list: https://cmake.org/cmake/help/v3.16/command/list.html
|
||||
.. _cmake project: https://cmake.org/cmake/help/v3.16/command/project.html
|
||||
.. _cmake set: https://cmake.org/cmake/help/v3.16/command/set.html
|
||||
.. _cmake string: https://cmake.org/cmake/help/v3.16/command/string.html
|
||||
.. _cmake faq generated files: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#how-can-i-generate-a-source-file-during-the-build
|
||||
.. _ADDITIONAL_MAKE_CLEAN_FILES: https://cmake.org/cmake/help/v3.5/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.html
|
||||
.. _ExternalProject: https://cmake.org/cmake/help/v3.5/module/ExternalProject.html
|
||||
.. _cmake language variables: https://cmake.org/cmake/help/v3.5/manual/cmake-variables.7.html#variables-for-languages
|
||||
.. _set_source_files_properties: https://cmake.org/cmake/help/v3.5/command/set_source_files_properties.html
|
||||
.. _target_compile_options: https://cmake.org/cmake/help/v3.5/command/target_compile_options.html
|
||||
.. _target_link_libraries: https://cmake.org/cmake/help/v3.5/command/target_link_libraries.html#command:target_link_libraries
|
||||
.. _cmake_toolchain_file: https://cmake.org/cmake/help/v3.5/variable/CMAKE_TOOLCHAIN_FILE.html
|
||||
.. _LINK_INTERFACE_MULTIPLICITY: https://cmake.org/cmake/help/v3.5/prop_tgt/LINK_INTERFACE_MULTIPLICITY.html
|
||||
.. _ADDITIONAL_MAKE_CLEAN_FILES: https://cmake.org/cmake/help/v3.16/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.html
|
||||
.. _ExternalProject: https://cmake.org/cmake/help/v3.16/module/ExternalProject.html
|
||||
.. _cmake language variables: https://cmake.org/cmake/help/v3.16/manual/cmake-variables.7.html#variables-for-languages
|
||||
.. _set_source_files_properties: https://cmake.org/cmake/help/v3.16/command/set_source_files_properties.html
|
||||
.. _target_compile_options: https://cmake.org/cmake/help/v3.16/command/target_compile_options.html
|
||||
.. _target_link_libraries: https://cmake.org/cmake/help/v3.16/command/target_link_libraries.html#command:target_link_libraries
|
||||
.. _cmake_toolchain_file: https://cmake.org/cmake/help/v3.16/variable/CMAKE_TOOLCHAIN_FILE.html
|
||||
.. _LINK_INTERFACE_MULTIPLICITY: https://cmake.org/cmake/help/v3.16/prop_tgt/LINK_INTERFACE_MULTIPLICITY.html
|
||||
.. _quirc: https://github.com/dlbeer/quirc
|
||||
.. _pyenv: https://github.com/pyenv/pyenv#readme
|
||||
.. _virtualenv: https://virtualenv.pypa.io/en/stable/
|
||||
|
Loading…
Reference in New Issue
Block a user