fix(thorvg): link lvgl_thorvgl with lvgl

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
Neo Xu 2024-02-23 13:24:54 +08:00
parent c81f654026
commit 9b09182fc7
2 changed files with 11 additions and 15 deletions

View File

@ -48,12 +48,7 @@ if(NOT LV_CONF_BUILD_DISABLE_THORVG_INTERNAL)
add_library(lvgl_thorvg ${THORVG_SOURCES})
add_library(lvgl::thorvg ALIAS lvgl_thorvg)
target_include_directories(lvgl_thorvg SYSTEM PUBLIC ${LVGL_ROOT_DIR}/src/libs/thorvg)
if(LV_CONF_PATH)
target_compile_definitions(lvgl_thorvg PUBLIC LV_CONF_PATH=${LV_CONF_PATH})
endif()
if(LV_CONF_SKIP)
target_compile_definitions(lvgl_thorvg PUBLIC LV_CONF_SKIP=1)
endif()
target_link_libraries(lvgl_thorvg PUBLIC lvgl)
endif()
# Build LVGL example library
@ -146,7 +141,7 @@ if(NOT LV_CONF_BUILD_DISABLE_THORVG_INTERNAL)
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}")
install(
TARGETS lvgl_thorvg
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
@ -164,7 +159,7 @@ if(NOT LV_CONF_BUILD_DISABLE_DEMOS)
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}")
install(
TARGETS lvgl_demos
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
@ -182,7 +177,7 @@ if(NOT LV_CONF_BUILD_DISABLE_EXAMPLES)
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}")
install(
TARGETS lvgl_examples
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"

View File

@ -162,12 +162,12 @@ set(COMPILE_OPTIONS
${BUILD_TARGET_DEF}
)
filter_compiler_options(C LVGL_COMPILE_OPTIONS ${COMPILE_OPTIONS})
filter_compiler_options(C LVGL_C_COMPILE_OPTIONS ${COMPILE_OPTIONS})
# Options test cases are compiled with.
filter_compiler_options(C LVGL_TESTFILE_COMPILE_OPTIONS ${LVGL_COMPILE_OPTIONS} -Wno-missing-prototypes)
filter_compiler_options(C LVGL_TESTFILE_COMPILE_OPTIONS ${LVGL_C_COMPILE_OPTIONS} -Wno-missing-prototypes)
filter_compiler_options(CXX LVGL_THORVG_COMPILE_OPTIONS
filter_compiler_options(CXX LVGL_CXX_COMPILE_OPTIONS
${COMPILE_OPTIONS}
-Wno-shadow
-Wno-unused-parameter
@ -182,10 +182,11 @@ get_filename_component(LVGL_DIR ${LVGL_TEST_DIR} DIRECTORY)
# Include lvgl project file.
include(${LVGL_DIR}/CMakeLists.txt)
target_compile_options(lvgl PUBLIC ${LVGL_COMPILE_OPTIONS})
target_compile_options(lvgl_thorvg PUBLIC ${LVGL_THORVG_COMPILE_OPTIONS})
target_compile_options(lvgl PUBLIC $<$<COMPILE_LANGUAGE:C>: ${LVGL_C_COMPILE_OPTIONS}>)
target_compile_options(lvgl PUBLIC $<$<COMPILE_LANGUAGE:ASM>: ${LVGL_C_COMPILE_OPTIONS}>)
target_compile_options(lvgl PUBLIC $<$<COMPILE_LANGUAGE:CXX>: ${LVGL_CXX_COMPILE_OPTIONS}>)
if (TARGET lvgl_examples)
target_compile_options(lvgl_examples PUBLIC ${LVGL_COMPILE_OPTIONS})
target_compile_options(lvgl_examples PUBLIC ${LVGL_C_COMPILE_OPTIONS})
endif()