mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-11 09:25:26 +00:00
435d5a9b9e
Instead of maintaining this chunk of code and build options, the Vulkan loader can be used to load up validation. This has the advantage that no layer name needs to be hard coded inside Monado, which was subject of change recently. Instead of using our own environment variable we can easily set the one from the loader, e.g. `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`.
122 lines
2.8 KiB
Meson
122 lines
2.8 KiB
Meson
# Copyright 2019-2020, Collabora, Ltd.
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
subdir('shaders')
|
|
|
|
comp_include = include_directories('.')
|
|
|
|
# TODO: Dependency resolution and subsequent configuration could be improved
|
|
compositor_deps = [aux, shaders, vulkan, xrt_config_vulkan]
|
|
compositor_includes = [xrt_include]
|
|
|
|
compositor_srcs = [
|
|
'client/comp_vk_client.c',
|
|
'client/comp_vk_client.h',
|
|
'client/comp_vk_glue.c',
|
|
'main/comp_compositor.c',
|
|
'main/comp_compositor.h',
|
|
'main/comp_distortion.c',
|
|
'main/comp_distortion.h',
|
|
'main/comp_documentation.h',
|
|
'main/comp_renderer.c',
|
|
'main/comp_renderer.h',
|
|
'main/comp_settings.c',
|
|
'main/comp_settings.h',
|
|
'main/comp_swapchain.c',
|
|
'main/comp_vk_swapchain.c',
|
|
'main/comp_vk_swapchain.h',
|
|
'main/comp_window.h',
|
|
'main/comp_layer_renderer.c',
|
|
'main/comp_layer.c',
|
|
]
|
|
|
|
compile_args = []
|
|
|
|
if build_xcb
|
|
compositor_srcs += ['main/comp_window_xcb.c']
|
|
compositor_deps += [xcb]
|
|
endif
|
|
|
|
if build_xcb_xrandr_direct
|
|
compositor_srcs += ['main/comp_window_direct.c',
|
|
'main/comp_window_direct_randr.c',
|
|
'main/comp_window_direct_nvidia.c']
|
|
compositor_deps += [xcb_randr, x11_xcb]
|
|
endif
|
|
|
|
if build_opengl
|
|
compositor_srcs += [
|
|
'client/comp_gl_client.c',
|
|
'client/comp_gl_client.h',
|
|
'client/comp_gl_glue.c',
|
|
'client/comp_gles_glue.c',
|
|
]
|
|
compositor_deps += [opengl]
|
|
compositor_includes += [glad_include]
|
|
endif
|
|
|
|
if build_opengl and build_xlib
|
|
compositor_srcs += [
|
|
'client/comp_gl_xlib_client.c',
|
|
'client/comp_gl_xlib_client.h',
|
|
'client/comp_gl_xlib_glue.c',
|
|
]
|
|
compositor_deps += [x11]
|
|
endif
|
|
|
|
if build_egl
|
|
compositor_srcs += [
|
|
'client/comp_egl_glue.c',
|
|
]
|
|
compositor_deps += [egl]
|
|
endif
|
|
|
|
if build_wayland
|
|
wl_protos_src = []
|
|
wl_protos_headers = []
|
|
wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')
|
|
|
|
protocols = [
|
|
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
|
|
]
|
|
|
|
foreach p : protocols
|
|
xml = join_paths(p)
|
|
wl_protos_src += custom_target(
|
|
xml.underscorify() + '_c',
|
|
input: xml,
|
|
output: '@BASENAME@-protocol.c',
|
|
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
|
|
)
|
|
wl_protos_headers += custom_target(
|
|
xml.underscorify() + '_client_h',
|
|
input: xml,
|
|
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_srcs += ['main/comp_window_wayland.c']
|
|
compositor_deps += [wayland, wl_protos]
|
|
endif
|
|
|
|
lib_comp = static_library(
|
|
'comp',
|
|
compositor_srcs,
|
|
include_directories: compositor_includes,
|
|
dependencies: compositor_deps,
|
|
c_args: compile_args,
|
|
cpp_args: compile_args,
|
|
)
|