gamescope/meson.build

115 lines
2.8 KiB
Meson
Raw Normal View History

project(
'gamescope',
2021-07-20 16:43:09 +00:00
'cpp',
meson_version: '>=0.54.0',
2021-09-10 08:50:41 +00:00
default_options: [
'cpp_std=c++14',
'warning_level=2',
'force_fallback_for=wlroots,libliftoff',
],
)
add_project_arguments([
2021-07-20 16:39:23 +00:00
'-DWLR_USE_UNSTABLE',
2021-07-20 16:43:09 +00:00
], language: 'cpp')
cppc = meson.get_compiler('cpp')
add_project_arguments(cppc.get_supported_arguments([
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
2021-09-15 17:03:37 +00:00
'-Wno-c99-designator'
]), language: 'cpp')
dep_x11 = dependency('x11')
dep_xdamage = dependency('xdamage')
dep_xcomposite = dependency('xcomposite')
dep_xrender = dependency('xrender')
dep_xext = dependency('xext')
dep_xfixes = dependency('xfixes')
dep_xxf86vm = dependency('xxf86vm')
dep_xtst = dependency('xtst')
dep_xres = dependency('xres')
drm_dep = dependency('libdrm', version: '>= 2.4.105')
vulkan_dep = dependency('vulkan')
wayland_server = dependency('wayland-server')
wayland_protos = dependency('wayland-protocols', version: '>=1.17')
2021-07-20 16:39:23 +00:00
xkbcommon = dependency('xkbcommon')
thread_dep = dependency('threads')
2021-07-20 16:43:09 +00:00
cap_dep = dependency('libcap')
sdl_dep = dependency('SDL2')
2021-07-27 16:01:04 +00:00
pipewire_dep = dependency('libpipewire-0.3', required: get_option('pipewire'))
stb_dep = dependency('stb')
wlroots_dep = dependency(
'wlroots',
version: ['>= 0.15.0', '< 0.16.0'],
fallback: ['wlroots', 'wlroots'],
default_options: ['default_library=static', 'examples=false', 'xwayland=enabled', 'backends=libinput', 'renderers=[]'],
)
build: abort if wlroots is too old or lacks xwayland src/wlserver.cpp:28:10: fatal error: 'wlr/xwayland.h' file not found #include <wlr/xwayland.h> ^~~~~~~~~~~~~~~~ src/drm.cpp:666:9: error: use of undeclared identifier 'wlr_buffer_lock'; did you mean 'wlr_buffer_ref'? buf = wlr_buffer_lock( buf ); ^~~~~~~~~~~~~~~ wlr_buffer_ref /usr/include/wlr/types/wlr_buffer.h:55:20: note: 'wlr_buffer_ref' declared here struct wlr_buffer *wlr_buffer_ref(struct wlr_buffer *buffer); ^ src/drm.cpp:691:3: error: use of undeclared identifier 'wlr_buffer_unlock'; did you mean 'wlr_buffer_unref'? wlr_buffer_unlock( fb->buf ); ^~~~~~~~~~~~~~~~~ wlr_buffer_unref /usr/include/wlr/types/wlr_buffer.h:60:6: note: 'wlr_buffer_unref' declared here void wlr_buffer_unref(struct wlr_buffer *buffer); ^ src/steamcompmgr.cpp:593:2: error: use of undeclared identifier 'wlr_buffer_unlock'; did you mean 'wlr_buffer_unref'? wlr_buffer_unlock( commit.buf ); ^~~~~~~~~~~~~~~~~ wlr_buffer_unref /usr/include/wlr/types/wlr_buffer.h:60:6: note: 'wlr_buffer_unref' declared here void wlr_buffer_unref(struct wlr_buffer *buffer); ^ src/steamcompmgr.cpp:2491:4: error: use of undeclared identifier 'wlr_buffer_unlock'; did you mean 'wlr_buffer_unref'? wlr_buffer_unlock( buf ); ^~~~~~~~~~~~~~~~~ wlr_buffer_unref /usr/include/wlr/types/wlr_buffer.h:60:6: note: 'wlr_buffer_unref' declared here void wlr_buffer_unref(struct wlr_buffer *buffer); ^ src/steamcompmgr.cpp:2507:46: error: member access into incomplete type 'struct wlr_client_buffer' result = wlr_texture_to_dmabuf( client_buf->texture, &dmabuf ); ^ src/steamcompmgr.cpp:2506:11: note: forward declaration of 'wlr_client_buffer' struct wlr_client_buffer *client_buf = (struct wlr_client_buffer *) buf; ^
2020-10-21 00:01:38 +00:00
required_wlroots_features = ['xwayland', 'libinput_backend']
foreach feat : required_wlroots_features
if wlroots_dep.get_variable('have_' + feat) != 'true'
error('Cannot use wlroots built without ' + feat + ' support')
endif
endforeach
shadercompiler = find_program('glslangValidator', native: true)
spirv_shader = custom_target('shader_target',
output : 'composite.h',
input : 'src/composite.comp',
command : [
shadercompiler, '-V', '-e', 'main', '--vn',
'composite_spv', '@INPUT@', '-o', '@OUTPUT@'
],
install : false,
)
liftoff_dep = dependency(
'libliftoff',
version: ['>= 0.1.0', '< 0.2.0'],
fallback: ['libliftoff', 'liftoff'],
default_options: ['default_library=static'],
)
2021-07-27 16:01:04 +00:00
add_project_arguments(
'-DHAVE_PIPEWIRE=@0@'.format(pipewire_dep.found().to_int()),
language: 'cpp',
)
src = [
'src/steamcompmgr.cpp',
'src/main.cpp',
'src/wlserver.cpp',
'src/drm.cpp',
'src/cvt.cpp',
'src/sdlwindow.cpp',
'src/vblankmanager.cpp',
'src/rendervulkan.cpp',
'src/log.cpp',
spirv_shader,
]
if pipewire_dep.found()
src += 'src/pipewire.cpp'
endif
subdir('protocol')
executable(
2021-07-20 16:25:36 +00:00
'gamescope',
2021-07-27 16:01:04 +00:00
src,
2021-07-20 16:25:36 +00:00
dependencies: [
dep_x11, dep_xdamage, dep_xcomposite, dep_xrender, dep_xext, dep_xfixes,
dep_xxf86vm, dep_xres, drm_dep, wayland_server, wayland_protos,
2021-07-20 16:41:16 +00:00
xkbcommon, thread_dep, sdl_dep, wlroots_dep,
vulkan_dep, liftoff_dep, dep_xtst, cap_dep, pipewire_dep, stb_dep,
2021-07-20 16:25:36 +00:00
],
install: true,
)