-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathmeson.build
105 lines (89 loc) · 2.71 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
100
101
102
103
104
105
project('dxmt', ['c', 'cpp'], version : 'v0.1', default_options : [
'cpp_std=c++20',
'warning_level=2',
'build.cpp_std=c++20',
'build.warning_level=2',
'b_ndebug=if-release',
])
cpp = meson.get_compiler('cpp')
cc = meson.get_compiler('c')
clang = meson.get_compiler('c', native: true)
clangpp = meson.get_compiler('cpp', native: true)
dxmt_include_dirs = [
'./include',
'./libs'
]
compiler_args = [
'-msse',
'-msse2',
'-msse3',
'-mfpmath=sse',
'-Wimplicit-fallthrough',
# gcc
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
'-Wno-cast-function-type', # Needed for GetProcAddress.
# clang
'-Wno-unused-private-field',
'-Wno-microsoft-exception-spec',
'-Wno-extern-c-compat',
'-Wno-unused-const-variable',
'-Wno-missing-braces',
'-fblocks',
]
native_compiler_args = [
'-Wimplicit-fallthrough',
'-Wno-unused-parameter',
'-Wno-unused-private-field',
'-Wno-unused-const-variable',
'-Wno-missing-braces',
'-fblocks',
]
link_args = []
compiler_args += [
'-DNOMINMAX',
'-D_WIN32_WINNT=0xa00',
]
link_args += [
'-static',
# -static is sufficient for clang, while c runtime will be linked to api-ms-win-crt-* (ucrt)
# '-static-libgcc',
# '-static-libstdc++',
# We need to set the section alignment for debug symbols to
# work properly as well as avoiding a memcpy from the Wine loader.
'-Wl,--file-alignment=4096',
]
# Wine's built-in back traces only work with dwarf4 symbols
if get_option('debug')
compiler_args += [
'-gdwarf-4',
]
endif
dxmt_include_path = include_directories(dxmt_include_dirs)
res_ext = '.o'
wrc = find_program('windres')
wrc_generator = generator(wrc,
output : [ '@BASENAME@' + res_ext ],
arguments : [ '-i', '@INPUT@', '-o', '@OUTPUT@' ],
)
add_project_arguments(cpp.get_supported_arguments(compiler_args), language: 'cpp')
add_project_arguments(clangpp.get_supported_arguments(native_compiler_args), language: 'cpp', native: true)
add_project_arguments(cc.get_supported_arguments(compiler_args), language: 'c')
add_project_link_arguments(cpp.get_supported_link_arguments(link_args), language: 'cpp')
add_project_link_arguments(cc.get_supported_link_arguments(link_args), language: 'c')
add_project_arguments(['-arch', 'x86_64'], language: 'c', native: true)
add_project_arguments(['-arch', 'x86_64'], language: 'cpp', native: true)
add_project_link_arguments(['-arch', 'x86_64'], language: 'cpp', native: true)
dxmt_debug = get_option('dxmt_debug')
if dxmt_debug
add_project_arguments('-DDXMT_DEBUG=1', language: 'cpp')
endif
dxmt_version = vcs_tag(
command: ['git', 'describe', '--always'],
input: 'version.h.in',
output: 'version.h',
)
wine_builtin_dll = get_option('wine_builtin_dll')
subdir('libs')
subdir('src')
subdir('tests')