Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
ea49d7b7
Commit
ea49d7b7
authored
May 03, 2017
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8653 from alalek:android_fixes
parents
b92bbffa
133b91a0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
13 deletions
+20
-13
OpenCV.mk.in
cmake/templates/OpenCV.mk.in
+2
-0
Android.mk
modules/java/android_lib/jni/Android.mk
+0
-1
android.toolchain.cmake
platforms/android/android.toolchain.cmake
+7
-3
test_ndk_build.py
platforms/android/build-tests/test_ndk_build.py
+11
-8
Android.mk
samples/android/face-detection/jni/Android.mk
+0
-1
No files found.
cmake/templates/OpenCV.mk.in
View file @
ea49d7b7
...
...
@@ -94,6 +94,8 @@ LOCAL_CFLAGS += $(OPENCV_LOCAL_CFLAGS)
ifeq ($(OPENCV_INSTALL_MODULES),on)
LOCAL_$(OPENCV_LIB_TYPE)_LIBRARIES += $(foreach mod, $(OPENCV_LIBS), opencv_$(mod))
else
$(call __ndk_info,OpenCV: You should ignore warning about 'non-system libraries in linker flags' and 'opencv_java' library.)
$(call __ndk_info, 'OPENCV_INSTALL_MODULES:=on' can be used to build APK with included OpenCV binaries)
LOCAL_LDLIBS += -L$(call host-path,$(LOCAL_PATH)/$(OPENCV_LIBS_DIR)) $(foreach lib, $(OPENCV_LIBS), -lopencv_$(lib))
endif
...
...
modules/java/android_lib/jni/Android.mk
View file @
ea49d7b7
...
...
@@ -2,7 +2,6 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_CAMERA_MODULES := off
include OpenCV.mk
LOCAL_MODULE := opencv_java
...
...
platforms/android/android.toolchain.cmake
View file @
ea49d7b7
...
...
@@ -1150,8 +1150,10 @@ if( APPLE )
endif
()
# Force set compilers because standard identification works badly for us
include
(
CMakeForceCompiler
)
CMAKE_FORCE_C_COMPILER
(
"
${
CMAKE_C_COMPILER
}
"
GNU
)
if
(
CMAKE_VERSION VERSION_LESS 3.5.0
)
include
(
CMakeForceCompiler
)
CMAKE_FORCE_C_COMPILER
(
"
${
CMAKE_C_COMPILER
}
"
GNU
)
endif
()
if
(
ANDROID_COMPILER_IS_CLANG
)
set
(
CMAKE_C_COMPILER_ID Clang
)
endif
()
...
...
@@ -1163,7 +1165,9 @@ else()
endif
()
set
(
CMAKE_C_HAS_ISYSROOT 1
)
set
(
CMAKE_C_COMPILER_ABI ELF
)
CMAKE_FORCE_CXX_COMPILER
(
"
${
CMAKE_CXX_COMPILER
}
"
GNU
)
if
(
CMAKE_VERSION VERSION_LESS 3.5.0
)
CMAKE_FORCE_CXX_COMPILER
(
"
${
CMAKE_CXX_COMPILER
}
"
GNU
)
endif
()
if
(
ANDROID_COMPILER_IS_CLANG
)
set
(
CMAKE_CXX_COMPILER_ID Clang
)
endif
()
...
...
platforms/android/build-tests/test_ndk_build.py
View file @
ea49d7b7
...
...
@@ -73,12 +73,12 @@ class TestNDKBuild(unittest.TestCase):
p
=
[]
if
self
.
libtype
==
"static"
:
p
.
append
(
"OPENCV_LIB_TYPE := STATIC"
)
elif
self
.
libtype
==
"shared
_debug
"
:
elif
self
.
libtype
==
"shared"
:
p
.
append
(
"OPENCV_LIB_TYPE := SHARED"
)
p
.
append
(
"OPENCV_CAMERA_MODULES:=on"
)
p
.
append
(
"OPENCV_INSTALL_MODULES:=on"
)
elif
self
.
libtype
==
"shared"
:
elif
self
.
libtype
==
"shared
_opencv_manager
"
:
p
.
append
(
"OPENCV_LIB_TYPE := SHARED"
)
p
.
append
(
"OPENCV_INSTALL_MODULES:=off"
)
p
.
append
(
"include
%
s"
%
os
.
path
.
join
(
self
.
opencv_mk_path
,
"OpenCV.mk"
))
return
TEMPLATE_ANDROID_MK
.
format
(
cut
=
"
\n
"
.
join
(
p
),
cpp1
=
self
.
cpp1
,
cpp2
=
self
.
cpp2
)
...
...
@@ -115,14 +115,17 @@ class TestNDKBuild(unittest.TestCase):
def
suite
(
workdir
,
opencv_mk_path
):
abis
=
[
"armeabi"
,
"armeabi-v7a"
,
"x86"
,
"mips"
]
ndk_path
=
os
.
environ
[
"ANDROID_NDK"
]
with
open
(
os
.
path
.
join
(
ndk_path
,
"RELEASE.TXT"
),
"r"
)
as
f
:
s
=
f
.
read
()
if
re
.
search
(
r'r10[b-e]'
,
s
):
abis
.
extend
([
"arm64-v8a"
,
"x86"
,
"x86_64"
])
if
os
.
path
.
exists
(
os
.
path
.
join
(
ndk_path
,
"RELEASE.TXT"
)):
with
open
(
os
.
path
.
join
(
ndk_path
,
"RELEASE.TXT"
),
"r"
)
as
f
:
s
=
f
.
read
()
if
re
.
search
(
r'r10[b-e]'
,
s
):
abis
.
extend
([
"arm64-v8a"
,
"x86_64"
])
if
os
.
path
.
exists
(
os
.
path
.
join
(
ndk_path
,
"source.properties"
)):
# Android NDK 11+
abis
.
extend
([
"arm64-v8a"
,
"x86_64"
])
abis
.
append
(
"all"
)
suite
=
unittest
.
TestSuite
()
for
libtype
in
[
"static"
,
"shared"
,
"shared_
debug
"
]:
for
libtype
in
[
"static"
,
"shared"
,
"shared_
opencv_manager
"
]:
for
abi
in
abis
:
suite
.
addTest
(
TestNDKBuild
(
abi
,
libtype
,
opencv_mk_path
,
workdir
))
return
suite
...
...
samples/android/face-detection/jni/Android.mk
View file @
ea49d7b7
...
...
@@ -2,7 +2,6 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#OPENCV_CAMERA_MODULES:=off
#OPENCV_INSTALL_MODULES:=off
#OPENCV_LIB_TYPE:=SHARED
ifdef OPENCV_ANDROID_SDK
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment