# ESP-IDF: Propagating compiler flags to ExternalProject builds

DevFeed: [ESP-IDF: Propagating compiler flags to ExternalProject builds](<https://devfeed.tech/articles/esp-idf-propagating-compiler-flags-to-externalproject-builds-13766.md>)

Original publisher: [Read original article](<https://developer.espressif.com/blog/2026/04/propagating-compiler-flags-to-externalproject/>)

Author: John Lee

Published: 2026-04-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Blog on Developer Portal](<https://devfeed.tech/sources/blog-on-developer-portal.md>)

Topics: [ESP-IDF](<https://devfeed.tech/topics/esp-idf.md>), [CMake](<https://devfeed.tech/topics/cmake.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [build](<https://devfeed.tech/tags/build.md>), [build-system](<https://devfeed.tech/tags/build-system.md>), [cmake](<https://devfeed.tech/tags/cmake.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compiler-flags](<https://devfeed.tech/tags/compiler-flags.md>), [esp-idf](<https://devfeed.tech/tags/esp-idf.md>)

## AI overview

This ESP-IDF post explains why compiler options driven by Kconfig and components do not automatically propagate to ExternalProject_Add() builds. It describes using response files tied to the appropriate build context to keep compiler flags aligned between the outer and nested CMake projects.

## Source excerpt

When an ESP-IDF project uses ExternalProject_Add(), compiler options driven by Kconfig and components do not flow into the nested build on their own. This post walks through why that happens and how to keep the outer and inner CMake worlds aligned.