forked from bytecodealliance/wasm-micro-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConscript_config
118 lines (95 loc) · 3.61 KB
/
SConscript_config
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
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Copyright (c) 2021, RT-Thread Development Team
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
import os
import re
from building import *
Import('rtconfig')
src = []
objs = []
cwd = GetCurrentDir()
IWASM_INC_DIR = os.path.join(cwd, '..', 'core', 'iwasm', 'include')
CPPPATH = [IWASM_INC_DIR]
if rtconfig.BUILD == 'debug':
CPPDEFINES = ['BH_DEBUG=1']
else:
CPPDEFINES = ['BH_DEBUG=0']
if rtconfig.ARCH == 'arm':
if re.match('^cortex-m.*', rtconfig.CPU):
print('[WAMR] using thumbv4t')
CPPDEFINES += ['BUILD_TARGET_THUMB']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_THUMB']
elif re.match('^cortex-a.*', rtconfig.CPU):
print('[WAMR] using armv7')
CPPDEFINES += ['BUILD_TARGET_ARM']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_ARMV7']
elif re.match('^cortex-r.*', rtconfig.CPU):
print('[WAMR] using armv7')
CPPDEFINES += ['BUILD_TARGET_ARM']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_ARMV7']
elif rtconfig.CPU == 'armv6':
print('[WAMR] using armv6')
CPPDEFINES += ['BUILD_TARGET_ARM']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_ARMV6']
elif re.match('^arm9*', rtconfig.CPU):
print('[WAMR] using armv4')
CPPDEFINES += ['BUILD_TARGET_ARM']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_ARMV4']
elif rtconfig.ARCH == 'ia32':
CPPDEFINES += ['BUILD_TARGET_X86_32', 'RTT_WAMR_BUILD_TARGET_X86_32']
else:
print("[WAMR] unknown arch", rtconfig.ARCH)
if GetDepend(['WAMR_BUILD_INTERP']):
CPPDEFINES += ['WASM_ENABLE_INTERP=1']
if GetDepend(['WAMR_BUILD_FAST_INTERP']):
CPPDEFINES += ['WASM_ENABLE_FAST_INTERP=1']
print("[WAMR] fast interpreter was enabled")
else:
CPPDEFINES += ['WASM_ENABLE_FAST_INTERP=0']
print("[WAMR] fast interpreter was disabled")
else:
CPPDEFINES += ['WASM_ENABLE_INTERP=0']
CPPDEFINES += ['WASM_ENABLE_JIT=0']
if GetDepend(['WAMR_BUILD_MULTI_MODULE']):
CPPDEFINES += ['WASM_ENABLE_MULTI_MODULE=1']
else:
CPPDEFINES += ['WASM_ENABLE_MULTI_MODULE=0']
if GetDepend(['WAMR_BUILD_SPEC_TEST']):
CPPDEFINES += ['WASM_ENABLE_SPEC_TEST=1']
print("[WAMR] spec test compatible mode was enabled")
if GetDepend(['WAMR_BUILD_BULK_MEMORY']):
CPPDEFINES += ['WASM_ENABLE_BULK_MEMORY=1']
print("[WAMR] Bulk memory feature was enabled")
else:
CPPDEFINES += ['WASM_ENABLE_BULK_MEMORY=0']
if GetDepend(['WAMR_BUILD_SHARED_MEMORY']):
CPPDEFINES += ['WASM_ENABLE_SHARED_MEMORY=1']
print("[WAMR] Shared memory enabled")
else:
CPPDEFINES += ['WASM_ENABLE_SHARED_MEMORY=0']
if GetDepend(['WAMR_BUILD_MINI_LOADER']):
CPPDEFINES += ['WASM_ENABLE_MINI_LOADER=1']
print("[WAMR] mini loader enabled")
else:
CPPDEFINES += ['WASM_ENABLE_MINI_LOADER=0']
if GetDepend(['WAMR_DISABLE_HW_BOUND_CHECK']):
CPPDEFINES += ['WASM_DISABLE_HW_BOUND_CHECK=1']
CPPDEFINES += ['WASM_DISABLE_STACK_HW_BOUND_CHECK=1']
print("[WAMR] Hardware boundary check disabled")
if GetDepend(['WAMR_BUILD_SIMD']):
CPPDEFINES += ['WASM_ENABLE_SIMD=1']
print('[WAMR] SIMD enabled')
if GetDepend(['WAMR_BUILD_MEMORY_PROFILING']):
CPPDEFINES += ['WASM_ENABLE_MEMORY_PROFILING=1']
print('[WAMR] Memory profiling enabled')
if GetDepend(['WAMR_BUILD_CUSTOM_NAME_SECTION']):
CPPDEFINES += ['WASM_ENABLE_CUSTOM_NAME_SECTION=1']
print('[WAMR] Custom name section enabled')
if GetDepend(['WAMR_BUILD_TAIL_CALL']):
CPPDEFINES += ['WASM_ENABLE_TAIL_CALL=1']
print('[WAMR] Tail call enabledd')
LIBS = ['m']
group = DefineGroup('wamr', src, depend = ['PKG_USING_WAMR'], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
Return('group')