mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge branch '4.x' into '5.x'
This commit is contained in:
@@ -158,6 +158,7 @@ class Builder:
|
||||
self.debug = True if config.debug else False
|
||||
self.debug_info = True if config.debug_info else False
|
||||
self.no_samples_build = True if config.no_samples_build else False
|
||||
self.hwasan = True if config.hwasan else False
|
||||
self.opencl = True if config.opencl else False
|
||||
self.no_kotlin = True if config.no_kotlin else False
|
||||
self.shared = True if config.shared else False
|
||||
@@ -265,6 +266,12 @@ class Builder:
|
||||
if no_media_ndk:
|
||||
cmake_vars['WITH_ANDROID_MEDIANDK'] = "OFF"
|
||||
|
||||
if self.hwasan and "arm64" in abi.name:
|
||||
hwasan_flags = "-fno-omit-frame-pointer -fsanitize=hwaddress"
|
||||
cmake_vars['CMAKE_CXX_FLAGS_DEBUG'] = hwasan_flags
|
||||
cmake_vars['CMAKE_C_FLAGS_DEBUG'] = hwasan_flags
|
||||
cmake_vars['CMAKE_LINKER_FLAGS_DEBUG'] = hwasan_flags
|
||||
|
||||
cmake_vars.update(abi.cmake_vars)
|
||||
|
||||
if len(self.disable) > 0:
|
||||
@@ -380,6 +387,7 @@ if __name__ == "__main__":
|
||||
parser.add_argument('--no_kotlin', action="store_true", help="Disable Kotlin extensions")
|
||||
parser.add_argument('--shared', action="store_true", help="Build shared libraries")
|
||||
parser.add_argument('--no_media_ndk', action="store_true", help="Do not link Media NDK (required for video I/O support)")
|
||||
parser.add_argument('--hwasan', action="store_true", help="Enable Hardware Address Sanitizer on ARM64")
|
||||
parser.add_argument('--disable', metavar='FEATURE', default=[], action='append', help='OpenCV features to disable (add WITH_*=OFF). To disable multiple, specify this flag again, e.g. "--disable TBB --disable OPENMP"')
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ class Builder:
|
||||
if self.options.simd:
|
||||
flags += "-msimd128 "
|
||||
if self.options.build_flags:
|
||||
flags += self.options.build_flags
|
||||
flags += self.options.build_flags + " "
|
||||
if self.options.webnn:
|
||||
flags += "-s USE_WEBNN=1 "
|
||||
flags += "-s EXPORTED_FUNCTIONS=\"['_malloc', '_free']\""
|
||||
|
||||
@@ -1,10 +1,25 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR riscv64)
|
||||
|
||||
message(STATUS "RISCV: $ENV{RISCV}")
|
||||
message(STATUS "RISCV_GCC_INSTALL_ROOT: $ENV{RISCV_GCC_INSTALL_ROOT}")
|
||||
|
||||
set(RISCV_GCC_INSTALL_ROOT $ENV{RISCV} CACHE PATH "Path to GCC for RISC-V cross compiler installation directory")
|
||||
|
||||
set(CMAKE_C_COMPILER ${RISCV_GCC_INSTALL_ROOT}/bin/riscv64-linux-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${RISCV_GCC_INSTALL_ROOT}/bin/riscv64-linux-g++)
|
||||
|
||||
# fix toolchain macro
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__ANDES=1")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ANDES=1")
|
||||
|
||||
# enable rvp
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=rv64gc -mext-dsp")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=rv64gc -mext-dsp")
|
||||
|
||||
# fix segment address
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Ttext-segment=0x50000")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Ttext-segment=0x50000")
|
||||
|
||||
Reference in New Issue
Block a user