fix(test): fix compile error on macos (#6377)

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
Neo Xu
2024-06-19 22:36:01 +08:00
committed by GitHub
parent af6702858c
commit 147ac8ec72
3 changed files with 25 additions and 15 deletions

View File

@@ -337,15 +337,24 @@ if ($ENV{NON_AMD64_BUILD})
endif()
# OpenGL ES is required for its driver
if (NOT $ENV{NON_AMD64_BUILD})
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(glfw3 REQUIRED)
if ($ENV{NON_AMD64_BUILD})
message("Disable OpenGL, GLEW or glfw3 for non-amd64 build")
add_definitions(-DLV_USE_OPENGLES=0)
else()
find_package(OpenGL)
find_package(GLEW)
find_package(glfw3)
if(OpenGL_FOUND AND GLEW_FOUND AND glfw3_FOUND)
# Include directories
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLEW_INCLUDE_DIRS})
include_directories(${GLFW_INCLUDE_DIRS})
message("Enable LV_USE_OPENGLES")
else()
message("OpenGL, GLEW or glfw3 not found, defaulting to 0")
add_definitions(-DLV_USE_OPENGLES=0)
endif()
endif()
if (NOT LIBINPUT_FOUND)
@@ -441,7 +450,6 @@ foreach( test_case_fname ${TEST_CASE_FILES} )
${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} glfw)
endif()
target_include_directories(${test_name} PUBLIC ${TEST_INCLUDE_DIRS})
target_compile_options(${test_name} PUBLIC ${LVGL_TESTFILE_COMPILE_OPTIONS})

View File

@@ -135,9 +135,11 @@
#define LV_LIBINPUT_XKB 1
#endif
#ifndef LV_USE_OPENGLES
#if !defined(NON_AMD64_BUILD) && !defined(_MSC_VER) && !defined(_WIN32)
#define LV_USE_OPENGLES 1
#endif
#endif
#define LV_USE_FREETYPE 1
#define LV_FREETYPE_USE_LVGL_PORT 0