mirror of
https://github.com/esphome/esphome.git
synced 2026-03-04 03:38:20 -07:00
[core] Move build_info_data.h out of application.h to fix incremental rebuilds
build_info_data.h contains ESPHOME_BUILD_TIME which changes every build. Since application.h included it, changing any source file caused build_info_data.h to be rewritten (via sources_changed), which then triggered a rebuild of every file that includes application.h. Move all build_info_data.h dependent code from application.h inline methods to application.cpp, so only application.cpp recompiles when build info changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -26,9 +26,7 @@ void VersionTextSensor::setup() {
|
||||
if (!this->hide_timestamp_) {
|
||||
size_t len = strlen(version_str);
|
||||
ESPHOME_strncat_P(version_str, BUILT_STR, sizeof(version_str) - len - 1);
|
||||
char time_buf[esphome::Application::BUILD_TIME_STR_SIZE];
|
||||
App.get_build_time_string(time_buf);
|
||||
strncat(version_str, time_buf, sizeof(version_str) - strlen(version_str) - 1);
|
||||
ESPHOME_strncat_P(version_str, ESPHOME_BUILD_TIME_STR, sizeof(version_str) - strlen(version_str) - 1);
|
||||
}
|
||||
|
||||
strncat(version_str, ")", sizeof(version_str) - strlen(version_str) - 1);
|
||||
|
||||
Reference in New Issue
Block a user