Support clang-tidy for ESP32 variants (#3001)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
; It's *not* used during runtime.
|
||||
|
||||
[platformio]
|
||||
default_envs = esp8266, esp32, esp32-idf
|
||||
default_envs = esp8266-arduino, esp32-arduino, esp32-idf
|
||||
; Ideally, we want src_dir to be the root directory of the repository, to mimic the runtime build
|
||||
; environment as best as possible. Unfortunately, the ESP-IDF toolchain really doesn't like this
|
||||
; being the root directory. Instead, set esphome/ as the source directory, all our sources are in
|
||||
@@ -13,14 +13,14 @@ default_envs = esp8266, esp32, esp32-idf
|
||||
src_dir = esphome
|
||||
include_dir = .
|
||||
|
||||
[runtime]
|
||||
; This are the flags as set by the runtime.
|
||||
; This are just the build flags as set by the runtime.
|
||||
[flags:runtime]
|
||||
build_flags =
|
||||
-Wno-unused-but-set-variable
|
||||
-Wno-sign-compare
|
||||
|
||||
[clangtidy]
|
||||
; This are the flags for clang-tidy.
|
||||
; This are just the build flags for clang-tidy.
|
||||
[flags:clangtidy]
|
||||
build_flags =
|
||||
-Wall
|
||||
-Wextra
|
||||
@@ -30,6 +30,7 @@ build_flags =
|
||||
-Wshadow-field-in-constructor
|
||||
-Wshadow-uncaptured-local
|
||||
|
||||
; This are common settings for all environments.
|
||||
[common]
|
||||
lib_deps =
|
||||
esphome/noise-c@0.1.4 ; api
|
||||
@@ -43,6 +44,7 @@ src_filter =
|
||||
+<../tests/dummy_main.cpp>
|
||||
+<../.temp/all-include.cpp>
|
||||
|
||||
; This are common settings for all Arduino-framework based environments.
|
||||
[common:arduino]
|
||||
extends = common
|
||||
lib_deps =
|
||||
@@ -62,13 +64,15 @@ build_flags =
|
||||
${common.build_flags}
|
||||
-DUSE_ARDUINO
|
||||
|
||||
; This are common settings for all IDF-framework based environments.
|
||||
[common:idf]
|
||||
extends = common
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
-DUSE_ESP_IDF
|
||||
|
||||
[common:esp8266]
|
||||
; This are common settings for the ESP8266 using Arduino.
|
||||
[common:esp8266-arduino]
|
||||
extends = common:arduino
|
||||
; when changing this also copy it to esphome-docker-base images
|
||||
platform = platformio/espressif8266 @ 3.2.0
|
||||
@@ -76,7 +80,6 @@ platform_packages =
|
||||
platformio/framework-arduinoespressif8266 @ ~3.30002.0
|
||||
|
||||
framework = arduino
|
||||
board = nodemcuv2
|
||||
lib_deps =
|
||||
${common:arduino.lib_deps}
|
||||
ESP8266WiFi ; wifi (Arduino built-in)
|
||||
@@ -87,6 +90,7 @@ build_flags =
|
||||
-DUSE_ESP8266
|
||||
-DUSE_ESP8266_FRAMEWORK_ARDUINO
|
||||
|
||||
; This are common settings for the ESP32 (all variants) using Arduino.
|
||||
[common:esp32-arduino]
|
||||
extends = common:arduino
|
||||
; when changing this also copy it to esphome-docker-base images
|
||||
@@ -104,6 +108,7 @@ build_flags =
|
||||
-DUSE_ESP32
|
||||
-DUSE_ESP32_FRAMEWORK_ARDUINO
|
||||
|
||||
; This are common settings for the ESP32 (all variants) using IDF.
|
||||
[common:esp32-idf]
|
||||
extends = common:idf
|
||||
; when changing this also copy it to esphome-docker-base images
|
||||
@@ -112,7 +117,6 @@ platform_packages =
|
||||
platformio/framework-espidf @ ~3.40300.0
|
||||
|
||||
framework = espidf
|
||||
board = nodemcu-32s
|
||||
lib_deps =
|
||||
${common:idf.lib_deps}
|
||||
espressif/esp32-camera@1.0.0 ; esp32_camera
|
||||
@@ -122,40 +126,79 @@ build_flags =
|
||||
-DUSE_ESP32
|
||||
-DUSE_ESP32_FRAMEWORK_ESP_IDF
|
||||
|
||||
[env:esp8266]
|
||||
extends = common:esp8266
|
||||
; All the actual environments are defined below.
|
||||
[env:esp8266-arduino]
|
||||
extends = common:esp8266-arduino
|
||||
board = nodemcuv2
|
||||
build_flags =
|
||||
${common:esp8266.build_flags}
|
||||
${runtime.build_flags}
|
||||
${common:esp8266-arduino.build_flags}
|
||||
${flags:runtime.build_flags}
|
||||
|
||||
[env:esp8266-tidy]
|
||||
extends = common:esp8266
|
||||
[env:esp8266-arduino-tidy]
|
||||
extends = common:esp8266-arduino
|
||||
board = nodemcuv2
|
||||
build_flags =
|
||||
${common:esp8266.build_flags}
|
||||
${clangtidy.build_flags}
|
||||
${common:esp8266-arduino.build_flags}
|
||||
${flags:clangtidy.build_flags}
|
||||
|
||||
[env:esp32]
|
||||
[env:esp32-arduino]
|
||||
extends = common:esp32-arduino
|
||||
board = esp32dev
|
||||
build_flags =
|
||||
${common:esp32-arduino.build_flags}
|
||||
${runtime.build_flags}
|
||||
${flags:runtime.build_flags}
|
||||
|
||||
[env:esp32-tidy]
|
||||
[env:esp32-arduino-tidy]
|
||||
extends = common:esp32-arduino
|
||||
board = esp32dev
|
||||
build_flags =
|
||||
${common:esp32-arduino.build_flags}
|
||||
${clangtidy.build_flags}
|
||||
${flags:clangtidy.build_flags}
|
||||
|
||||
[env:esp32-idf]
|
||||
extends = common:esp32-idf
|
||||
board = esp32dev
|
||||
board_build.esp-idf.sdkconfig_path = .temp/sdkconfig-esp32-idf
|
||||
build_flags =
|
||||
${common:esp32-idf.build_flags}
|
||||
${runtime.build_flags}
|
||||
${flags:runtime.build_flags}
|
||||
|
||||
[env:esp32-idf-tidy]
|
||||
extends = common:esp32-idf
|
||||
board = esp32dev
|
||||
board_build.esp-idf.sdkconfig_path = .temp/sdkconfig-esp32-idf-tidy
|
||||
build_flags =
|
||||
${common:esp32-idf.build_flags}
|
||||
${clangtidy.build_flags}
|
||||
${flags:clangtidy.build_flags}
|
||||
|
||||
[env:esp32c3-idf]
|
||||
extends = common:esp32-idf
|
||||
board = esp32-c3-devkitm-1
|
||||
board_build.esp-idf.sdkconfig_path = .temp/sdkconfig-esp32c3-idf
|
||||
build_flags =
|
||||
${common:esp32-idf.build_flags}
|
||||
${flags:runtime.build_flags}
|
||||
|
||||
[env:esp32c3-idf-tidy]
|
||||
extends = common:esp32-idf
|
||||
board = esp32-c3-devkitm-1
|
||||
board_build.esp-idf.sdkconfig_path = .temp/sdkconfig-esp32c3-idf-tidy
|
||||
build_flags =
|
||||
${common:esp32-idf.build_flags}
|
||||
${flags:clangtidy.build_flags}
|
||||
|
||||
[env:esp32s2-idf]
|
||||
extends = common:esp32-idf
|
||||
board = esp32-s2-kaluga-1
|
||||
board_build.esp-idf.sdkconfig_path = .temp/sdkconfig-esp32s2-idf
|
||||
build_flags =
|
||||
${common:esp32-idf.build_flags}
|
||||
${flags:runtime.build_flags}
|
||||
|
||||
[env:esp32s2-idf-tidy]
|
||||
extends = common:esp32-idf
|
||||
board = esp32-s2-kaluga-1
|
||||
board_build.esp-idf.sdkconfig_path = .temp/sdkconfig-esp32s2-idf-tidy
|
||||
build_flags =
|
||||
${common:esp32-idf.build_flags}
|
||||
${flags:clangtidy.build_flags}
|
||||
|
||||
Reference in New Issue
Block a user