meson.build: Allow to build/install locally 30/23730/3
authorMarius Vlad <marius.vlad@collabora.com>
Fri, 31 Jan 2020 23:52:32 +0000 (01:52 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Mon, 10 Feb 2020 18:43:51 +0000 (18:43 +0000)
The cflags from libweston6 already have a libweston6 prefix path, which
is problematic when building locally as the compositor already uses
'libweston-6' as include directive.

This only applies to situations where libweston-6 is not installed in
system's path.

Bug-AGL: SPEC-3150

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib545e727b455fd872da15447e0cd54fea999d294

meson.build

index b7fd577..294d82f 100644 (file)
@@ -88,10 +88,23 @@ foreach proto: protocols
     endforeach
 endforeach
 
+# libweston-6 pkg-config file already has 'libweston-6' as prefix but
+# agl-compositor uses 'libweston-6' also. This makes use of the prefix
+# path as to allow building and installing the compositor locally
+prefix_path = get_option('prefix')
+message('prefix_path ' + prefix_path)
+if not prefix_path.contains('/usr')
+  additional_include_dir = include_directories(prefix_path + '/' + 'include')
+  local_dep = declare_dependency(include_directories: additional_include_dir)
+else
+  local_dep = []
+endif
+
 deps_libweston = [
   dependency('wayland-server'),
   dependency('libweston-6'),
   dependency('libweston-desktop-6'),
+  local_dep,
 ]
 
 srcs_agl_compositor = [