From 92fd45381eb54427ef21c42dc136300b603a10e8 Mon Sep 17 00:00:00 2001 From: Thong Thai Date: Mon, 16 Mar 2026 18:09:33 +0000 Subject: [PATCH] meson: check if video encoding support is to be built This commit adds a variable `with_encode` and sets it to true if any "encode" video codec is enabled through the `video-codecs` build option. This allows for video encoding related code to be included/excluded from the build. Signed-off-by: Thong Thai Reviewed-by: David Rosca Part-of: --- meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meson.build b/meson.build index 39d4aad98ce..729de118f23 100644 --- a/meson.build +++ b/meson.build @@ -443,6 +443,15 @@ if _codecs.contains('all') elif _codecs.contains('all_free') _codecs += free_codecs endif + +with_video_encode = false +foreach c : _codecs + if c.contains('enc') + with_video_encode = true + break + endif +endforeach + foreach c : all_codecs pre_args += '-DVIDEO_CODEC_@0@=@1@'.format(c.to_upper(), _codecs.contains(c).to_int()) endforeach @@ -2527,6 +2536,7 @@ if with_any_vk video_apis += 'vulkan' endif video_summary += {'APIs': video_apis.length() != 0 ? video_apis : false} +video_summary += {'Encoding': with_video_encode} summary(video_summary, section: 'Video', bool_yn: true, list_sep: ' ') llvm_summary = {'Required': with_llvm}