From 7ad044836d037345f4e3df077c51df8f4015dc86 Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Fri, 28 Aug 2026 13:29:33 -0700 Subject: [PATCH] Do not use glob in the hdrs list of libyuv library Some headers in the include/libyuv directory are private headers and should not be visible to the clients of the libyuv library target. List the public headers explicitly in the hdrs list of the libyuv library target. Ideally those private headers should be moved to some other directory such as the source/ directory. Change-Id: I04b1e209f6891f06c688fcf0bf5d167e82a27818 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8308801 Reviewed-by: Mirko Bonadei Commit-Queue: Wan-Teh Chang Reviewed-by: Frank Barchard --- BUILD.bazel | 25 ++++++++++++++++++++++++- libyuv.bzl | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index d71502313..ad2cd3df2 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -85,7 +85,30 @@ ALL_DEPS = NEON_DEPS + SVE_DEPS + PLATFORM_DEPS cc_library( name = "libyuv", - hdrs = native.glob([PREFIX + "include/**/*.h"]), + hdrs = [ + PREFIX + "include/libyuv.h", + # Headers included by libyuv.h. + PREFIX + "include/libyuv/basic_types.h", + PREFIX + "include/libyuv/compare.h", + PREFIX + "include/libyuv/convert.h", + PREFIX + "include/libyuv/convert_argb.h", + PREFIX + "include/libyuv/convert_from.h", + PREFIX + "include/libyuv/convert_from_argb.h", + PREFIX + "include/libyuv/cpu_id.h", + PREFIX + "include/libyuv/mjpeg_decoder.h", + PREFIX + "include/libyuv/planar_functions.h", + PREFIX + "include/libyuv/rotate.h", + PREFIX + "include/libyuv/rotate_argb.h", + PREFIX + "include/libyuv/row.h", # Bug 553148013: Should be private. + PREFIX + "include/libyuv/scale.h", + PREFIX + "include/libyuv/scale_argb.h", + PREFIX + "include/libyuv/scale_rgb.h", + PREFIX + "include/libyuv/scale_uv.h", + PREFIX + "include/libyuv/version.h", + PREFIX + "include/libyuv/video_common.h", + # Headers included by libyuv/row.h. + PREFIX + "include/libyuv/cpu_support.h", # Bug 553148013: Should be private. + ], strip_include_prefix = PREFIX + "include", visibility = ["//visibility:public"], deps = [":libyuv_impl"], diff --git a/libyuv.bzl b/libyuv.bzl index 53e23019b..4bdd4627f 100644 --- a/libyuv.bzl +++ b/libyuv.bzl @@ -21,7 +21,7 @@ def libyuv_hdrs(prefix = ""): prefix + "include/libyuv/convert.h", prefix + "include/libyuv/convert_from_argb.h", prefix + "include/libyuv/cpu_id.h", - prefix + "include/libyuv/row.h", + prefix + "include/libyuv/row.h", # Bug 553148013: Should be private. ] def libyuv_neon_srcs(prefix = ""):