summaryrefslogtreecommitdiff
path: root/src/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'src/meson.build')
-rw-r--r--src/meson.build19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build
index 165a77bb..91bea775 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -27,6 +27,25 @@ else
ipa_sign_module = false
endif
+libyuv_dep = dependency('libyuv', required : false)
+
+# Fallback to a subproject if libyuv isn't found, as it's typically not
+# provided by distributions.
+if not libyuv_dep.found()
+ cmake = import('cmake')
+
+ libyuv_vars = cmake.subproject_options()
+ libyuv_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'})
+ libyuv_vars.set_override_option('cpp_std', 'c++17')
+ libyuv_vars.append_compile_args('cpp',
+ '-Wno-sign-compare',
+ '-Wno-unused-variable',
+ '-Wno-unused-parameter')
+ libyuv_vars.append_link_args('-ljpeg')
+ libyuv = cmake.subproject('libyuv', options : libyuv_vars)
+ libyuv_dep = libyuv.dependency('yuv')
+endif
+
# libcamera must be built first as a dependency to the other components.
subdir('libcamera')