2020-05-15 10:03:55 +02:00
|
|
|
project(
|
|
|
|
|
'gamescope',
|
2022-01-10 21:24:46 -08:00
|
|
|
'c',
|
2021-07-20 18:43:09 +02:00
|
|
|
'cpp',
|
2022-01-31 14:39:34 +01:00
|
|
|
meson_version: '>=0.58.0',
|
2021-09-10 10:50:41 +02:00
|
|
|
default_options: [
|
2023-01-06 14:58:53 +00:00
|
|
|
'cpp_std=c++20',
|
2021-09-10 10:50:41 +02:00
|
|
|
'warning_level=2',
|
2023-11-21 14:38:53 -08:00
|
|
|
'force_fallback_for=wlroots,libliftoff,vkroots',
|
2021-09-10 10:50:41 +02:00
|
|
|
],
|
2020-05-15 10:03:55 +02:00
|
|
|
)
|
2019-10-02 17:08:47 -04:00
|
|
|
|
2019-10-23 18:31:18 -07:00
|
|
|
add_project_arguments([
|
2021-07-20 18:39:23 +02:00
|
|
|
'-DWLR_USE_UNSTABLE',
|
2021-07-20 18:43:09 +02:00
|
|
|
], language: 'cpp')
|
2019-10-23 18:31:18 -07:00
|
|
|
|
2020-05-15 10:03:55 +02:00
|
|
|
cppc = meson.get_compiler('cpp')
|
|
|
|
|
|
2022-12-24 17:20:40 +00:00
|
|
|
data_dir = get_option('datadir')
|
|
|
|
|
prefix = get_option('prefix')
|
|
|
|
|
lib_dir = get_option('libdir')
|
|
|
|
|
|
2020-05-15 10:03:55 +02:00
|
|
|
add_project_arguments(cppc.get_supported_arguments([
|
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
|
'-Wno-missing-field-initializers',
|
2022-01-07 05:24:40 +00:00
|
|
|
'-Wno-c99-designator',
|
2022-08-23 23:18:58 +00:00
|
|
|
'-Wno-invalid-offsetof',
|
|
|
|
|
'-Wno-unused-const-variable',
|
2023-04-20 22:39:56 +01:00
|
|
|
'-Wno-volatile', # glm warning
|
|
|
|
|
'-Wno-deprecated-volatile',
|
2023-09-14 16:26:45 +01:00
|
|
|
'-Wno-ignored-qualifiers', # reshade warning
|
|
|
|
|
'-Wno-missing-braces',
|
2020-05-15 10:03:55 +02:00
|
|
|
]), language: 'cpp')
|
|
|
|
|
|
2023-05-09 02:54:18 +00:00
|
|
|
add_project_arguments(cppc.get_supported_arguments([
|
|
|
|
|
'-ffast-math',
|
|
|
|
|
]), language: 'cpp')
|
|
|
|
|
|
2021-07-27 18:01:04 +02:00
|
|
|
pipewire_dep = dependency('libpipewire-0.3', required: get_option('pipewire'))
|
2022-01-26 01:51:36 +01:00
|
|
|
librt_dep = cppc.find_library('rt', required : get_option('pipewire'))
|
2022-09-27 19:54:00 +02:00
|
|
|
hwdata_dep = dependency('hwdata')
|
2019-10-23 18:31:18 -07:00
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
dep_x11 = dependency('x11')
|
2023-09-26 11:34:40 -03:00
|
|
|
dep_wayland = dependency('wayland-client')
|
2022-12-24 16:59:24 +00:00
|
|
|
vulkan_dep = dependency('vulkan')
|
2020-10-21 00:01:38 +00:00
|
|
|
|
2023-01-11 20:26:00 +00:00
|
|
|
if get_option('enable_openvr_support')
|
2023-03-04 18:52:27 +01:00
|
|
|
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-22 00:12:25 +01:00
|
|
|
endif
|
|
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
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()),
|
2022-12-24 16:59:24 +00:00
|
|
|
'-DHWDATA_PNP_IDS="@0@"'.format(hwdata_dep.get_variable('pkgdatadir') / 'pnp.ids'),
|
|
|
|
|
language: 'cpp',
|
2022-12-15 13:15:25 +00:00
|
|
|
)
|
|
|
|
|
|
2021-10-19 15:20:45 +02: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
|
|
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
subdir('protocol')
|
2021-12-13 11:53:59 +01:00
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
if get_option('enable_gamescope_wsi_layer')
|
|
|
|
|
subdir('layer')
|
2021-12-13 12:03:00 +01:00
|
|
|
endif
|
2019-12-07 20:33:58 -08:00
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
if get_option('enable_gamescope')
|
|
|
|
|
subdir('src')
|
2021-07-27 18:01:04 +02:00
|
|
|
endif
|