android: change ANDROID_STL='c++_shared'
- fixes crashes in face-detector application - libc++_shared.so is bundled automatically via CMake helper project
This commit is contained in:
@@ -123,6 +123,16 @@ foreach(file ${seed_project_files_rel})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# copy libcxx_helper
|
||||
set(__base_dir "${CMAKE_CURRENT_SOURCE_DIR}/")
|
||||
file(GLOB_RECURSE __files_rel RELATIVE "${__base_dir}/" "${__base_dir}/libcxx_helper/*")
|
||||
foreach(file ${__files_rel})
|
||||
configure_file("${__base_dir}/${file}" "${OPENCV_JAVA_DIR}/${file}" @ONLY)
|
||||
list(APPEND depends "${__base_dir}/${file}")
|
||||
get_filename_component(install_subdir "${file}" PATH)
|
||||
install(FILES "${OPENCV_JAVA_DIR}/${file}" DESTINATION "${JAVA_INSTALL_ROOT}/../${install_subdir}" COMPONENT java)
|
||||
endforeach()
|
||||
|
||||
list(APPEND depends gen_opencv_java_source "${OPENCV_DEPHELPER}/gen_opencv_java_source")
|
||||
ocv_copyfiles_add_target(${the_module}_android_source_copy JAVA_SRC_COPY "Copy Java(Andoid SDK) source files" ${depends})
|
||||
file(REMOVE "${OPENCV_DEPHELPER}/${the_module}_android_source_copy") # force rebuild after CMake run
|
||||
|
||||
@@ -7,6 +7,13 @@ android {
|
||||
defaultConfig {
|
||||
minSdkVersion @ANDROID_MIN_SDK_VERSION@
|
||||
targetSdkVersion @ANDROID_TARGET_SDK_VERSION@
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
arguments "-DANDROID_STL=@ANDROID_STL@"
|
||||
targets "opencv_jni_shared"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@@ -37,6 +44,12 @@ android {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
}
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path (project.projectDir.toString() + '/libcxx_helper/CMakeLists.txt')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -99,6 +99,13 @@ android {
|
||||
defaultConfig {
|
||||
minSdkVersion @ANDROID_MIN_SDK_VERSION@
|
||||
targetSdkVersion @ANDROID_TARGET_SDK_VERSION@
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
arguments "-DANDROID_STL=@ANDROID_STL@"
|
||||
targets "opencv_jni_shared"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@@ -129,6 +136,12 @@ android {
|
||||
manifest.srcFile 'java/AndroidManifest.xml'
|
||||
}
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path (project.projectDir.toString() + '/libcxx_helper/CMakeLists.txt')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
|
||||
# dummy target to bring libc++_shared.so into packages
|
||||
add_library(opencv_jni_shared STATIC dummy.cpp)
|
||||
@@ -0,0 +1 @@
|
||||
// empty
|
||||
Reference in New Issue
Block a user