endif()
endif()
elseif(BASEARCH_RISCV_FOUND)
+ if(WITH_RVV OR WITH_RISCV_ZBC)
+ add_definitions(-DRISCV_FEATURES)
+ list(APPEND ZLIB_ARCH_HDRS ${ARCHDIR}/riscv_functions.h)
+ if(WITH_RUNTIME_CPU_DETECTION)
+ list(APPEND ZLIB_ARCH_HDRS ${ARCHDIR}/riscv_features.h)
+ list(APPEND ZLIB_ARCH_SRCS ${ARCHDIR}/riscv_features.c)
+ endif()
+ endif()
if(WITH_RVV)
check_rvv_intrinsics()
if(HAVE_RVV_INTRIN)
- add_definitions(-DRISCV_FEATURES)
add_definitions(-DRISCV_RVV)
- list(APPEND ZLIB_ARCH_HDRS ${ARCHDIR}/riscv_functions.h)
- if(WITH_RUNTIME_CPU_DETECTION)
- list(APPEND ZLIB_ARCH_HDRS ${ARCHDIR}/riscv_features.h)
- list(APPEND ZLIB_ARCH_SRCS ${ARCHDIR}/riscv_features.c)
- endif()
- # FIXME: we will not set compile flags for riscv_features.c when
- # the kernels update hwcap or hwprobe for riscv
set(RVV_SRCS ${ARCHDIR}/adler32_rvv.c ${ARCHDIR}/chunkset_rvv.c ${ARCHDIR}/compare256_rvv.c ${ARCHDIR}/slide_hash_rvv.c)
list(APPEND ZLIB_ARCH_SRCS ${RVV_SRCS})
set_property(SOURCE ${RVV_SRCS} PROPERTY COMPILE_FLAGS "${RISCVFLAG} ${NOLTOFLAG}")
endif()
endif()
- if(WITH_RUNTIME_CPU_DETECTION AND BASEARCH_RISCV_FOUND)
+ # FIXME: we will not set compile flags for riscv_features.c when
+ # the kernels update hwcap or hwprobe for riscv
+ if(WITH_RUNTIME_CPU_DETECTION)
if(WITH_RVV AND WITH_RISCV_ZBC AND HAVE_RVV_INTRIN AND HAVE_RISCV_ZBC)
set_property(SOURCE ${ARCHDIR}/riscv_features.c PROPERTY COMPILE_FLAGS "${RISCVFLAG}_zbc ${NOLTOFLAG}")
elseif(WITH_RVV AND HAVE_RVV_INTRIN)