gamescope/meson.build

99 lines
2.8 KiB
Meson
Raw Normal View History

project(
'gamescope',
['c','cpp'],
meson_version: '>=0.54.0',
default_options: ['warning_level=2'],
)
add_project_arguments([
'-DWLR_USE_UNSTABLE',
], language: ['c','cpp'])
cc = meson.get_compiler('c')
cppc = meson.get_compiler('cpp')
add_project_arguments(cc.get_supported_arguments([
'-Wno-unused-parameter',
]), language: 'c')
add_project_arguments(cppc.get_supported_arguments([
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
]), 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')
vulkan_dep = dependency('vulkan')
cc = meson.get_compiler('c')
wayland_server = dependency('wayland-server')
wayland_protos = dependency('wayland-protocols', version: '>=1.17')
xkbcommon = dependency('xkbcommon')
math = cc.find_library('m')
thread_dep = dependency('threads')
cap_dep = cc.find_library('cap')
sdl_dep = dependency('SDL2')
wlroots_proj = subproject('wlroots', required: false, default_options:
2020-05-05 08:28:01 +00:00
['default_library=static', 'examples=false'])
if wlroots_proj.found()
wlroots_dep = wlroots_proj.get_variable('wlroots')
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
wlroots_conf = wlroots_proj.get_variable('conf_data')
wlroots_has_xwayland = wlroots_conf.get('WLR_HAS_XWAYLAND') == 1
else
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
wlroots_dep = dependency('wlroots', version: '>= 0.11.0')
wlroots_has_xwayland = cc.get_define('WLR_HAS_XWAYLAND', prefix: '#include <wlr/config.h>', dependencies: wlroots_dep) == '1'
endif
if not wlroots_has_xwayland
error('Cannot use wlroots built without Xwayland support')
endif
shadercompiler = find_program('glslangValidator')
spirv_shader = custom_target('shader_target',
output : 'composite.h',
input : 'src/composite.comp.hlsl',
command : [
shadercompiler, '-V', '-e', 'main', '--vn',
'composite_spv', '@INPUT@', '-o', '@OUTPUT@'
],
install : false,
)
liftoff_proj = subproject('libliftoff', required: false, default_options:
2020-05-05 08:49:44 +00:00
['default_library=static'])
if liftoff_proj.found()
liftoff_dep = liftoff_proj.get_variable('liftoff')
else
liftoff_dep = dependency('liftoff')
endif
executable(
'gamescope',
2020-01-23 05:50:01 +00:00
'src/steamcompmgr.cpp',
'src/main.cpp',
'src/wlserver.cpp',
'src/drm.cpp',
'src/sdlwindow.cpp',
'src/vblankmanager.cpp',
[ 'src/rendervulkan.cpp', spirv_shader ],
dependencies : [
dep_x11, dep_xdamage, dep_xcomposite, dep_xrender, dep_xext, dep_xfixes,
dep_xxf86vm, dep_xres, drm_dep, wayland_server, wayland_protos,
xkbcommon, math, thread_dep, sdl_dep, wlroots_dep,
vulkan_dep, liftoff_dep, dep_xtst, cap_dep
],
install: true,
)