Merge branch 'bugfix/idf_py_disable_cmake_warnings_default' into 'master'

idf.py: disable cmake uninitialized variable warnings by default

Closes IDF-2026 and IDFGH-3847

See merge request espressif/esp-idf!10149
This commit is contained in:
Angus Gratton 2020-08-26 16:46:21 +08:00
commit 96b3e7f405
3 changed files with 7 additions and 4 deletions

View File

@ -113,8 +113,9 @@ Here is a list of some useful options:
- ``-B <dir>`` allows overriding the build directory from the default ``build`` subdirectory of the project directory.
- ``--ccache`` flag can be used to enable CCache_ when compiling source files, if the CCache_ tool is installed. This can dramatically reduce some build times.
Note that some older versions of CCache may exhibit bugs on some platforms, so if files are not rebuilt as expected then try disabling ccache and build again. CCache can be enabled by default by setting the ``IDF_ENABLE_CCACHE`` environment variable to a non-zero value.
Note that some older versions of CCache may exhibit bugs on some platforms, so if files are not rebuilt as expected then try disabling ccache and build again. CCache can be enabled by default by setting the ``IDF_CCACHE_ENABLE`` environment variable to a non-zero value.
- ``-v`` flag causes both ``idf.py`` and the build system to produce verbose build output. This can be useful for debugging build problems.
- ``--cmake-warn-uninitialized`` (or ``-w``) will cause CMake to print uninitialized variable warnings inside the project directory (not for directories not found inside the project directory). This only controls CMake variable warnings inside CMake itself, not other types of build warnings. This option can also be set permanently by setting the ``IDF_CMAKE_WARN_UNINITIALIZED`` environment variable to a non-zero value.
Using CMake Directly
--------------------

View File

@ -221,8 +221,10 @@ def action_extensions(base_actions, project_path):
"default": None,
},
{
"names": ["-n", "--no-warnings"],
"help": "Disable Cmake warnings.",
"names": ["-w/-n", "--cmake-warn-uninitialized/--no-warnings"],
"help": ("Enable CMake uninitialized variable warnings for CMake files inside the project directory. "
"(--no-warnings is now the default, and doesn't need to be specified.)"),
"envvar": "IDF_CMAKE_WARN_UNINITIALIZED",
"is_flag": True,
"default": False,
},

View File

@ -200,7 +200,7 @@ def ensure_build_directory(args, prog_name, always_run_cmake=False):
"-DPYTHON_DEPS_CHECKED=1",
"-DESP_PLATFORM=1",
]
if not args.no_warnings:
if args.cmake_warn_uninitialized:
cmake_args += ["--warn-uninitialized"]
if args.define_cache_entry: