gamescope/meson.build

84 lines
2.2 KiB
Meson
Raw Permalink Normal View History

project(
'gamescope',
'c',
2021-07-20 16:43:09 +00:00
'cpp',
meson_version: '>=0.58.0',
2021-09-10 08:50:41 +00:00
default_options: [
'cpp_std=c++20',
2021-09-10 08:50:41 +00:00
'warning_level=2',
2023-11-21 22:38:53 +00:00
'force_fallback_for=wlroots,libliftoff,vkroots',
2021-09-10 08:50:41 +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')
cppc = meson.get_compiler('cpp')
data_dir = get_option('datadir')
prefix = get_option('prefix')
lib_dir = get_option('libdir')
add_project_arguments(cppc.get_supported_arguments([
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wno-c99-designator',
2022-08-23 23:18:58 +00:00
'-Wno-invalid-offsetof',
'-Wno-unused-const-variable',
2023-04-20 21:39:56 +00:00
'-Wno-volatile', # glm warning
'-Wno-deprecated-volatile',
2023-09-14 15:26:45 +00:00
'-Wno-ignored-qualifiers', # reshade warning
'-Wno-missing-braces',
]), language: 'cpp')
add_project_arguments(cppc.get_supported_arguments([
'-ffast-math',
]), language: 'cpp')
2021-07-27 16:01:04 +00:00
pipewire_dep = dependency('libpipewire-0.3', required: get_option('pipewire'))
librt_dep = cppc.find_library('rt', required : get_option('pipewire'))
hwdata_dep = dependency('hwdata')
dep_x11 = dependency('x11')
2023-09-26 14:34:40 +00:00
dep_wayland = dependency('wayland-client')
vulkan_dep = dependency('vulkan')
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
2023-01-11 20:26:00 +00:00
if get_option('enable_openvr_support')
openvr_dep = dependency('openvr', required : false)
2023-01-11 20:26:00 +00:00
if not openvr_dep.found()
cmake = import('cmake')
openvr_var = cmake.subproject_options()
openvr_var.add_cmake_defines({'USE_LIBCXX': false})
openvr_var.set_override_option('warning_level', '0')
openvr_proj = cmake.subproject('openvr', options : openvr_var)
openvr_dep = openvr_proj.dependency('openvr_api')
endif
else
# null dep
openvr_dep = dependency('', required : false)
2022-10-21 23:12:25 +00:00
endif
add_project_arguments(
'-DHAVE_PIPEWIRE=@0@'.format(pipewire_dep.found().to_int()),
2023-01-11 20:26:00 +00:00
'-DHAVE_OPENVR=@0@'.format(openvr_dep.found().to_int()),
'-DHWDATA_PNP_IDS="@0@"'.format(hwdata_dep.get_variable('pkgdatadir') / 'pnp.ids'),
language: 'cpp',
)
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
subdir('protocol')
2021-12-13 10:53:59 +00:00
if get_option('enable_gamescope_wsi_layer')
subdir('layer')
endif
if get_option('enable_gamescope')
subdir('src')
2021-07-27 16:01:04 +00:00
endif