mirror of
https://github.com/esphome/esphome.git
synced 2025-10-16 16:53:47 +01:00
Don't compile unnecessary platform files (e.g. ESP8266 files on ESP32) (#9354)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import esphome.codegen as cg
|
||||
from esphome.components.esp32 import add_idf_component
|
||||
from esphome.config_helpers import filter_source_files_from_platform
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import (
|
||||
CONF_DISABLED,
|
||||
@@ -8,6 +9,7 @@ from esphome.const import (
|
||||
CONF_PROTOCOL,
|
||||
CONF_SERVICE,
|
||||
CONF_SERVICES,
|
||||
PlatformFramework,
|
||||
)
|
||||
from esphome.core import CORE, coroutine_with_priority
|
||||
|
||||
@@ -108,3 +110,21 @@ async def to_code(config):
|
||||
)
|
||||
|
||||
cg.add(var.add_extra_service(exp))
|
||||
|
||||
|
||||
FILTER_SOURCE_FILES = filter_source_files_from_platform(
|
||||
{
|
||||
"mdns_esp32.cpp": {
|
||||
PlatformFramework.ESP32_ARDUINO,
|
||||
PlatformFramework.ESP32_IDF,
|
||||
},
|
||||
"mdns_esp8266.cpp": {PlatformFramework.ESP8266_ARDUINO},
|
||||
"mdns_host.cpp": {PlatformFramework.HOST_NATIVE},
|
||||
"mdns_rp2040.cpp": {PlatformFramework.RP2040_ARDUINO},
|
||||
"mdns_libretiny.cpp": {
|
||||
PlatformFramework.BK72XX_ARDUINO,
|
||||
PlatformFramework.RTL87XX_ARDUINO,
|
||||
PlatformFramework.LN882X_ARDUINO,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user