mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
Merge pull request #14011 from komakai:debug-build
* Add Android SDK debug build flag * Change LOG_TAG define for consistency with other modules
This commit is contained in:
parent
49093d6d38
commit
55f02d8c66
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "dnn_converters.hpp"
|
#include "dnn_converters.hpp"
|
||||||
|
|
||||||
|
#define LOG_TAG "org.opencv.dnn"
|
||||||
|
|
||||||
void Mat_to_MatShape(cv::Mat& mat, MatShape& matshape)
|
void Mat_to_MatShape(cv::Mat& mat, MatShape& matshape)
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,11 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
packagingOptions{
|
||||||
|
doNotStrip '*.so'
|
||||||
|
}
|
||||||
|
}
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||||
|
@ -142,6 +142,7 @@ class Builder:
|
|||||||
self.use_ccache = False if config.no_ccache else True
|
self.use_ccache = False if config.no_ccache else True
|
||||||
self.cmake_path = self.get_cmake()
|
self.cmake_path = self.get_cmake()
|
||||||
self.ninja_path = self.get_ninja()
|
self.ninja_path = self.get_ninja()
|
||||||
|
self.debug = True if config.debug else False
|
||||||
|
|
||||||
def get_cmake(self):
|
def get_cmake(self):
|
||||||
if not self.config.use_android_buildtools and check_executable(['cmake', '--version']):
|
if not self.config.use_android_buildtools and check_executable(['cmake', '--version']):
|
||||||
@ -214,6 +215,10 @@ class Builder:
|
|||||||
if self.ninja_path != 'ninja':
|
if self.ninja_path != 'ninja':
|
||||||
cmake_vars['CMAKE_MAKE_PROGRAM'] = self.ninja_path
|
cmake_vars['CMAKE_MAKE_PROGRAM'] = self.ninja_path
|
||||||
|
|
||||||
|
if self.debug:
|
||||||
|
cmake_vars['CMAKE_BUILD_TYPE'] = "Debug"
|
||||||
|
cmake_vars['BUILD_WITH_DEBUG_INFO'] = "ON"
|
||||||
|
|
||||||
if self.config.extra_modules_path is not None:
|
if self.config.extra_modules_path is not None:
|
||||||
cmd.append("-DOPENCV_EXTRA_MODULES_PATH='%s'" % self.config.extra_modules_path)
|
cmd.append("-DOPENCV_EXTRA_MODULES_PATH='%s'" % self.config.extra_modules_path)
|
||||||
|
|
||||||
@ -226,7 +231,7 @@ class Builder:
|
|||||||
cmd += [ "-D%s='%s'" % (k, v) for (k, v) in cmake_vars.items() if v is not None]
|
cmd += [ "-D%s='%s'" % (k, v) for (k, v) in cmake_vars.items() if v is not None]
|
||||||
cmd.append(self.opencvdir)
|
cmd.append(self.opencvdir)
|
||||||
execute(cmd)
|
execute(cmd)
|
||||||
execute([self.ninja_path, "install/strip"])
|
execute([self.ninja_path, "install" if self.debug else "install/strip"])
|
||||||
|
|
||||||
def build_javadoc(self):
|
def build_javadoc(self):
|
||||||
classpaths = []
|
classpaths = []
|
||||||
@ -283,6 +288,7 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument('--no_ccache', action="store_true", help="Do not use ccache during library build")
|
parser.add_argument('--no_ccache', action="store_true", help="Do not use ccache during library build")
|
||||||
parser.add_argument('--force_copy', action="store_true", help="Do not use file move during library build (useful for debug)")
|
parser.add_argument('--force_copy', action="store_true", help="Do not use file move during library build (useful for debug)")
|
||||||
parser.add_argument('--force_opencv_toolchain', action="store_true", help="Do not use toolchain from Android NDK")
|
parser.add_argument('--force_opencv_toolchain', action="store_true", help="Do not use toolchain from Android NDK")
|
||||||
|
parser.add_argument('--debug', action="store_true", help="Build for debug")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
log.basicConfig(format='%(message)s', level=log.DEBUG)
|
log.basicConfig(format='%(message)s', level=log.DEBUG)
|
||||||
|
Loading…
Reference in New Issue
Block a user