mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
rlottie: Fix cmake build
This commit is contained in:
parent
11a11763dc
commit
46f43a28ae
@ -19,6 +19,17 @@ set_target_properties(rlottie PROPERTIES
|
|||||||
#declare alias so that library can be used inside the build tree, e.g. when testing
|
#declare alias so that library can be used inside the build tree, e.g. when testing
|
||||||
add_library(rlottie::rlottie ALIAS rlottie)
|
add_library(rlottie::rlottie ALIAS rlottie)
|
||||||
|
|
||||||
|
option(LOTTIE_MODULE "Enable LOTTIE MODULE SUPPORT" ON)
|
||||||
|
option(LOTTIE_THREAD "Enable LOTTIE THREAD SUPPORT" ON)
|
||||||
|
option(LOTTIE_CACHE "Enable LOTTIE CACHE SUPPORT" ON)
|
||||||
|
|
||||||
|
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/cmake/config.h.in config.h)
|
||||||
|
|
||||||
|
target_include_directories(rlottie
|
||||||
|
PRIVATE
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
)
|
||||||
|
|
||||||
#declare target compilation options
|
#declare target compilation options
|
||||||
target_compile_options(rlottie
|
target_compile_options(rlottie
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
17
cmake/config.h.in
Normal file
17
cmake/config.h.in
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#cmakedefine LOTTIE_MODULE
|
||||||
|
|
||||||
|
#ifdef LOTTIE_MODULE
|
||||||
|
#define LOTTIE_IMAGE_MODULE_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine LOTTIE_THREAD
|
||||||
|
|
||||||
|
#ifdef LOTTIE_THREAD
|
||||||
|
#define LOTTIE_THREAD_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine LOTTIE_CACHE
|
||||||
|
|
||||||
|
#ifdef LOTTIE_CACHE
|
||||||
|
#define LOTTIE_CACHE_SUPPORT
|
||||||
|
#endif
|
@ -1,7 +1,14 @@
|
|||||||
add_library(rlottie-image-loader SHARED
|
if(LOTTIE_MODULE)
|
||||||
stb_image.cpp
|
add_library(rlottie-image-loader SHARED
|
||||||
|
stb_image.cpp
|
||||||
|
)
|
||||||
|
install(TARGETS rlottie-image-loader
|
||||||
|
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
|
||||||
|
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
|
||||||
)
|
)
|
||||||
install(TARGETS rlottie-image-loader
|
else()
|
||||||
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
|
target_sources(rlottie
|
||||||
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
|
PRIVATE
|
||||||
)
|
"${CMAKE_CURRENT_LIST_DIR}/stb_image.cpp"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
@ -35,7 +35,7 @@ struct VImageLoader::Impl {
|
|||||||
lottie_image_free_f imageFree{nullptr};
|
lottie_image_free_f imageFree{nullptr};
|
||||||
lottie_image_load_data_f imageFromData{nullptr};
|
lottie_image_load_data_f imageFromData{nullptr};
|
||||||
|
|
||||||
#if LOTTIE_IMAGE_MODULE_SUPPORT
|
#ifdef LOTTIE_IMAGE_MODULE_SUPPORT
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HMODULE dl_handle{nullptr};
|
HMODULE dl_handle{nullptr};
|
||||||
bool moduleLoad()
|
bool moduleLoad()
|
||||||
|
@ -55,7 +55,7 @@ inline float VLine::angle() const
|
|||||||
const float dx = mX2 - mX1;
|
const float dx = mX2 - mX1;
|
||||||
const float dy = mY2 - mY1;
|
const float dy = mY2 - mY1;
|
||||||
|
|
||||||
const float theta = std::atan2f(dy, dx) * 180.0f / K_PI;
|
const float theta = std::atan2(dy, dx) * 180.0f / K_PI;
|
||||||
return theta;
|
return theta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user