-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmeson.build
More file actions
57 lines (46 loc) · 1.31 KB
/
Copy pathmeson.build
File metadata and controls
57 lines (46 loc) · 1.31 KB
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
project(
'triangle',
['c'],
version: '1.6',
license: 'Copyright 1993, 1995, 1997, 1998, 2002, 2005 Jonathan Richard Shewchuk',
meson_version: '>= 1.3.1',
default_options : [
'b_vscrt=static_from_buildtype', # Link runtime libraries statically on Windows
'buildtype=release',
])
cc = meson.get_compiler('c')
cc_id = cc.get_id()
message('Compiler ID:', cc_id)
compile_args = []
link_args = []
if cc_id == 'gcc'
compile_args += ['-fexcess-precision=standard', '-ffp-contract=off']
link_args += ['-lm']
endif
if cc_id == 'intel'
compile_args += ['-diag-disable=10441', '-fp-model=strict']
link_args += ['-diag-disable=10441']
endif
if cc_id == 'intel-llvm'
compile_args += ['-fp-model=strict']
endif
system = build_machine.system()
if system == 'linux'
compile_args += '-DLINUX'
elif system == 'darwin'
compile_args += '-DAPPLE'
elif system == 'windows'
compile_args += ['-DCPU86', '-DNO_TIMER', '-DWINDOWS']
endif
add_project_arguments(cc.get_supported_arguments(compile_args), language: 'c')
add_project_link_arguments(cc.get_supported_arguments(link_args), language: 'c')
subdir('src')
# tests
test('help',
exe,
args : ['-h'],
workdir: meson.current_source_dir()/'test')
test('sample',
exe,
args : ['-p', 'A.poly'],
workdir: meson.current_source_dir()/'test')