-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
85 lines (71 loc) · 2.08 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
project('metroskrew', 'c',
default_options: ['warning_level=2'],
meson_version: '>=0.60.0')
wine_headers = subproject('wine').get_variable('headers_dep_lean')
bins_sub = subproject('mw-executables')
bins_dir = bins_sub.get_variable('bins_dir')
bins = bins_sub.get_variable('bins')
bins_paths = bins_sub.get_variable('bins_paths')
bins_paths_all = bins_sub.get_variable('bins_paths_all')
c = meson.get_compiler('c')
python = find_program('python3')
as = find_program('as')
as_gen = generator(as,
arguments: [
'@EXTRA_ARGS@',
'--MD', '@[email protected]',
'-o', '@OUTPUT@',
'@INPUT@'
],
output: '@[email protected]',
depfile: '@[email protected]')
assert(host_machine.cpu_family() == 'x86',
'This project can only be built for 32-bit x86')
arch = '-march=i586'
c_args_base = [
arch,
'-fno-PIC',
'-U_FILE_OFFSET_BITS',
'-U_FORTIFY_SOURCE'
]
as_args_base = [
arch
]
link_args_base = [
arch,
'-no-pie'
]
support_dir = meson.current_source_dir() / 'meson'
is_glibc = c.get_define('__GLIBC__', prefix: '#include <stdlib.h>') != ''
is_windows = c.get_define('_WIN32') != ''
if is_glibc
tested = c.compiles('', args: [
'-include', support_dir / 'glibc_symver.h',
'-include', support_dir / 'glibc_start.c'])
if tested
c_args_base += ['-include', support_dir / 'glibc_symver.h']
link_args_base += support_dir / 'glibc_start.c'
message('glibc downgrade: YES')
else
message('glibc downgrade: NO')
endif
endif
if is_windows
as_args_base += ['--defsym', '_WIN32=1']
c_args_base += ['-mcrtdll=msvcrt-os', '-D_WIN32_WINNT=0x500']
link_args_base += '-mcrtdll=msvcrt-os'
endif
proj_libdir = get_option('libdir') / meson.project_name()
proj_datadir = get_option('datadir') / meson.project_name()
proj_bin_to_libdir = run_command(
[python, 'meson' / 'relpath.py', proj_libdir, get_option('bindir')],
check: true).stdout().strip()
proj_bin_to_datadir = run_command(
[python, 'meson' / 'relpath.py', proj_datadir, get_option('bindir')],
check: true).stdout().strip()
subdir('dlls')
subdir('patch')
subdir('relink')
subdir('test')
subdir('data')
subdir('wrap')