Skip to content

Commit c0d8a07

Browse files
pengyiqiangxiaoxiang781216
authored andcommitted
lvgl/Makefile: support multiple options for LV_OPTLEVEL
This configuration is added to put LVGL into PSRAM for execution, and the lv_*.o file needs to be matched in the link script. Since LTO optimization will cause the file name to be modified, resulting in a matching failure, it will only take effect if LTO optimization is removed during compilation. Signed-off-by: pengyiqiang <[email protected]>
1 parent eee2a2e commit c0d8a07

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

graphics/lvgl/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ if(CONFIG_GRAPHICS_LVGL)
117117
nuttx_add_dependencies(TARGET lvgl DEPENDS turbojpeg-static)
118118
endif()
119119

120+
if(NOT ${CONFIG_LV_OPTLEVEL} STREQUAL "")
121+
add_compile_options(${CONFIG_LV_OPTLEVEL})
122+
endif()
123+
120124
set_property(
121125
TARGET nuttx
122126
APPEND

graphics/lvgl/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ CFLAGS += "-DLV_PROFILER_BEGIN_TAG(str)=sched_note_beginex(NOTE_TAG_GRAPHICS, st
4343
CFLAGS += "-DLV_PROFILER_END_TAG(str)=sched_note_endex(NOTE_TAG_GRAPHICS, str)"
4444
endif
4545

46+
ifneq ($(CONFIG_LV_OPTLEVEL), "")
47+
# Since multiple options need to be supported, subst needs to be used here to remove
48+
# the redundant double quotes, otherwise it will cause command parsing errors.
49+
CFLAGS += $(subst ",, $(CONFIG_LV_OPTLEVEL))
50+
CXXFLAGS += $(subst ",, $(CONFIG_LV_OPTLEVEL))
51+
endif
52+
4653
# Set up build configuration and environment
4754

4855
WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}
@@ -78,11 +85,6 @@ ifeq ($(wildcard $(LVGL_UNPACKNAME)/.git),)
7885
context:: $(LVGL_UNPACKNAME)
7986
endif
8087

81-
ifneq ($(CONFIG_LV_OPTLEVEL), "")
82-
CFLAGS += $(CONFIG_LV_OPTLEVEL)
83-
CXXFLAGS += $(CONFIG_LV_OPTLEVEL)
84-
endif
85-
8688
include $(APPDIR)/Application.mk
8789

8890
ifeq ($(wildcard $(LVGL_UNPACKNAME)/.git),)

0 commit comments

Comments
 (0)