mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-27 20:57:01 +08:00
feat(build): make it work with MSVC build (#4704)
Signed-off-by: YanXiaowei <yanxiaowei@xiaomi.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com> Co-authored-by: bjsylvia <bjsylvia@163.com> Co-authored-by: YanXiaowei <yanxiaowei@xiaomi.com> Co-authored-by: Niklas Fiekas <niklas.fiekas@backscattering.de> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lhdjply <1029652979@qq.com>
This commit is contained in:
committed by
Gabor Kiss-Vamosi
parent
96ce505651
commit
361663ee5f
@@ -1,5 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.12.4)
|
||||
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
if(NOT ESP_PLATFORM)
|
||||
project(lvgl HOMEPAGE_URL https://github.com/lvgl/lvgl)
|
||||
endif()
|
||||
@@ -15,3 +17,11 @@ elseif(MICROPY_DIR)
|
||||
else()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/custom.cmake)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(lvgl PUBLIC LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllimport\))
|
||||
else()
|
||||
target_compile_definitions(lvgl PUBLIC LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllexport\))
|
||||
endif()
|
||||
endif()
|
||||
Reference in New Issue
Block a user