mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 06:58:11 +01:00
[image] Fix compile time problem with host image not using lvgl (#7654)
This commit is contained in:
parent
8bb4316956
commit
ff48f53989
2 changed files with 18 additions and 6 deletions
|
@ -3,12 +3,7 @@
|
||||||
#include "esphome/components/display/display.h"
|
#include "esphome/components/display/display.h"
|
||||||
|
|
||||||
#ifdef USE_LVGL
|
#ifdef USE_LVGL
|
||||||
// required for clang-tidy
|
#include "esphome/components/lvgl/lvgl_proxy.h"
|
||||||
#ifndef LV_CONF_H
|
|
||||||
#define LV_CONF_SKIP 1 // NOLINT
|
|
||||||
#endif // LV_CONF_H
|
|
||||||
|
|
||||||
#include <lvgl.h>
|
|
||||||
#endif // USE_LVGL
|
#endif // USE_LVGL
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
|
|
17
esphome/components/lvgl/lvgl_proxy.h
Normal file
17
esphome/components/lvgl/lvgl_proxy.h
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#pragma once
|
||||||
|
/**
|
||||||
|
* This header is for use in components that might or might not use LVGL. There is a platformio bug where
|
||||||
|
the mere mention of a header file, even if ifdefed, causes the build to fail. This is a workaround, since if this
|
||||||
|
file is included in the build, LVGL is always included.
|
||||||
|
*/
|
||||||
|
#ifdef USE_LVGL
|
||||||
|
// required for clang-tidy
|
||||||
|
#ifndef LV_CONF_H
|
||||||
|
#define LV_CONF_SKIP 1 // NOLINT
|
||||||
|
#endif // LV_CONF_H
|
||||||
|
|
||||||
|
#include <lvgl.h>
|
||||||
|
namespace esphome {
|
||||||
|
namespace lvgl {} // namespace lvgl
|
||||||
|
} // namespace esphome
|
||||||
|
#endif // USE_LVGL
|
Loading…
Reference in a new issue