Merge branch 'lzo' into 'master'

Correctly fix search path for LZO headers

See merge request cairo/cairo!616
This commit is contained in:
Benjamin Gilbert 2025-08-31 18:04:05 +00:00
commit 932ce49259
4 changed files with 15 additions and 3 deletions

View file

@ -206,6 +206,18 @@ endif
lzo_dep = dependency('lzo2', required: get_option('lzo'))
if lzo_dep.found()
conf.set('HAVE_LZO', 1)
# LZO <= 2.10 expects its headers to be included as <lzo/something.h>, but
# its pkg-config file specifies -I${includedir}/lzo, so the compiler won't
# find the headers if LZO is installed outside the default include paths.
# Add the correct include path.
lzo_includedir = lzo_dep.get_variable('includedir', default_value: '')
if lzo_includedir != ''
# LZO is not being built as a sibling Meson subproject
lzo_dep = declare_dependency(
compile_args: '-I' + lzo_includedir,
dependencies: lzo_dep,
)
endif
endif
dl_dep = cc.find_library('dl', required: false)

View file

@ -42,7 +42,7 @@
#include <zlib.h>
#if HAVE_LZO
#include <lzo2a.h>
#include <lzo/lzo2a.h>
#endif
#define CHUNK_SIZE 32768

View file

@ -60,7 +60,7 @@
#endif
#if HAVE_LZO
#include <lzo2a.h>
#include <lzo/lzo2a.h>
#endif
#ifdef HAVE_MMAP

View file

@ -46,7 +46,7 @@
#include <zlib.h>
#if HAVE_LZO
#include <lzo2a.h>
#include <lzo/lzo2a.h>
#endif
#define DEBUG_SCAN 0