Skip to content

Commit 3af90e6

Browse files
committed
Fix rlottie options not taking effect (CMP0077)
With cmake_minimum_required(3.10), policy CMP0077 is OLD: option() in the rlottie submodule discards normal variables set before add_subdirectory and resets them to their defaults (ON). This left LOTTIE_MODULE=ON, excluding stb_image.cpp from the build and causing undefined references to lottie_image_load/lottie_image_free/ lottie_image_load_from_data at link time. Set the options as cache variables with FORCE instead; option() never overrides an existing cache entry.
1 parent f5517b6 commit 3af90e6

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

TMessagesProj/jni/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,13 @@ target_link_libraries(tgnet
8080

8181
#rlottie
8282
set(BUILD_SHARED_LIBS OFF)
83-
set(LOTTIE_MODULE OFF)
84-
set(LOTTIE_THREAD OFF)
85-
set(LOTTIE_CACHE OFF)
86-
set(LOTTIE_TEST OFF)
83+
# NOTE: must be CACHE ... FORCE because this project requires CMake 3.10,
84+
# so CMP0077 is OLD and option() in the submodule would discard plain
85+
# normal variables and reset them to their defaults (ON).
86+
set(LOTTIE_MODULE OFF CACHE BOOL "" FORCE)
87+
set(LOTTIE_THREAD OFF CACHE BOOL "" FORCE)
88+
set(LOTTIE_CACHE OFF CACHE BOOL "" FORCE)
89+
set(LOTTIE_TEST OFF CACHE BOOL "" FORCE)
8790
add_subdirectory(rlottie)
8891
target_compile_options(rlottie PUBLIC
8992
-Wall -fno-rtti -finline-functions -ffast-math -Oz -fno-unwind-tables -fno-asynchronous-unwind-tables -Wnon-virtual-dtor -Woverloaded-virtual -Wno-unused-parameter -fvisibility=hidden)

0 commit comments

Comments
 (0)