summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-03-27 19:23:31 +0200
committerPhilip Langdale <github.philipl@overt.org>2023-03-28 09:23:38 -0700
commit10136e77a31e6bf98cf0a4a356c199d907628a6c (patch)
treea891757e4e14b60859e4999125da03b6e7865a1a
parent1ea74f10a746a3c729a59a5c467d1d394e638841 (diff)
downloadmpv-10136e77a31e6bf98cf0a4a356c199d907628a6c.tar.bz2
mpv-10136e77a31e6bf98cf0a4a356c199d907628a6c.tar.xz
build: add an option to control gpu-next
Also simplify meson logic
-rw-r--r--meson.build20
-rw-r--r--meson_options.txt1
-rw-r--r--wscript2
3 files changed, 12 insertions, 11 deletions
diff --git a/meson.build b/meson.build
index 1d63065221..ac8af51d59 100644
--- a/meson.build
+++ b/meson.build
@@ -911,20 +911,20 @@ endif
libplacebo = dependency('libplacebo', version: '>=4.157.0', required: get_option('libplacebo'))
features += {'libplacebo': libplacebo.found()}
-features += {'libplacebo-next': false}
if features['libplacebo']
dependencies += libplacebo
sources += files('video/out/placebo/ra_pl.c',
'video/out/placebo/utils.c')
- pl_api_ver = libplacebo.version().split('.')[1]
- if pl_api_ver.version_compare('>=264')
- features += {'libplacebo-next': true}
- message('libplacebo v5.264.0+ found! Enabling vo_gpu_next.')
- sources += files('video/out/vo_gpu_next.c',
- 'video/out/gpu_next/context.c')
- else
- message('libplacebo v5.264.0+ not found! Disabling vo_gpu_next.')
- endif
+endif
+
+libplacebo_next = get_option('libplacebo-next').require(
+ features['libplacebo'] and libplacebo.version().version_compare('>=5.264.0'),
+ error_message: 'libplacebo v5.264.0+ was not found!',
+)
+features += {'libplacebo-next': libplacebo_next.allowed()}
+if features['libplacebo-next']
+ sources += files('video/out/vo_gpu_next.c',
+ 'video/out/gpu_next/context.c')
endif
sdl2_video = get_option('sdl2-video').require(
diff --git a/meson_options.txt b/meson_options.txt
index 6e9269ffb4..1324a090c1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -75,6 +75,7 @@ option('gl-win32', type: 'feature', value: 'auto', description: 'OpenGL Win32 Ba
option('gl-x11', type: 'feature', value: 'disabled', description: 'OpenGL X11/GLX (deprecated/legacy)')
option('jpeg', type: 'feature', value: 'auto', description: 'JPEG support')
option('libplacebo', type: 'feature', value: 'auto', description: 'libplacebo support')
+option('libplacebo-next', type: 'feature', value: 'auto', description: 'gpu-next video output')
option('rpi', type: 'feature', value: 'disabled', description: 'Raspberry Pi support')
option('sdl2-video', type: 'feature', value: 'auto', description: 'SDL2 video output')
option('shaderc', type: 'feature', value: 'auto', description: 'libshaderc SPIR-V compiler')
diff --git a/wscript b/wscript
index 99f900f236..e55c60d5a5 100644
--- a/wscript
+++ b/wscript
@@ -779,7 +779,7 @@ video_output_features = [
'desc': 'libplacebo support',
'func': check_pkg_config('libplacebo >= 4.157.0'),
}, {
- 'name': 'libplacebo-next',
+ 'name': '--libplacebo-next',
'desc': 'libplacebo v5.264.0+, needed for vo_gpu_next',
'deps': 'libplacebo',
'func': check_preprocessor('libplacebo/config.h', 'PL_API_VER >= 264',