mirror of
https://github.com/esphome/esphome.git
synced 2025-09-06 21:32:21 +01:00
Don't compile unnecessary platform files (e.g. ESP8266 files on ESP32) (#9354)
This commit is contained in:
@@ -2,6 +2,7 @@ import re
|
||||
|
||||
from esphome import automation, pins
|
||||
import esphome.codegen as cg
|
||||
from esphome.config_helpers import filter_source_files_from_platform
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import (
|
||||
CONF_AFTER,
|
||||
@@ -27,6 +28,7 @@ from esphome.const import (
|
||||
CONF_TX_PIN,
|
||||
CONF_UART_ID,
|
||||
PLATFORM_HOST,
|
||||
PlatformFramework,
|
||||
)
|
||||
from esphome.core import CORE
|
||||
import esphome.final_validate as fv
|
||||
@@ -438,3 +440,19 @@ async def uart_write_to_code(config, action_id, template_arg, args):
|
||||
else:
|
||||
cg.add(var.set_data_static(data))
|
||||
return var
|
||||
|
||||
|
||||
FILTER_SOURCE_FILES = filter_source_files_from_platform(
|
||||
{
|
||||
"uart_component_esp32_arduino.cpp": {PlatformFramework.ESP32_ARDUINO},
|
||||
"uart_component_esp_idf.cpp": {PlatformFramework.ESP32_IDF},
|
||||
"uart_component_esp8266.cpp": {PlatformFramework.ESP8266_ARDUINO},
|
||||
"uart_component_host.cpp": {PlatformFramework.HOST_NATIVE},
|
||||
"uart_component_rp2040.cpp": {PlatformFramework.RP2040_ARDUINO},
|
||||
"uart_component_libretiny.cpp": {
|
||||
PlatformFramework.BK72XX_ARDUINO,
|
||||
PlatformFramework.RTL87XX_ARDUINO,
|
||||
PlatformFramework.LN882X_ARDUINO,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user