mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-23 01:33:59 +08:00
fix(drm): eliminate use of non-existent lv_api_map.h and enable smoke tests (#5694)
Signed-off-by: Neo Xu <neo.xu1990@gmail.com> Co-authored-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
parent
33dd1350f8
commit
1ea51ad616
2
.github/workflows/ccpp.yml
vendored
2
.github/workflows/ccpp.yml
vendored
@ -95,7 +95,7 @@ jobs:
|
||||
|
||||
install: |
|
||||
apt-get update -y
|
||||
apt-get install build-essential ccache libgcc-10-dev python3 libpng-dev ruby-full gcovr cmake libjpeg62-turbo-dev libfreetype6-dev libasan6 pngquant python3-pip libinput-dev libxkbcommon-dev pkg-config ninja-build -q -y
|
||||
apt-get install build-essential ccache libgcc-10-dev python3 libpng-dev ruby-full gcovr cmake libjpeg62-turbo-dev libfreetype6-dev libasan6 pngquant python3-pip libinput-dev libxkbcommon-dev libdrm-dev pkg-config ninja-build -q -y
|
||||
pip install pypng lz4
|
||||
/usr/sbin/update-ccache-symlinks
|
||||
echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
|
||||
|
@ -6,5 +6,5 @@
|
||||
#
|
||||
# Note: This script is run by the CI workflows.
|
||||
sudo apt update
|
||||
sudo apt install gcc python3 ninja-build libpng-dev ruby-full gcovr cmake libjpeg-turbo8-dev libfreetype6-dev pngquant libinput-dev libxkbcommon-dev pkg-config
|
||||
sudo apt install gcc python3 ninja-build libpng-dev ruby-full gcovr cmake libjpeg-turbo8-dev libfreetype6-dev pngquant libinput-dev libxkbcommon-dev libdrm-dev pkg-config
|
||||
pip3 install pypng lz4
|
||||
|
@ -9,8 +9,6 @@
|
||||
#include "lv_linux_drm.h"
|
||||
#if LV_USE_LINUX_DRM
|
||||
|
||||
#include "../../../lv_api_map.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
|
@ -259,16 +259,30 @@ find_package(Libinput OPTIONAL_COMPONENTS)
|
||||
include_directories(${LIBINPUT_INCLUDE_DIRS})
|
||||
|
||||
if (NOT LIBINPUT_FOUND)
|
||||
message("libinput is not found, defaulting to 0")
|
||||
add_definitions(-DLV_USE_LIBINPUT=0)
|
||||
message("libinput not found, defaulting to 0")
|
||||
add_definitions(-DLV_USE_LIBINPUT=0)
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(xkbcommon pkg_check_modules xkbcommon)
|
||||
|
||||
if (NOT xkbcommon_FOUND)
|
||||
message("xkbcommon is not found, defaulting to 0")
|
||||
add_definitions(-DLV_LIBINPUT_XKB=0)
|
||||
message("xkbcommon not found, defaulting to 0")
|
||||
add_definitions(-DLV_LIBINPUT_XKB=0)
|
||||
endif()
|
||||
|
||||
# libdrm is required for the DRM display driver test case
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindLibDRM.cmake)
|
||||
if(Libdrm_FOUND)
|
||||
include_directories(${Libdrm_INCLUDE_DIRS})
|
||||
else()
|
||||
message("libdrm not found, defaulting to 0")
|
||||
add_definitions(-DLV_USE_LINUX_DRM=0)
|
||||
endif()
|
||||
|
||||
# If we are running on mac, set LV_USE_LINUX_FBDEV to 0
|
||||
if(APPLE)
|
||||
add_definitions(-DLV_USE_LINUX_FBDEV=0)
|
||||
endif()
|
||||
|
||||
# disable test targets for build only tests
|
||||
@ -310,6 +324,7 @@ foreach( test_case_fname ${TEST_CASE_FILES} )
|
||||
lvgl_thorvg
|
||||
${PNG_LIBRARIES}
|
||||
${FREETYPE_LIBRARIES}
|
||||
${LIBDRM_LIBRARIES}
|
||||
${LIBINPUT_LIBRARIES}
|
||||
${JPEG_LIBRARIES}
|
||||
m
|
||||
|
45
tests/FindLibDRM.cmake
Normal file
45
tests/FindLibDRM.cmake
Normal file
@ -0,0 +1,45 @@
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_Libdrm pkg_check_modules libdrm)
|
||||
|
||||
set(Libdrm_DEFINITIONS ${PKG_Libdrm_CFLAGS_OTHER})
|
||||
set(Libdrm_VERSION ${PKG_Libdrm_VERSION})
|
||||
|
||||
find_path(Libdrm_INCLUDE_DIR
|
||||
NAMES
|
||||
xf86drm.h
|
||||
HINTS
|
||||
${PKG_Libdrm_INCLUDE_DIRS}
|
||||
)
|
||||
find_library(Libdrm_LIBRARY
|
||||
NAMES
|
||||
drm
|
||||
HINTS
|
||||
${PKG_Libdrm_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libdrm
|
||||
FOUND_VAR
|
||||
Libdrm_FOUND
|
||||
REQUIRED_VARS
|
||||
Libdrm_LIBRARY
|
||||
Libdrm_INCLUDE_DIR
|
||||
VERSION_VAR
|
||||
Libdrm_VERSION
|
||||
)
|
||||
|
||||
if(Libdrm_FOUND AND NOT TARGET Libdrm::Libdrm)
|
||||
add_library(Libdrm::Libdrm UNKNOWN IMPORTED)
|
||||
set_target_properties(Libdrm::Libdrm PROPERTIES
|
||||
IMPORTED_LOCATION "${Libdrm_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${Libdrm_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/libdrm"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(Libdrm_LIBRARY Libdrm_INCLUDE_DIR)
|
||||
|
||||
set(Libdrm_LIBRARIES ${Libdrm_LIBRARY})
|
||||
set(Libdrm_INCLUDE_DIRS ${Libdrm_INCLUDE_DIR} "${Libdrm_INCLUDE_DIR}/libdrm")
|
||||
set(Libdrm_VERSION_STRING ${Libdrm_VERSION} ${PKG_Libdrm_LIBRARY_DIRS})
|
@ -101,6 +101,14 @@
|
||||
|
||||
#define LV_CACHE_DEF_SIZE (10 * 1024 * 1024)
|
||||
|
||||
#ifndef LV_USE_LINUX_DRM
|
||||
#define LV_USE_LINUX_DRM 1
|
||||
#endif
|
||||
|
||||
#ifndef LV_USE_LINUX_FBDEV
|
||||
#define LV_USE_LINUX_FBDEV 1
|
||||
#endif
|
||||
|
||||
#define LV_USE_ILI9341 1
|
||||
#define LV_USE_ST7735 1
|
||||
#define LV_USE_ST7789 1
|
||||
|
Loading…
Reference in New Issue
Block a user