From c9ff27b3bed176a324a2cb43b893ebc80af6b5ee Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 15 Jan 2024 19:20:44 +0100 Subject: [PATCH] (Android) Separated the build artifacts for the Full and Lite releases --- CMakeLists.txt | 9 +++++++-- es-core/CMakeLists.txt | 8 +++++++- external/CMakeLists.txt | 16 ++++++++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed53f5f2e..04e372109 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -615,8 +615,13 @@ endif() if(NOT WIN32) # 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) + if(ANDROID_LITE_RELEASE) + set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/android_lite_${ANDROID_ABI}/liblunasvg.a) + set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/android_lite_${ANDROID_ABI}/librlottie.a) + else() + 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) + endif() else() set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/liblunasvg.a) set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${PROJECT_SOURCE_DIR}/librlottie.a) diff --git a/es-core/CMakeLists.txt b/es-core/CMakeLists.txt index 4102da019..592222d51 100644 --- a/es-core/CMakeLists.txt +++ b/es-core/CMakeLists.txt @@ -184,5 +184,11 @@ 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}) + if(ANDROID_LITE_RELEASE) + set_target_properties(es-core PROPERTIES ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_SOURCE_DIR}/../android_lite_${ANDROID_ABI}) + else() + set_target_properties(es-core PROPERTIES ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_SOURCE_DIR}/../android_${ANDROID_ABI}) + endif() endif() diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 43d67e0bc..be7268087 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -41,7 +41,13 @@ if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) endif() if(ANDROID) - set_target_properties(lunasvg PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}) + if(ANDROID_LITE_RELEASE) + set_target_properties(lunasvg PROPERTIES ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_SOURCE_DIR}/android_lite_${ANDROID_ABI}) + else() + set_target_properties(lunasvg PROPERTIES ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}) + endif() endif() # Disable threading support for rlottie as this functionality actually leads to far worse @@ -65,7 +71,13 @@ else() endif() if(ANDROID) - set_target_properties(rlottie PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}) + if(ANDROID_LITE_RELEASE) + set_target_properties(rlottie PROPERTIES ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_SOURCE_DIR}/android_lite_${ANDROID_ABI}) + else() + set_target_properties(rlottie PROPERTIES ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_SOURCE_DIR}/android_${ANDROID_ABI}) + endif() endif() # Build LunaSVG before rlottie.