[Android] support fastdeploy build with static deps(60Mb->29~31Mb) (#1176)

* [Android] support fastdeploy build with static deps(70Mb->17~19Mb)

* [Android] support fastdeploy build with static deps(60Mb->29~30Mb)

* fixed ci

* fixed ci

* [staticlib] support fd android static lib

* [static] optimize bundle_static_library func

* [staticlib] add api_helpers.h -> staticlib headers

* [staticlib] add api_helpers.h -> staticlib headers

* [staticlib] add api_helpers.h -> staticlib headers

* [staticlib] Fixed Paddle Lite paddle_use_kernels.h to support fd armv7 static lib

* [staticlib] Add strip -> fd static lib target

* [staticlib] optimize bundle_static_library func

* [staticlib] add strip for fd static lib on  mac osx

* [staticlib] move api_helpers -> lite/option

* [staticlib] optimize bundle_static_library

* [staticlib] add Android limit
This commit is contained in:
DefTruth
2023-01-30 19:39:56 +08:00
committed by GitHub
parent 595ca69251
commit 2613e9c5d0
19 changed files with 918 additions and 97 deletions

View File

@@ -20,7 +20,7 @@ public class SegmentationWelcomeActivity extends Activity {
);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
setContentView(R.layout.super_resolution_welcome);
setContentView(R.layout.segmentation_welcome);
}
public void startActivity(View view) {

View File

@@ -28,7 +28,7 @@ android {
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"
version "3.22.1"
}
}
sourceSets {
@@ -36,7 +36,7 @@ android {
jniLibs.srcDirs = ['libs']
}
}
ndkVersion '20.1.5948944'
ndkVersion '25.1.8937393'
}
dependencies {

View File

@@ -2,7 +2,7 @@
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.10.2)
cmake_minimum_required(VERSION 3.22.1)
# Declares and names the project.
project("fastdeploy_jni")
@@ -15,12 +15,11 @@ project("fastdeploy_jni")
set(FastDeploy_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/fastdeploy-android-latest-shared-dev")
find_package(FastDeploy REQUIRED)
# include_directories(.)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${FastDeploy_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math -Ofast -Os -DNDEBUG -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-unwind-tables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math -Ofast -DNDEBUG -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-unwind-tables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -fdata-sections -ffunction-sections")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,-z,nocopyreloc")