mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat: add compile_options support to idf.py build-file
Allow specifying extra compiler flags (warning flags, preprocessor definitions, etc.) via a new 'compile_options' entry in the idf-build-file frontmatter. The options are applied to the source file via target_compile_options in the generated main component CMakeLists, with CMake quoting so that flags like -DMSG="hello world" reach the compiler exactly as written. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
16275df0a1
commit
b3a0e166fe
@@ -67,6 +67,17 @@
|
||||
- CONFIG_IDF_TARGET=esp32s3
|
||||
- CONFIG_SPIRAM=y
|
||||
|
||||
``compile_options``
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
编译源文件时使用的额外编译器选项列表,例如警告标志或预处理器定义。
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
compile_options:
|
||||
- -Wconversion
|
||||
- -DBUFFER_SIZE=1024
|
||||
|
||||
``dependencies``
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user