From 0a8a67ecd0c9428f94c8a9b18b535d91f074bf48 Mon Sep 17 00:00:00 2001 From: Linda Date: Wed, 12 Oct 2022 14:39:53 +0800 Subject: [PATCH] docs: update warning on undefined variables in api-guides/build-system --- docs/en/api-guides/build-system.rst | 4 ++-- docs/zh_CN/api-guides/build-system.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/api-guides/build-system.rst b/docs/en/api-guides/build-system.rst index c7d83fd760..afa8369351 100644 --- a/docs/en/api-guides/build-system.rst +++ b/docs/en/api-guides/build-system.rst @@ -696,9 +696,9 @@ It also defines an overridden custom version of the built-in CMake_ ``project`` Warning On Undefined Variables ------------------------------ -By default, ``idf.py`` passes the ``--warn-uninitialized`` flag to CMake_ so it will print a warning if an undefined variable is referenced in the build. This can be very useful to find buggy CMake files. +By default, the function of warnings on undefined variables is disabled. -If you don't want this behaviour, it can be disabled by passing ``--no-warnings`` to ``idf.py``. +To enable this function, we can pass the ``--warn-uninitialized`` flag to CMake_ or pass the ``--cmake-warn-uninitialized`` flag to ``idf.py`` so it will print a warning if an undefined variable is referenced in the build. This can be very useful to find buggy CMake files. Browse the :idf_file:`/tools/cmake/project.cmake` file and supporting functions in :idf:`/tools/cmake/` for more details. diff --git a/docs/zh_CN/api-guides/build-system.rst b/docs/zh_CN/api-guides/build-system.rst index 88805f721e..e449ddf566 100644 --- a/docs/zh_CN/api-guides/build-system.rst +++ b/docs/zh_CN/api-guides/build-system.rst @@ -696,9 +696,9 @@ CMake 调试 警告未定义的变量 ------------------ -默认情况下,``idf.py`` 在调用 CMake_ 时会给它传递 ``--warn-uninitialized`` 标志,如果在构建的过程中引用了未定义的变量,CMake_ 会打印警告。这对查找有错误的 CMake 文件非常有用。 +默认情况下,警告未定义的变量这一功能是关闭的。 -如果您不想启用此功能,可以给 ``idf.py`` 传递 ``--no-warnings`` 标志。 +可通过将 ``--warn-uninitialized`` 标志传递给 CMake_ 或通过将 ``--cmake-warn-uninitialized`` 传递给 ``idf.py`` 来使能这一功能。这样,如果在构建的过程中引用了未定义的变量,CMake_ 会打印警告。这对查找有错误的 CMake 文件非常有用。 更多信息,请参考文件 :idf_file:`/tools/cmake/project.cmake` 以及 :idf:`/tools/cmake/` 中支持的函数。