feat(cmake-build): build all libraries either SHARED or STATIC (#3669)

This commit is contained in:
sparkles43
2022-09-09 21:52:20 +02:00
committed by GitHub
parent 513d631445
commit eb54353f00

View File

@@ -18,16 +18,11 @@ file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c)
file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c)
file(GLOB_RECURSE DEMO_SOURCES ${LVGL_ROOT_DIR}/demos/*.c)
if (BUILD_SHARED_LIBS)
add_library(lvgl SHARED ${SOURCES})
else()
add_library(lvgl STATIC ${SOURCES})
endif()
add_library(lvgl ${SOURCES})
add_library(lvgl::lvgl ALIAS lvgl)
add_library(lvgl_examples STATIC ${EXAMPLE_SOURCES})
add_library(lvgl_examples ${EXAMPLE_SOURCES})
add_library(lvgl::examples ALIAS lvgl_examples)
add_library(lvgl_demos STATIC ${DEMO_SOURCES})
add_library(lvgl_demos ${DEMO_SOURCES})
add_library(lvgl::demos ALIAS lvgl_demos)
target_compile_definitions(