-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
83 lines (62 loc) · 2.49 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
project('magma', 'c',
default_options: [
'c_std=c11',
'warning_level=3',
'werror=true'
]
)
add_project_arguments('-D_XOPEN_SOURCE=700 -Wall -Werror -pedantic', language: 'c')
deps = [ dependency('fontconfig'), dependency('freetype2'), dependency('xkbcommon'), dependency('xkbcommon-x11'), dependency('vulkan')]
src_files = [ 'src/main.c', 'src/font.c', 'src/vt.c', 'src/logger/log.c', 'src/backend/backend.c', 'src/renderer/vk/vk.c', 'src/renderer/vk/instance.c', 'src/renderer/vk/device.c', 'src/renderer/vk/images.c', 'src/renderer/vk/pipeline.c', 'src/renderer/vk/command_buffers.c']
if get_option('buildtype').startswith('debug')
add_project_arguments('-DMAGMA_VK_DEBUG', language: 'c')
src_files += 'src/renderer/vk/allocator.c'
endif
if get_option('disable-xcb')
message('libxcb disabled you will be unable to run this build on X')
add_project_arguments('-D_MAGMA_NO_XCB_', language: 'c')
else
xcb = dependency('xcb')
xcbimage = dependency('xcb-image')
src_files += 'src/backend/xcb.c'
deps += xcb
deps += xcbimage
endif
if get_option('disable-drm')
message('libdrm disabled you will be unable to run this build on drm')
add_project_arguments('-D_MAGMA_NO_DRM_', language: 'c')
else
src_files += 'src/backend/drm.c'
libdrm = dependency('libdrm')
deps += libdrm
endif
if get_option('disable-wl')
message('wayland_client disabled you will be unable to run this build on wayland')
add_project_arguments('-D_MAGMA_NO_WL_', language: 'c')
else
src_files += 'src/backend/wl/wl.c'
src_files += 'src/backend/wl/input.c'
wayland_client = dependency('wayland-client')
deps += wayland_client
wayland_protocols = dependency('wayland-protocols')
wayland_scanner = dependency('wayland-scanner')
wayland_scanner_bin = find_program(wayland_scanner.get_variable('wayland_scanner'))
protodirs = wayland_protocols.get_variable('pkgdatadir')
xdg_shell_proto = protodirs + '/stable/xdg-shell/xdg-shell.xml'
message(xdg_shell_proto)
xdg_shell_headers = custom_target(
'xdg_shell_header',
output: '@[email protected]',
input: xdg_shell_proto,
command: [wayland_scanner_bin, 'client-header', '@INPUT@', '@OUTPUT@'])
xdg_shell_src = custom_target(
'xdg_shell_src',
output: '@[email protected]',
input: xdg_shell_proto,
command: [wayland_scanner_bin, 'private-code', '@INPUT@', '@OUTPUT@']
)
src_files += xdg_shell_src
src_files += xdg_shell_headers
endif
inc = include_directories('includes')
executable('magma', src_files, dependencies : deps, include_directories : inc)