Skip to content

Commit 777e1d3

Browse files
committed
cmake: fix JNI configuration problem for Android samples
Some CMake 3.x (2.8.12.2 is fine) provides broken build configurations with following build error message: ld: fatal error: -soname: must take a non-empty argument Linker command line sample contains this: "-shared -Wl,-soname, -o"
1 parent e3844e0 commit 777e1d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/OpenCVDetectAndroidSDK.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ macro(add_android_project target path)
287287
set(android_proj_NATIVE_DEPS ${android_proj_NATIVE_DEPS} android)
288288
endif()
289289

290-
add_library(${JNI_LIB_NAME} MODULE ${android_proj_jni_files})
290+
add_library(${JNI_LIB_NAME} SHARED ${android_proj_jni_files})
291291
ocv_target_include_modules_recurse(${JNI_LIB_NAME} ${android_proj_NATIVE_DEPS})
292292
ocv_target_include_directories(${JNI_LIB_NAME} "${path}/jni")
293293
ocv_target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS})

0 commit comments

Comments
 (0)