mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-22 06:59:46 -05:00
Make it possible to enable/disable the various compositors from configure
This commit is contained in:
parent
c5d6be9530
commit
a941022372
3 changed files with 59 additions and 9 deletions
|
|
@ -13,19 +13,32 @@ compositor_LDADD = \
|
|||
$(top_builddir)/wayland/libwayland-client.la \
|
||||
$(COMPOSITOR_LIBS)
|
||||
|
||||
if ENABLE_DRM_COMPOSITOR
|
||||
drm_compositor_sources = compositor-drm.c tty.c evdev.c
|
||||
drm_sources = drm.c
|
||||
endif
|
||||
|
||||
if ENABLE_X11_COMPOSITOR
|
||||
x11_compositor_sources = compositor-x11.c
|
||||
drm_sources = drm.c
|
||||
endif
|
||||
|
||||
if ENABLE_WAYLAND_COMPOSITOR
|
||||
wayland_compositor_sources = compositor-wayland.c
|
||||
drm_sources = drm.c
|
||||
endif
|
||||
|
||||
compositor_SOURCES = \
|
||||
compositor.c \
|
||||
compositor.h \
|
||||
compositor-drm.c \
|
||||
compositor-x11.c \
|
||||
compositor-wayland.c \
|
||||
screenshooter.c \
|
||||
screenshooter-protocol.c \
|
||||
screenshooter-server-protocol.h \
|
||||
tty.c \
|
||||
evdev.c \
|
||||
drm.c \
|
||||
shm.c
|
||||
shm.c \
|
||||
$(drm_compositor_sources) \
|
||||
$(x11_compositor_sources) \
|
||||
$(wayland_compositor_sources) \
|
||||
$(drm_sources)
|
||||
|
||||
udevrulesddir = $(sysconfdir)/udev/rules.d
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -1462,12 +1464,22 @@ int main(int argc, char *argv[])
|
|||
|
||||
display = wl_display_create();
|
||||
|
||||
ec = NULL;
|
||||
|
||||
#if BUILD_WAYLAND_COMPOSITOR
|
||||
if (getenv("WAYLAND_DISPLAY"))
|
||||
ec = wayland_compositor_create(display, width, height);
|
||||
else if (getenv("DISPLAY"))
|
||||
#endif
|
||||
|
||||
#if BUILD_X11_COMPOSITOR
|
||||
if (ec == NULL && getenv("DISPLAY"))
|
||||
ec = x11_compositor_create(display, width, height);
|
||||
else
|
||||
#endif
|
||||
|
||||
#if BUILD_DRM_COMPOSITOR
|
||||
if (ec == NULL)
|
||||
ec = drm_compositor_create(display, option_connector);
|
||||
#endif
|
||||
|
||||
if (ec == NULL) {
|
||||
fprintf(stderr, "failed to create compositor\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue