-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
77 lines (51 loc) · 2.19 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
project('cmmcore', 'cpp', default_options : ['cpp_std=c++17', 'optimization=3', 'buildtype=release'])
# Create an environment object
env = environment()
my_inc = include_directories('.')
cmmcore_sources=[ 'cmmcore/vec.h',
'cmmcore/binom.h',
'cmmcore/nurbs_utils.h',
'cmmcore/nurbs.h',
'cmmcore/ccx.h',
'cmmcore/convexhull.h',
'cmmcore/polygon.h',
'cmmcore/polyline.h',
'cmmcore/monomial.h',
'cmmcore/gauss_map.h'
]
cmmcore_wasm_binding_sources=['wasm/cmmcore.cpp']
# Extend the PATH variable
if host_machine.system() != 'emscripten'
base_compiler_args=['-flto','-lm']
base_compiler_args=[]
# Detect the host operating system
if host_machine.system() == 'darwin'
simd_args = ['-mcpu=apple-m1','-flto','-ffast-math', '-funroll-loops' ]
elif host_machine.cpu() == 'aarch64'
simd_args = ['-mcpu=native','-march=armv8-a+simd']
else
simd_args = [
'-msse', '-msse2', '-msse3', '-mssse3',
'-msse4.1', '-msse4.2', '-mavx', '-mavx2'
]
endif
# Add the SIMD arguments to the project
add_project_arguments(base_compiler_args+simd_args, language : 'cpp')
libcmmcore = shared_library('cmmcore',
cmmcore_sources,
version : '0.1.4',
install : false,
include_directories : my_inc)
libcmmcore_dep = declare_dependency(link_with : libcmmcore, include_directories : my_inc)
subdir('test')
endif
# Build the Wasm (Emscripten) executable
if host_machine.system() == 'emscripten'
cmmcore_wasm = executable(
'cmmcore_wasm',
cmmcore_sources+cmmcore_wasm_binding_sources,
override_options: ['cpp_args=-O3','cpp_args=-s', 'cpp_args=MODULARIZE=1', 'cpp_args=-s', 'cpp_args=EXPORT_NAME="cmmcore"', 'cpp_args=--bind'],
include_directories : my_inc,
install : false
)
endif