Commit b68847a8 authored by Philipp Zabel's avatar Philipp Zabel Committed by Philipp Zabel

meson: fix compositor build with xwayland disabled

If xwayland is disabled, compositor/weston is built without
compositor/xwayland.c, which defines wet_load_xwayland.

  compositor/fb12c4d@@weston@exe/main.c.o: In function `main':
  ../weston-5.0.0-169-g2d4cc4f4/compositor/main.c:3103: undefined reference to `wet_load_xwayland'

Provide an empty stub for wet_load_xwayland if xwayland is disabled.
With that we also have to remove xwayland.c from the autotools build
if xwayland is disabled, to avoid a multiple definition error.
Signed-off-by: Philipp Zabel's avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent cca73465
Pipeline #19428 passed with stage
in 6 minutes and 8 seconds
......@@ -210,8 +210,11 @@ weston_LDADD = libshared.la libweston-@LIBWESTON_MAJOR@.la \
weston_SOURCES = \
compositor/main.c \
compositor/weston-screenshooter.c \
compositor/text-backend.c \
compositor/text-backend.c
if ENABLE_XWAYLAND
weston_SOURCES += \
compositor/xwayland.c
endif
# Track this dependency explicitly instead of using BUILT_SOURCES. We
# add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h
......
......@@ -646,7 +646,9 @@ usage(int error_code)
" --shell=MODULE\tShell module, defaults to desktop-shell.so\n"
" -S, --socket=NAME\tName of socket to listen on\n"
" -i, --idle-time=SECS\tIdle time in seconds\n"
#if defined(BUILD_XWAYLAND)
" --xwayland\t\tLoad the xwayland module\n"
#endif
" --modules\t\tLoad the comma-separated list of modules\n"
" --log=FILE\t\tLog to the given file\n"
" -c, --config=FILE\tConfig file to load, defaults to weston.ini\n"
......@@ -2876,6 +2878,14 @@ copy_command_line(int argc, char * const argv[])
return str;
}
#if !defined(BUILD_XWAYLAND)
int
wet_load_xwayland(struct weston_compositor *comp)
{
return -1;
}
#endif
int main(int argc, char *argv[])
{
int ret = EXIT_FAILURE;
......@@ -2916,7 +2926,9 @@ int main(int argc, char *argv[])
{ WESTON_OPTION_STRING, "shell", 0, &shell },
{ WESTON_OPTION_STRING, "socket", 'S', &socket_name },
{ WESTON_OPTION_INTEGER, "idle-time", 'i', &idle_time },
#if defined(BUILD_XWAYLAND)
{ WESTON_OPTION_BOOLEAN, "xwayland", 0, &xwayland },
#endif
{ WESTON_OPTION_STRING, "modules", 0, &option_modules },
{ WESTON_OPTION_STRING, "log", 0, &log },
{ WESTON_OPTION_BOOLEAN, "help", 'h', &help },
......
......@@ -20,6 +20,8 @@ deps_weston = [
]
if get_option('xwayland')
config_h.set('BUILD_XWAYLAND', '1')
srcs_weston += 'xwayland.c'
config_h.set_quoted('XSERVER_PATH', get_option('xwayland-path'))
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment