meson.build: Fix building with cross SDK 68/25868/1
authorMarius Vlad <marius.vlad@collabora.com>
Wed, 6 Jan 2021 17:14:12 +0000 (19:14 +0200)
committerMarius Vlad <marius.vlad@collabora.com>
Wed, 6 Jan 2021 22:05:43 +0000 (00:05 +0200)
For some time now, yocto/OE no longer builds all weston back-ends, which
means the X11 is no longer supported on AGL platform.

The agl-compositor can be built, assuming all dependencies have been
satisfied, without the need of having an AGL or yocto/OE environment,
but so far, I've never tried using SDK directly.

This patch should allow building the compositor, by only using the AGL
SDK, and instead of using the local pkg-config, only use what is
available in the SDK sysroot. This takes care of assuming that X11
back-end is available, when in reality, in the AGL SDK platform that is
not the case.

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

meson.build

index bd4cb04..e0ec2ae 100644 (file)
@@ -190,9 +190,14 @@ endif
 # '-I/extra/include/dir, but this should only be used in exceptional cases for
 # includes that can't be detected via pkg-config and passed via dependencies.
 if libweston_dep.found()
-  if not prefix_path.contains('/usr')
-    dir_path_x11_backend = join_paths(prefix_path, 'include', libweston_version, 'libweston', 'backend-x11.h')
+  if not meson.is_cross_build()
+    if not prefix_path.contains('/usr')
+      dir_path_x11_backend = join_paths(prefix_path, 'include', libweston_version, 'libweston', 'backend-x11.h')
+    else
+      dir_path_x11_backend = join_paths(libweston_version, 'libweston', 'backend-x11.h')
+    endif
   else
+    message('Building with cross environment')
     dir_path_x11_backend = join_paths(libweston_version, 'libweston', 'backend-x11.h')
   endif