diff options
-rw-r--r-- | meson.build | 9 | ||||
-rw-r--r-- | src/compositor.c | 10 |
2 files changed, 19 insertions, 0 deletions
diff --git a/meson.build b/meson.build index f8e97a5..d953fe3 100644 --- a/meson.build +++ b/meson.build @@ -203,17 +203,26 @@ if libweston_dep.found() 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') + dir_path_headless_backend = join_paths(prefix_path, 'include', libweston_version, 'libweston', 'backend-headless.h') else dir_path_x11_backend = join_paths(libweston_version, 'libweston', 'backend-x11.h') + dir_path_x11_backend = join_paths(libweston_version, 'libweston', 'backend-headless.h') endif else message('Building with cross environment') dir_path_x11_backend = join_paths(libweston_version, 'libweston', 'backend-x11.h') + dir_path_headless_backend = join_paths(libweston_version, 'libweston', 'backend-headless.h') endif # do the test if cc.has_header(dir_path_x11_backend) config_h.set('HAVE_BACKEND_X11', 1) + message('Building with X11 backend') + endif + + if cc.has_header(dir_path_headless_backend) + config_h.set('HAVE_BACKEND_HEADLESS', 1) + message('Building with headless backend') endif endif diff --git a/src/compositor.c b/src/compositor.c index c8f9e60..926cb2c 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -39,7 +39,9 @@ #include <libweston/backend-drm.h> #include <libweston/backend-wayland.h> +#ifdef HAVE_BACKEND_HEADLESS #include <libweston/backend-headless.h> +#endif #ifdef HAVE_BACKEND_X11 #include <libweston/backend-x11.h> #endif @@ -1087,6 +1089,7 @@ load_x11_backend(struct ivi_compositor *ivi, int *argc, char *argv[]) } #endif +#ifdef HAVE_BACKEND_HEADLESS static int load_headless_backend(struct ivi_compositor *ivi, int *argc, char **argv) { @@ -1134,6 +1137,13 @@ load_headless_backend(struct ivi_compositor *ivi, int *argc, char **argv) return 0; } +#else +static int +load_headless_backend(struct ivi_compositor *ivi, int *argc, char **argv) +{ + return -1; +} +#endif static int load_backend(struct ivi_compositor *ivi, const char *backend, |