mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-07 13:18:02 +02:00
Fix search path for LZO headers
LZO expects its headers to be included as <lzo/something.h>, but its
pkg-config file specifies only "Cflags: -I${includedir}/lzo". This
happens to work if ${includedir} is already on the header search path,
e.g. it's /usr/include. However, if lzo2 is in an unusual location and
we're depending on pkg-config to tell us where it is, we'll end up looking
for ${includedir}/lzo/lzo/lzo2a.h and failing the build:
util/cairo-script/cairo-script-file.c:45:10: fatal error: 'lzo/lzo2a.h' file not found
Work around the broken pkg-config include path.
Reported to LZO upstream on 2025-03-13.
This commit is contained in:
parent
c8d89d6e5c
commit
3c1135fe84
1 changed files with 12 additions and 0 deletions
12
meson.build
12
meson.build
|
|
@ -203,6 +203,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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue