init Files

This commit is contained in:
2024-12-09 19:47:18 +01:00
parent b55a8cd2bc
commit 528e862838
3471 changed files with 1105029 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
From 18083a559734d297838e4cf34a856a4770062319 Mon Sep 17 00:00:00 2001
From: tvanfossen <vanfosst@gmail.com>
Date: Tue, 23 Aug 2022 10:06:53 -0400
Subject: [PATCH] changes to compile with esp-idf
---
CMakeLists.txt | 11 ++++++-----
src/vector/vimageloader.cpp | 23 +++++++++++++----------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38a9862..ee6d2cd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,10 +95,11 @@ if (NOT APPLE AND NOT WIN32)
)
endif()
-if (LOTTIE_MODULE)
- # for dlopen, dlsym and dlclose dependency
- target_link_libraries(rlottie PRIVATE ${CMAKE_DL_LIBS})
-endif()
+# No Sym links in ESP-IDF
+# if (LOTTIE_MODULE)
+# # for dlopen, dlsym and dlclose dependency
+# target_link_libraries(rlottie PRIVATE ${CMAKE_DL_LIBS})
+# endif()
if (NOT LOTTIE_ASAN)
if(APPLE)
@@ -137,7 +138,7 @@ endif (NOT LIB_INSTALL_DIR)
#declare source and include files
add_subdirectory(inc)
add_subdirectory(src)
-add_subdirectory(example)
+# add_subdirectory(example) // We dont need example dir in ESP-IDF
if (LOTTIE_TEST)
enable_testing()
diff --git a/src/vector/vimageloader.cpp b/src/vector/vimageloader.cpp
index c2446be..3df4c6a 100644
--- a/src/vector/vimageloader.cpp
+++ b/src/vector/vimageloader.cpp
@@ -6,7 +6,7 @@
#ifdef _WIN32
# include <windows.h>
#else
-# include <dlfcn.h>
+// # include <dlfcn.h> //Does not work on ESP-IDF
#endif // _WIN32
using lottie_image_load_f = unsigned char *(*)(const char *filename, int *x,
@@ -61,22 +61,25 @@ struct VImageLoader::Impl {
void *dl_handle{nullptr};
void init()
{
- imageLoad = reinterpret_cast<lottie_image_load_f>(
- dlsym(dl_handle, "lottie_image_load"));
- imageFree = reinterpret_cast<lottie_image_free_f>(
- dlsym(dl_handle, "lottie_image_free"));
- imageFromData = reinterpret_cast<lottie_image_load_data_f>(
- dlsym(dl_handle, "lottie_image_load_from_data"));
+ // No sym links in ESP-iDF
+ // imageLoad = reinterpret_cast<lottie_image_load_f>(
+ // dlsym(dl_handle, "lottie_image_load"));
+ // imageFree = reinterpret_cast<lottie_image_free_f>(
+ // dlsym(dl_handle, "lottie_image_free"));
+ // imageFromData = reinterpret_cast<lottie_image_load_data_f>(
+ // dlsym(dl_handle, "lottie_image_load_from_data"));
}
void moduleFree()
{
- if (dl_handle) dlclose(dl_handle);
+ // if (dl_handle) dlclose(dl_handle); // No sym links in ESP-iDF
}
bool moduleLoad()
{
- dl_handle = dlopen(LOTTIE_IMAGE_MODULE_PLUGIN, RTLD_LAZY);
- return (dl_handle == nullptr);
+ // No sym links in ESP idf
+ // dl_handle = dlopen(LOTTIE_IMAGE_MODULE_PLUGIN, RTLD_LAZY);
+ // return (dl_handle == nullptr);
+ return true
}
# endif // _WIN32
#else // LOTTIE_IMAGE_MODULE_SUPPORT
--
2.34.1

View File

@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.5)
if (0)
if (LV_USE_RLOTTIE)
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/rlottie/inc"
)
set(LOTTIE_MODULE OFF)
set(LOTTIE_THREAD OFF)
set(BUILD_SHARED_LIBS OFF)
option(BUILD_TESTING OFF)
function(install)
endfunction()
function(export)
endfunction()
add_subdirectory(rlottie)
target_link_libraries(${COMPONENT_LIB} INTERFACE rlottie)
endif()
endif()