0
0
mirror of https://github.com/opencv/opencv.git synced 2026-01-18 17:21:42 +01:00

Merge pull request #27301 from fengyuentau:4x/hal/riscv_rvv/refactor_build

hal/riscv-rvv: refactor the building process #27301

Current hal/riscv-rvv is built with all headers without building an object. This slows down the compilation progress, especially when re-compiling for minor changes in those headers (~170 files need to be re-compiled). This patch solves the problem.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Yuantao Feng
2025-05-14 19:04:58 +08:00
committed by GitHub
parent 868fc5c581
commit 547cef4e88
58 changed files with 4667 additions and 4120 deletions

View File

@@ -996,9 +996,9 @@ if(WITH_NDSRVP)
endif()
if(WITH_HAL_RVV)
ocv_debug_message(STATUS "Enable HAL RVV acceleration")
if(NOT ";${OpenCV_HAL};" MATCHES ";halrvv;")
set(OpenCV_HAL "halrvv;${OpenCV_HAL}")
ocv_debug_message(STATUS "Enable RVV HAL acceleration")
if(NOT ";${OpenCV_HAL};" MATCHES ";rvvhal;")
set(OpenCV_HAL "rvvhal;${OpenCV_HAL}")
endif()
endif()
@@ -1031,13 +1031,13 @@ foreach(hal ${OpenCV_HAL})
else()
message(STATUS "NDSRVP: Andes GNU Toolchain DSP extension is not enabled, disabling ndsrvp...")
endif()
elseif(hal STREQUAL "halrvv")
elseif(hal STREQUAL "rvvhal")
if(";${CPU_BASELINE_FINAL};" MATCHES ";RVV;")
add_subdirectory(hal/riscv-rvv)
ocv_hal_register(RVV_HAL_LIBRARIES RVV_HAL_HEADERS RVV_HAL_INCLUDE_DIRS)
list(APPEND OpenCV_USED_HAL "HAL RVV (ver ${RVV_HAL_VERSION})")
list(APPEND OpenCV_USED_HAL "RVV HAL (ver ${RVV_HAL_VERSION})")
else()
message(STATUS "HAL RVV: RVV is not available, disabling halrvv...")
message(STATUS "RVV HAL: RVV is not available, disabling RVV HAL...")
endif()
elseif(hal STREQUAL "ipp")
add_subdirectory(hal/ipp)