docs: update warning on undefined variables in api-guides/build-system

pull/9839/head
Linda 2022-10-12 14:39:53 +08:00
rodzic 1bbd524a7c
commit 0a8a67ecd0
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -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.

Wyświetl plik

@ -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/` 中支持的函数。