Skip to content

Commit a29c53f

Browse files
author
Barnabás Pőcze
committed
meson: Use libyaml wrap file from wrapdb
Use the libyaml wrap file from the meson wrapdb instead of creating the wrap file manually and using the cmake module. This provides better integration with meson, such as the `force_fallback_for` built-in option. This is also needed because the upstream CMakeLists.txt is out of date, failing with a sufficiently new cmake version: CMake Error at CMakeLists.txt:2 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake. The above is nonetheless addressed by yaml/libyaml#314, but the project seems a bit inactive at the moment. The wrap file was added using `meson wrap install libyaml`, and it can be updated using `meson wrap update libyaml`. `default_library=static` is used to match the behaviour of the previously used cmake build. `werror=false` needs to be set because libyaml does not compile without warnings, and that would abort the build process otherwise. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
1 parent 5f4d2ac commit a29c53f

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

src/libcamera/meson.build

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ if not cc.has_function('dlopen')
8484
libdl = cc.find_library('dl')
8585
endif
8686
libudev = dependency('libudev', required : get_option('udev'))
87-
libyaml = dependency('yaml-0.1', required : false)
87+
libyaml = dependency('yaml-0.1', default_options : [
88+
'default_library=static',
89+
'werror=false',
90+
])
8891

8992
# Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first.
9093
libcrypto = dependency('gnutls', required : false)
@@ -120,17 +123,6 @@ if libudev.found()
120123
])
121124
endif
122125

123-
# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP.
124-
if not libyaml.found()
125-
cmake = import('cmake')
126-
127-
libyaml_vars = cmake.subproject_options()
128-
libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'})
129-
libyaml_vars.append_compile_args('c', '-Wno-unused-value')
130-
libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars)
131-
libyaml = libyaml_wrap.dependency('yaml')
132-
endif
133-
134126
control_sources = []
135127

136128
controls_mode_files = {

subprojects/libyaml.wrap

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# SPDX-License-Identifier: CC0-1.0
22

3-
[wrap-git]
4-
directory = libyaml
5-
url = https://github.com/yaml/libyaml
6-
# tags/0.2.5
7-
revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6
3+
[wrap-file]
4+
directory = yaml-0.2.5
5+
source_url = https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz
6+
source_filename = yaml-0.2.5.tar.gz
7+
source_hash = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4
8+
patch_filename = libyaml_0.2.5-1_patch.zip
9+
patch_url = https://wrapdb.mesonbuild.com/v2/libyaml_0.2.5-1/get_patch
10+
patch_hash = bf2e9b922be00b6b00c5fce29d9fb8dc83f0431c77239f3b73e8b254d3f3f5b5
11+
12+
[provide]
13+
yaml-0.1 = yaml_dep

0 commit comments

Comments
 (0)