Samsung / rlottie

A platform independent standalone library that plays Lottie Animation.
Other
1.15k stars 223 forks source link

Can't build rlottie with static linking using MinGW #519

Open leonstyhre opened 2 years ago

leonstyhre commented 2 years ago

Hi!

It's not possible to build rlottie with static linking on Windows when compiled using MinGW.

There is a minor issue in the CMakeLists.txt file where the following lines makes the configuration fail: if (WIN32 AND NOT BUILD_SHARED_LIBS) target_compile_definitions(rlottie PUBLIC -DRLOTTIE_BUILD=0) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") endif()

These are MSVC flags and MinGW of course can't interpret them as it needs GCC-style compiler flags.

This is a minor thing though, more serious is that there are multiple linker issues when linking against librlottie.a The issue is present on the master branch (latest commit 875626965959d8e269ca22175c8e1ad190696c43).

I'm attaching an output of the errors: MinGW_linking_errors.txt

Many thanks in advance!