diff --git a/meson.build b/meson.build index cc13180ba..021c31310 100644 --- a/meson.build +++ b/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 , 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)