diff --git a/CMakeLists.txt b/CMakeLists.txt index 02a2b25b4..ed53f5f2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -613,10 +613,14 @@ else() endif() if(NOT WIN32) - # SVG rendering library LunaSVG. - set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/liblunasvg.a) - # Lottie animation library rlottie. - set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/librlottie.a) + # SVG rendering library LunaSVG and Lottie animation library rlottie. + if(ANDROID) + set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}/liblunasvg.a) + set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}/librlottie.a) + else() + set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/liblunasvg.a) + set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/librlottie.a) + endif() endif() if(APPLE) diff --git a/es-core/CMakeLists.txt b/es-core/CMakeLists.txt index 1ed7ba8f7..4102da019 100644 --- a/es-core/CMakeLists.txt +++ b/es-core/CMakeLists.txt @@ -182,3 +182,7 @@ endif() include_directories(${COMMON_INCLUDE_DIRS}) add_library(es-core STATIC ${CORE_SOURCES} ${CORE_HEADERS}) target_link_libraries(es-core ${COMMON_LIBRARIES}) + +if(ANDROID) + set_target_properties(es-core PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}) +endif() diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 666d4d83c..43d67e0bc 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -40,6 +40,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) target_compile_options(lunasvg PRIVATE "/wd4251" "/wd4267") endif() +if(ANDROID) + set_target_properties(lunasvg PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}) +endif() + # Disable threading support for rlottie as this functionality actually leads to far worse # performance. As well there is a bug on Windows that makes rlottie hang forever on application # shutdown if compiled using MinGW with threading support enabled. @@ -60,5 +64,9 @@ else() target_compile_options(rlottie PRIVATE "-w") endif() +if(ANDROID) + set_target_properties(rlottie PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}) +endif() + # Build LunaSVG before rlottie. add_dependencies(rlottie lunasvg)