diff options
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/meson.build b/meson.build index 9a59016..4d7d7ce 100644 --- a/meson.build +++ b/meson.build @@ -21,6 +21,8 @@ sources = [] has_wayland = false has_x11 = false has_dbus = false +has_egl = false +has_vulkan = false has_cocoa = system == 'darwin' if system == 'linux' @@ -46,6 +48,17 @@ if system == 'linux' if has_dbus deps += [dbus] endif + egl_dep = dependency('egl', required: false) + wayland_egl_dep = dependency('wayland-egl', required: false) + has_egl = egl_dep.found() and (not has_wayland or wayland_egl_dep.found()) + if has_egl + deps += egl_dep + if has_wayland + deps += wayland_egl_dep + endif + endif + vulkan_dep = dependency('vulkan', required: false) + has_vulkan = vulkan_dep.found() m_dep = cc.find_library('m', required: false) rt_dep = cc.find_library('rt', required: false) deps += [m_dep, rt_dep] @@ -63,17 +76,24 @@ elif system == 'darwin' error('Cocoa requires macOS 14 or newer. Set MACOSX_DEPLOYMENT_TARGET=14.0 or a newer target before configuring.') endif deps += [ - dependency('appleframeworks', modules: ['AppKit', 'Metal', 'QuartzCore', 'UserNotifications']), + dependency('appleframeworks', modules: ['AppKit', 'Metal', 'QuartzCore', 'UserNotifications', 'OpenGL']), ] else error('YASL supports Linux and macOS.') endif +if has_cocoa + vulkan_dep = dependency('vulkan', required: false) + has_vulkan = vulkan_dep.found() +endif + if not has_wayland and not has_x11 and not has_cocoa error('Enable at least one window backend.') endif add_project_arguments( + '-DYASL_HAS_EGL=' + (has_egl ? '1' : '0'), + '-DYASL_HAS_VULKAN=' + (has_vulkan ? '1' : '0'), '-DYASL_HAS_WAYLAND=' + (has_wayland ? '1' : '0'), '-DYASL_HAS_X11=' + (has_x11 ? '1' : '0'), '-DYASL_HAS_COCOA=' + (has_cocoa ? '1' : '0'), @@ -103,10 +123,12 @@ yasl_dep = declare_dependency( meson.override_dependency('yasl', yasl_dep) install_headers( - 'include/yasl/yasl.h', 'include/yasl/app.h', 'include/yasl/loop.h', - 'include/yasl/timing.h', 'include/yasl/keycodes.h', 'include/yasl/native.h', - 'include/yasl/desktop.h', subdir: 'yasl', + 'include/yasl/yasl.h', 'include/yasl/keycodes.h', 'include/yasl/cpu.h', + 'include/yasl/gl.h', 'include/yasl/metal.h', 'include/yasl/desktop.h', subdir: 'yasl', ) +if has_vulkan + install_headers('include/yasl/vulkan.h', subdir: 'yasl') +endif if has_wayland install_headers('include/yasl/native/wayland.h', subdir: 'yasl/native') endif |
