libyuv/libyuv.bzl
Frank Barchard 137e29972e [libyuv] Simplify RVV configuration in BUILD.bazel and libyuv.bzl
Restructure RISC-V Vector (RVV) configuration to follow the pattern
used by NEON and SVE:
- Move RVV_COPTS immediately after SVE_COPTS.
- Define ENABLE_RVV_COPTS (-march=rv32gcv) and ENABLE_RVV64_COPTS
  (-march=rv64gcv) with SUPPORTS_RVV_COPTS (-DLIBYUV_RVV).
- Revert ALL_COPTS to PLATFORM_COPTS so RVV vector flags are not
  applied to generic sources.
- Add ALL_RVV_COPTS, RVV_DEPS, and libyuv_rvv_impl target.
- Update libyuv.bzl to add libyuv_rvv_srcs and exclude source/*rvv*.cc
  from libyuv_srcs.

R=wtc@google.com

Test: cmake -B out/Release -DUNIT_TEST=ON && cmake --build out/Release
Bug: none
Change-Id: Ia60a8bc1da9db46f0c5295064d7b9d3d5609a38f
TAG=agy
CONV=06856819-10a7-4815-93d3-cdcd32da7495
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8357976
Reviewed-by: richard winterton <rrwinterton@gmail.com>
2026-09-08 17:50:17 -07:00

51 lines
1.3 KiB
Python

# Copyright 2026 The LibYuv Project Authors. All rights reserved.
#
# Shared target definitions for Bazel and Blaze builds.
def libyuv_srcs(prefix = ""):
return native.glob(
[
prefix + "source/*.cc",
prefix + "include/libyuv/*.h",
],
exclude = [
prefix + "source/*neon*.cc",
prefix + "source/*rvv*.cc",
prefix + "source/*sve*.cc",
prefix + "source/*sme*.cc",
],
)
def libyuv_hdrs(prefix = ""):
return [
prefix + "include/libyuv/compare.h",
prefix + "include/libyuv/convert.h",
prefix + "include/libyuv/convert_from_argb.h",
prefix + "include/libyuv/cpu_id.h",
prefix + "include/libyuv/row.h", # Bug 553148013: Should be private.
]
def libyuv_neon_srcs(prefix = ""):
return native.glob([
prefix + "source/*neon*.cc",
prefix + "include/libyuv/*.h",
])
def libyuv_rvv_srcs(prefix = ""):
return native.glob([
prefix + "source/*rvv*.cc",
prefix + "include/libyuv/*.h",
])
def libyuv_sve_srcs(prefix = ""):
return native.glob([
prefix + "source/*sve*.cc",
prefix + "include/libyuv/*.h",
])
def libyuv_test_srcs(prefix = ""):
return native.glob([
prefix + "unit_test/*.cc",
prefix + "unit_test/*.h",
])