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:
1000len-4959
2023-11-06 14:34:50 +01:00
committed by Gabor Kiss-Vamosi
parent 96ce505651
commit 361663ee5f
38 changed files with 70 additions and 49 deletions
+10
View File
@@ -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()