feat: introduce esp-idf-configdep as a build optimization

The esp-idf-configdep utility works as a compiler wrapper. It lets the
compiler compile the app and checks whether -MF option was used to
generate dependency files. If yes, it checks for sdkconfig.h dependency
in those files.

Target file depending on sdkconfig.h is then scanned for all CONFIG_*
occurrences and the dependency file is altered so that the given target
file is marked as "dirty" only if the config options it actually uses
are changed.

This ensures that after a configuration update, only affected files are
rebuilt, reducing incremental build times.

The compiler launcher mechanism is changed from RULE_LAUNCH_COMPILE
(Makefile-only) to CMAKE_*_COMPILER_LAUNCHER (generator-agnostic),
enabling launcher chaining (configdep -> ccache -> compiler).

Made-with: Cursor
This commit is contained in:
Jan Beran
2026-06-02 01:26:10 +08:00
committed by BOT
parent 2e2909506f
commit 9522af1d8f
10 changed files with 335 additions and 12 deletions
+1
View File
@@ -788,6 +788,7 @@ def ensure_build_directory(
cache = _parse_cmakecache(cache_path) if os.path.exists(cache_path) else {}
args.define_cache_entry.append(f'CCACHE_ENABLE={args.ccache}')
args.define_cache_entry.append(f'CONFIGDEP_ENABLE={args.configdep}')
cache_cmdl = _parse_cmdl_cmakecache(args.define_cache_entry)