-
Notifications
You must be signed in to change notification settings - Fork 56
/
meson.build
100 lines (80 loc) · 2.34 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
project('mvisor', 'c', 'cpp',
version: '2.7.3',
license: 'GPLv3',
default_options: [
'buildtype=debugoptimized',
'warning_level=2',
'cpp_std=c++17',
'werror=true'
]
)
mvisor_version_data = configuration_data()
mvisor_version_data.set_quoted('VERSION', meson.project_version())
add_project_arguments([
'-Wno-address-of-packed-member',
'-Wno-missing-field-initializers',
'-mavx2'
], language: 'cpp')
add_project_link_arguments(['-lstdc++fs'], language: 'cpp')
protoc = find_program('protoc')
proto_gen = generator(protoc,
output: ['@[email protected]', '@[email protected]'],
arguments: ['--proto_path=@CURRENT_SOURCE_DIR@', '--cpp_out=@BUILD_DIR@', '@INPUT@']
)
proto_sources = []
iasl = find_program('iasl', required: true)
iasl_gen = generator(iasl,
output: ['@[email protected]', '@[email protected]'],
arguments: ['-tc', '-vi', '-p', '@BUILD_DIR@/@BASENAME@', '@INPUT@']
)
iasl_sources = []
mvisor_include = [include_directories('include')]
mvisor_sources = ['main.cc']
openssl_dep = dependency('openssl', required : false)
if openssl_dep.found()
mvisor_version_data.set('HAS_OPENSSL', true)
endif
mvisor_deps = [
dependency('threads'),
openssl_dep
]
subdir('core')
subdir('migration')
subdir('devices')
subdir('images')
subdir('networks')
subdir('utilities')
subdir('gui')
if get_option('sweet-server')
subdir('sweet-server')
mvisor_version_data.set('HAS_SWEET_SERVER', true)
endif
proto_interface = declare_dependency(
sources: proto_sources,
dependencies: dependency('protobuf')
)
mvisor_deps += proto_interface
iasl_interface = declare_dependency(
sources: iasl_sources
)
mvisor_deps += iasl_interface
mvisor = executable('mvisor',
sources: mvisor_sources,
include_directories : mvisor_include,
dependencies: mvisor_deps,
install: true,
install_dir: '/mnt/server/opt/mvisor/build/bin/'
)
configure_file(output: 'version.h',
configuration: mvisor_version_data
)
summary({
'sdl': get_option('sdl'),
'gtk': get_option('gtk'),
'vgpu': get_option('vgpu'),
'sweet-server': get_option('sweet-server'),
'mdebugger': get_option('mdebugger')
}, bool_yn: true, section: 'Options')
run_target('run', command: [mvisor])
run_target('debug', command: ['gdb', '-ex', 'handle SIG34 nostop pass', '-ex', 'run', mvisor])
run_target('load', command: [mvisor, '-config', '/tmp/save/configuration.yaml', '-load', '/tmp/save'])