diff --git a/docs/en/api-guides/build-system.rst b/docs/en/api-guides/build-system.rst index fc2c7f21d3..38e943a729 100644 --- a/docs/en/api-guides/build-system.rst +++ b/docs/en/api-guides/build-system.rst @@ -111,6 +111,7 @@ To list all available options, run ``idf.py --help``. 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. - ``-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 -------------------- diff --git a/tools/idf.py b/tools/idf.py index ce37a6cec8..bba2ac12c2 100755 --- a/tools/idf.py +++ b/tools/idf.py @@ -242,7 +242,7 @@ def _ensure_build_directory(args, 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"] cmake_args += ["-DWARN_UNINITIALIZED=1"] @@ -998,8 +998,10 @@ def init_cli(): "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, },