2021-03-11 22:40:40 +00:00
|
|
|
# Copyright 2019-2021, Collabora, Ltd.
|
2019-09-24 13:43:43 +00:00
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
|
|
|
|
subdir('shaders')
|
|
|
|
|
2020-04-16 15:56:59 +00:00
|
|
|
comp_include = include_directories('.')
|
|
|
|
|
2019-10-29 16:11:48 +00:00
|
|
|
# TODO: Dependency resolution and subsequent configuration could be improved
|
2020-06-12 22:22:35 +00:00
|
|
|
compositor_deps = [aux, shaders, vulkan, xrt_config_vulkan, xcb_randr]
|
2020-03-31 19:59:02 +00:00
|
|
|
compositor_includes = [xrt_include]
|
2019-09-24 13:43:43 +00:00
|
|
|
|
|
|
|
compositor_srcs = [
|
|
|
|
'client/comp_vk_client.c',
|
|
|
|
'client/comp_vk_client.h',
|
2020-03-01 12:17:15 +00:00
|
|
|
'client/comp_vk_glue.c',
|
2019-09-24 13:43:43 +00:00
|
|
|
'main/comp_compositor.c',
|
|
|
|
'main/comp_compositor.h',
|
|
|
|
'main/comp_documentation.h',
|
|
|
|
'main/comp_renderer.c',
|
|
|
|
'main/comp_renderer.h',
|
|
|
|
'main/comp_settings.c',
|
|
|
|
'main/comp_settings.h',
|
2020-11-06 17:32:43 +00:00
|
|
|
'main/comp_target.h',
|
2020-11-08 22:38:11 +00:00
|
|
|
'main/comp_target_swapchain.c',
|
|
|
|
'main/comp_target_swapchain.h',
|
2019-09-24 13:43:43 +00:00
|
|
|
'main/comp_window.h',
|
2020-05-08 19:25:25 +00:00
|
|
|
'main/comp_layer_renderer.c',
|
|
|
|
'main/comp_layer.c',
|
2021-03-11 22:40:40 +00:00
|
|
|
'multi/comp_multi_compositor.c',
|
|
|
|
'multi/comp_multi_interface.h',
|
|
|
|
'multi/comp_multi_private.h',
|
|
|
|
'multi/comp_multi_system.c',
|
2020-10-05 22:30:31 +00:00
|
|
|
'render/comp_buffer.c',
|
2021-05-04 17:24:38 +00:00
|
|
|
'render/comp_compute.c',
|
2020-10-05 22:30:31 +00:00
|
|
|
'render/comp_render.h',
|
|
|
|
'render/comp_rendering.c',
|
|
|
|
'render/comp_resources.c',
|
2021-10-01 20:07:47 +00:00
|
|
|
'render/comp_shaders.c',
|
2021-10-01 19:50:09 +00:00
|
|
|
'render/comp_util.c',
|
2021-11-03 20:15:59 +00:00
|
|
|
'util/comp_base.h',
|
|
|
|
'util/comp_base.c',
|
2021-11-03 17:06:46 +00:00
|
|
|
'util/comp_swapchain.h',
|
|
|
|
'util/comp_swapchain.c',
|
|
|
|
'util/comp_sync.h',
|
|
|
|
'util/comp_sync.c',
|
2021-11-05 10:41:35 +00:00
|
|
|
'util/comp_vulkan.h',
|
|
|
|
'util/comp_vulkan.c',
|
2019-09-24 13:43:43 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
compile_args = []
|
|
|
|
|
2020-01-14 18:21:23 +00:00
|
|
|
if build_xcb
|
2020-04-01 12:17:51 +00:00
|
|
|
compositor_srcs += ['main/comp_window_xcb.c']
|
2019-09-24 13:43:43 +00:00
|
|
|
compositor_deps += [xcb]
|
|
|
|
endif
|
|
|
|
|
2021-02-10 20:57:58 +00:00
|
|
|
if build_vk_khr_display
|
|
|
|
compositor_srcs += ['main/comp_window_vk_display.c']
|
|
|
|
endif
|
|
|
|
|
2020-01-14 18:21:23 +00:00
|
|
|
if build_xcb_xrandr_direct
|
2021-02-10 20:57:58 +00:00
|
|
|
compositor_srcs += ['main/comp_window_direct_randr.c',
|
2020-04-03 16:35:05 +00:00
|
|
|
'main/comp_window_direct_nvidia.c']
|
2020-03-31 15:15:57 +00:00
|
|
|
compositor_deps += [xcb_randr, x11_xcb]
|
2019-09-24 13:43:43 +00:00
|
|
|
endif
|
|
|
|
|
2021-02-10 20:57:58 +00:00
|
|
|
if build_vk_khr_display or build_xcb_xrandr_direct
|
|
|
|
compositor_srcs += ['main/comp_window_direct.c']
|
|
|
|
endif
|
|
|
|
|
2020-07-16 22:22:59 +00:00
|
|
|
if build_opengl or build_opengles
|
2020-01-14 18:21:23 +00:00
|
|
|
compositor_srcs += [
|
|
|
|
'client/comp_gl_client.c',
|
|
|
|
'client/comp_gl_client.h',
|
2020-07-17 22:51:45 +00:00
|
|
|
'client/comp_gl_memobj_swapchain.c',
|
|
|
|
'client/comp_gl_memobj_swapchain.h',
|
2020-07-16 22:22:59 +00:00
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if build_opengl
|
|
|
|
compositor_srcs += [
|
2020-03-01 12:17:15 +00:00
|
|
|
'client/comp_gl_glue.c',
|
2020-01-14 18:21:23 +00:00
|
|
|
]
|
|
|
|
compositor_deps += [opengl]
|
2020-03-31 19:59:02 +00:00
|
|
|
compositor_includes += [glad_include]
|
2020-01-14 18:21:23 +00:00
|
|
|
endif
|
2020-07-16 22:22:59 +00:00
|
|
|
if build_opengles
|
|
|
|
compositor_srcs += [
|
|
|
|
'client/comp_gles_glue.c',
|
|
|
|
]
|
|
|
|
compositor_deps += [opengles]
|
|
|
|
compositor_includes += [glad_include]
|
|
|
|
endif
|
2020-07-17 22:51:45 +00:00
|
|
|
if build_egl
|
|
|
|
compositor_srcs += [
|
|
|
|
'client/comp_gl_eglimage_swapchain.c',
|
|
|
|
'client/comp_gl_eglimage_swapchain.h',
|
|
|
|
]
|
|
|
|
endif
|
2020-01-14 18:21:23 +00:00
|
|
|
|
|
|
|
if build_opengl and build_xlib
|
|
|
|
compositor_srcs += [
|
|
|
|
'client/comp_gl_xlib_client.c',
|
2020-03-01 12:17:15 +00:00
|
|
|
'client/comp_gl_xlib_client.h',
|
|
|
|
'client/comp_gl_xlib_glue.c',
|
2020-01-14 18:21:23 +00:00
|
|
|
]
|
|
|
|
compositor_deps += [x11]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if build_egl
|
|
|
|
compositor_srcs += [
|
2021-04-28 12:50:58 +00:00
|
|
|
'client/comp_egl_client.c',
|
2021-05-26 12:23:37 +00:00
|
|
|
'client/comp_egl_client.h',
|
2020-01-14 18:21:23 +00:00
|
|
|
]
|
|
|
|
compositor_deps += [egl]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if build_wayland
|
2019-09-19 20:27:56 +00:00
|
|
|
wl_protos_src = []
|
|
|
|
wl_protos_headers = []
|
|
|
|
wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')
|
|
|
|
|
|
|
|
protocols = [
|
2021-09-14 15:11:40 +00:00
|
|
|
wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml',
|
2019-09-19 20:27:56 +00:00
|
|
|
]
|
|
|
|
|
2021-09-14 15:11:40 +00:00
|
|
|
if build_wayland_direct
|
|
|
|
protocols += wl_protocol_dir / 'staging/drm-lease/drm-lease-v1.xml'
|
|
|
|
compositor_srcs += 'main/comp_window_direct_wayland.c'
|
|
|
|
compositor_deps += drm
|
|
|
|
endif
|
|
|
|
|
|
|
|
compositor_srcs += 'main/comp_window_wayland.c'
|
|
|
|
|
|
|
|
foreach path : protocols
|
2019-09-19 20:27:56 +00:00
|
|
|
wl_protos_src += custom_target(
|
2021-09-14 15:11:40 +00:00
|
|
|
path.underscorify() + '_c',
|
|
|
|
input: path,
|
2019-09-19 20:27:56 +00:00
|
|
|
output: '@BASENAME@-protocol.c',
|
|
|
|
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
|
|
|
|
)
|
|
|
|
wl_protos_headers += custom_target(
|
2021-09-14 15:11:40 +00:00
|
|
|
path.underscorify() + '_client_h',
|
|
|
|
input: path,
|
2019-09-19 20:27:56 +00:00
|
|
|
output: '@BASENAME@-client-protocol.h',
|
|
|
|
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
lib_wl_protos = static_library(
|
|
|
|
'wl_protos',
|
|
|
|
wl_protos_src + wl_protos_headers,
|
|
|
|
dependencies: wayland.partial_dependency(compile_args: true),
|
|
|
|
)
|
|
|
|
|
|
|
|
wl_protos = declare_dependency(
|
|
|
|
link_with: lib_wl_protos,
|
|
|
|
sources: wl_protos_headers,
|
|
|
|
)
|
|
|
|
|
|
|
|
compositor_deps += [wayland, wl_protos]
|
2021-09-14 15:11:40 +00:00
|
|
|
|
2019-09-19 20:27:56 +00:00
|
|
|
endif
|
2019-09-24 13:43:43 +00:00
|
|
|
|
|
|
|
lib_comp = static_library(
|
|
|
|
'comp',
|
|
|
|
compositor_srcs,
|
2020-03-31 19:59:02 +00:00
|
|
|
include_directories: compositor_includes,
|
2019-09-24 13:43:43 +00:00
|
|
|
dependencies: compositor_deps,
|
|
|
|
c_args: compile_args,
|
|
|
|
cpp_args: compile_args,
|
|
|
|
)
|