2020-05-15 08:03:55 +00:00
|
|
|
project(
|
|
|
|
'gamescope',
|
2022-01-11 05:24:46 +00:00
|
|
|
'c',
|
2021-07-20 16:43:09 +00:00
|
|
|
'cpp',
|
2022-01-31 13:39:34 +00:00
|
|
|
meson_version: '>=0.58.0',
|
2021-09-10 08:50:41 +00:00
|
|
|
default_options: [
|
2023-01-06 14:58:53 +00:00
|
|
|
'cpp_std=c++20',
|
2021-09-10 08:50:41 +00:00
|
|
|
'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')
|
|
|
|
|
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 08:03:55 +00: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 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',
|
2020-05-15 08:03:55 +00: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 16:01:04 +00:00
|
|
|
pipewire_dep = dependency('libpipewire-0.3', required: get_option('pipewire'))
|
2022-01-26 00:51:36 +00:00
|
|
|
librt_dep = cppc.find_library('rt', required : get_option('pipewire'))
|
2022-09-27 17:54:00 +00:00
|
|
|
hwdata_dep = dependency('hwdata')
|
2019-10-24 01:31:18 +00:00
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
dep_x11 = dependency('x11')
|
|
|
|
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 17:52:27 +00: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-21 23:12:25 +00: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 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
|
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
subdir('protocol')
|
2021-12-13 10:53:59 +00:00
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
if get_option('enable_gamescope_wsi_layer')
|
|
|
|
subdir('layer')
|
2021-12-13 11:03:00 +00:00
|
|
|
endif
|
2019-12-08 04:33:58 +00:00
|
|
|
|
2022-12-24 16:59:24 +00:00
|
|
|
if get_option('enable_gamescope')
|
|
|
|
subdir('src')
|
2021-07-27 16:01:04 +00:00
|
|
|
endif
|