2020-05-15 08:03:55 +00:00
|
|
|
project(
|
|
|
|
'gamescope',
|
2021-07-20 16:43:09 +00:00
|
|
|
'cpp',
|
2021-10-26 12:32:24 +00:00
|
|
|
meson_version: '>=0.55.0',
|
2021-09-10 08:50:41 +00:00
|
|
|
default_options: [
|
|
|
|
'cpp_std=c++14',
|
|
|
|
'warning_level=2',
|
|
|
|
'force_fallback_for=wlroots,libliftoff',
|
|
|
|
],
|
2020-05-15 08:03:55 +00:00
|
|
|
)
|
2019-10-02 21:08:47 +00:00
|
|
|
|
2019-10-24 01:31:18 +00:00
|
|
|
add_project_arguments([
|
2021-07-20 16:39:23 +00:00
|
|
|
'-DWLR_USE_UNSTABLE',
|
2021-07-20 16:43:09 +00:00
|
|
|
], language: 'cpp')
|
2019-10-24 01:31:18 +00:00
|
|
|
|
2020-05-15 08:03:55 +00:00
|
|
|
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'
|
2020-05-15 08:03:55 +00:00
|
|
|
]), language: 'cpp')
|
|
|
|
|
2019-10-02 21:08:47 +00:00
|
|
|
dep_x11 = dependency('x11')
|
|
|
|
dep_xdamage = dependency('xdamage')
|
|
|
|
dep_xcomposite = dependency('xcomposite')
|
|
|
|
dep_xrender = dependency('xrender')
|
|
|
|
dep_xext = dependency('xext')
|
2020-10-20 17:58:23 +00:00
|
|
|
dep_xfixes = dependency('xfixes')
|
2019-10-02 21:08:47 +00:00
|
|
|
dep_xxf86vm = dependency('xxf86vm')
|
2020-01-19 04:37:11 +00:00
|
|
|
dep_xtst = dependency('xtst')
|
2021-01-05 14:10:06 +00:00
|
|
|
dep_xres = dependency('xres')
|
2019-10-02 21:08:47 +00:00
|
|
|
|
2021-07-20 18:03:30 +00:00
|
|
|
drm_dep = dependency('libdrm', version: '>= 2.4.105')
|
2019-12-07 09:11:33 +00:00
|
|
|
vulkan_dep = dependency('vulkan')
|
2019-10-24 01:31:18 +00:00
|
|
|
|
|
|
|
wayland_server = dependency('wayland-server')
|
|
|
|
wayland_protos = dependency('wayland-protocols', version: '>=1.17')
|
2021-07-20 16:39:23 +00:00
|
|
|
xkbcommon = dependency('xkbcommon')
|
2019-10-24 01:31:18 +00:00
|
|
|
thread_dep = dependency('threads')
|
2021-07-20 16:43:09 +00:00
|
|
|
cap_dep = dependency('libcap')
|
2019-12-09 10:06:44 +00:00
|
|
|
sdl_dep = dependency('SDL2')
|
2021-07-27 16:01:04 +00:00
|
|
|
pipewire_dep = dependency('libpipewire-0.3', required: get_option('pipewire'))
|
2019-10-24 01:31:18 +00:00
|
|
|
|
2021-09-10 23:46:09 +00:00
|
|
|
stb_dep = dependency('stb')
|
|
|
|
|
2021-07-20 16:33:51 +00:00
|
|
|
wlroots_dep = dependency(
|
|
|
|
'wlroots',
|
2021-08-02 11:16:45 +00:00
|
|
|
version: ['>= 0.15.0', '< 0.16.0'],
|
2021-07-20 16:33:51 +00:00
|
|
|
fallback: ['wlroots', 'wlroots'],
|
2021-09-15 16:44:36 +00:00
|
|
|
default_options: ['default_library=static', 'examples=false', 'xwayland=enabled', 'backends=libinput', 'renderers=[]'],
|
2021-07-20 16:33:51 +00:00
|
|
|
)
|
2020-10-21 00:01:38 +00:00
|
|
|
|
2021-09-15 16:57:44 +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
|
2019-11-17 00:56:34 +00:00
|
|
|
|
2021-10-19 13:20:45 +00:00
|
|
|
# Vulkan headers are installed separately from the loader (which ships the
|
|
|
|
# pkg-config file)
|
|
|
|
if not cppc.check_header('vulkan/vulkan.h', dependencies: vulkan_dep)
|
|
|
|
error('Missing vulkan-headers')
|
|
|
|
endif
|
|
|
|
|
2021-07-20 16:56:05 +00:00
|
|
|
shadercompiler = find_program('glslangValidator', native: true)
|
2019-12-08 04:33:58 +00:00
|
|
|
|
|
|
|
spirv_shader = custom_target('shader_target',
|
|
|
|
output : 'composite.h',
|
2021-04-21 15:38:25 +00:00
|
|
|
input : 'src/composite.comp',
|
2020-01-28 20:30:20 +00:00
|
|
|
command : [
|
|
|
|
shadercompiler, '-V', '-e', 'main', '--vn',
|
|
|
|
'composite_spv', '@INPUT@', '-o', '@OUTPUT@'
|
|
|
|
],
|
2019-12-08 04:33:58 +00:00
|
|
|
install : false,
|
|
|
|
)
|
|
|
|
|
2021-07-20 16:33:51 +00:00
|
|
|
liftoff_dep = dependency(
|
|
|
|
'libliftoff',
|
2021-09-30 09:22:40 +00:00
|
|
|
version: ['>= 0.2.0', '< 0.3.0'],
|
2021-07-20 16:33:51 +00:00
|
|
|
fallback: ['libliftoff', 'liftoff'],
|
|
|
|
default_options: ['default_library=static'],
|
|
|
|
)
|
2020-01-06 04:22:27 +00:00
|
|
|
|
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',
|
2021-10-26 14:33:34 +00:00
|
|
|
'src/modegen.cpp',
|
2021-07-27 16:01:04 +00:00
|
|
|
'src/sdlwindow.cpp',
|
|
|
|
'src/vblankmanager.cpp',
|
|
|
|
'src/rendervulkan.cpp',
|
|
|
|
'src/log.cpp',
|
2021-09-14 11:53:19 +00:00
|
|
|
'src/ime.cpp',
|
2021-07-27 16:01:04 +00:00
|
|
|
spirv_shader,
|
|
|
|
]
|
|
|
|
|
|
|
|
if pipewire_dep.found()
|
|
|
|
src += 'src/pipewire.cpp'
|
|
|
|
endif
|
|
|
|
|
2021-07-29 08:09:10 +00:00
|
|
|
subdir('protocol')
|
|
|
|
|
2019-10-02 21:08:47 +00:00
|
|
|
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,
|
2021-09-10 23:46:09 +00:00
|
|
|
vulkan_dep, liftoff_dep, dep_xtst, cap_dep, pipewire_dep, stb_dep,
|
2021-07-20 16:25:36 +00:00
|
|
|
],
|
|
|
|
install: true,
|
2019-10-02 21:08:47 +00:00
|
|
|
)
|