@@ -131,6 +131,9 @@ else ()
131
131
unset (LLVM_AVAILABLE_LIBS )
132
132
endif ()
133
133
134
+ # Version
135
+ include (${WAMR_ROOT_DIR} /build-scripts/version.cmake )
136
+
134
137
# Sanitizers
135
138
136
139
if (NOT DEFINED WAMR_BUILD_SANITIZER )
@@ -167,16 +170,61 @@ if (NOT DEFINED WAMR_BUILD_SHRUNK_MEMORY)
167
170
set (WAMR_BUILD_SHRUNK_MEMORY 1 )
168
171
endif ()
169
172
173
+ ########################################
174
+ # Default values
175
+ ########################################
176
+ if (NOT DEFINED WAMR_BUILD_BULK_MEMORY )
177
+ set (WAMR_BUILD_BULK_MEMORY 1 )
178
+ endif ()
179
+
180
+ if (NOT DEFINED WAMR_BUILD_EXCE_HANDLING )
181
+ set (WAMR_BUILD_EXCE_HANDLING 0 )
182
+ endif ()
183
+
184
+ if (NOT DEFINED WAMR_BUILD_GC )
185
+ set (WAMR_BUILD_GC 0 )
186
+ endif ()
187
+
188
+ if (NOT DEFINED WAMR_BUILD_MEMORY64 )
189
+ set (WAMR_BUILD_MEMORY64 0 )
190
+ endif ()
191
+
192
+ if (NOT DEFINED WAMR_BUILD_MULTI_MEMORY )
193
+ set (WAMR_BUILD_MULTI_MEMORY 0 )
194
+ endif ()
195
+
196
+ if (NOT DEFINED WAMR_BUILD_SHARED_MEMORY )
197
+ set (WAMR_BUILD_SHARED_MEMORY 0 )
198
+ endif ()
199
+
200
+ if (NOT DEFINED WAMR_BUILD_STRINGREF )
201
+ set (WAMR_BUILD_STRINGREF 0 )
202
+ endif ()
203
+
204
+ if (NOT DEFINED WAMR_BUILD_TAIL_CALL )
205
+ set (WAMR_BUILD_TAIL_CALL 0 )
206
+ endif ()
207
+
208
+ ########################################
209
+ # Compilation options to marco
170
210
########################################
171
211
172
212
message ("-- Build Configurations:" )
173
213
message (" Build as target ${WAMR_BUILD_TARGET} " )
174
214
message (" CMAKE_BUILD_TYPE " ${CMAKE_BUILD_TYPE} )
215
+ ################## running mode ##################
175
216
if (WAMR_BUILD_INTERP EQUAL 1 )
176
217
message (" WAMR Interpreter enabled" )
177
218
else ()
178
219
message (" WAMR Interpreter disabled" )
179
220
endif ()
221
+ if ((WAMR_BUILD_FAST_INTERP EQUAL 1 ) AND (WAMR_BUILD_INTERP EQUAL 1 ))
222
+ add_definitions (-DWASM_ENABLE_FAST_INTERP=1 )
223
+ message (" Fast interpreter enabled" )
224
+ else ()
225
+ add_definitions (-DWASM_ENABLE_FAST_INTERP=0 )
226
+ message (" Fast interpreter disabled" )
227
+ endif ()
180
228
if (WAMR_BUILD_AOT EQUAL 1 )
181
229
message (" WAMR AOT enabled" )
182
230
else ()
@@ -207,6 +255,16 @@ if (WAMR_BUILD_FAST_JIT EQUAL 1 AND WAMR_BUILD_JIT EQUAL 1
207
255
AND WAMR_BUILD_LAZY_JIT EQUAL 1 )
208
256
message (" Multi-tier JIT enabled" )
209
257
endif ()
258
+ ################## test modes ##################
259
+ if (WAMR_BUILD_SPEC_TEST EQUAL 1 )
260
+ add_definitions (-DWASM_ENABLE_SPEC_TEST=1 )
261
+ message (" spec test compatible mode is on" )
262
+ endif ()
263
+ if (WAMR_BUILD_WASI_TEST EQUAL 1 )
264
+ add_definitions (-DWASM_ENABLE_WASI_TEST=1 )
265
+ message (" wasi test compatible mode is on" )
266
+ endif ()
267
+ ################## native ##################
210
268
if (WAMR_BUILD_LIBC_BUILTIN EQUAL 1 )
211
269
message (" Libc builtin enabled" )
212
270
else ()
@@ -219,38 +277,36 @@ elseif (WAMR_BUILD_LIBC_WASI EQUAL 1)
219
277
else ()
220
278
message (" Libc WASI disabled" )
221
279
endif ()
222
- if ((WAMR_BUILD_FAST_INTERP EQUAL 1 ) AND (WAMR_BUILD_INTERP EQUAL 1 ))
223
- add_definitions (-DWASM_ENABLE_FAST_INTERP=1 )
224
- message (" Fast interpreter enabled" )
225
- else ()
226
- add_definitions (-DWASM_ENABLE_FAST_INTERP=0 )
227
- message (" Fast interpreter disabled" )
280
+ if (WAMR_BUILD_THREAD_MGR EQUAL 1 )
281
+ message (" Thread manager enabled" )
282
+ endif ()
283
+ if (WAMR_BUILD_LIB_PTHREAD EQUAL 1 )
284
+ message (" Lib pthread enabled" )
228
285
endif ()
286
+ if (WAMR_BUILD_LIB_PTHREAD_SEMAPHORE EQUAL 1 )
287
+ message (" Lib pthread semaphore enabled" )
288
+ endif ()
289
+ if (WAMR_BUILD_LIB_WASI_THREADS EQUAL 1 )
290
+ message (" Lib wasi-threads enabled" )
291
+ endif ()
292
+ if (WAMR_BUILD_LIBC_EMCC EQUAL 1 )
293
+ message (" Libc emcc enabled" )
294
+ endif ()
295
+ if (WAMR_BUILD_LIB_RATS EQUAL 1 )
296
+ message (" Lib rats enabled" )
297
+ endif ()
298
+ ################## WAMR features ##################
229
299
if (WAMR_BUILD_MULTI_MODULE EQUAL 1 )
230
300
add_definitions (-DWASM_ENABLE_MULTI_MODULE=1 )
231
301
message (" Multiple modules enabled" )
232
302
else ()
233
303
add_definitions (-DWASM_ENABLE_MULTI_MODULE=0 )
234
304
message (" Multiple modules disabled" )
235
305
endif ()
236
- if (WAMR_BUILD_SPEC_TEST EQUAL 1 )
237
- add_definitions (-DWASM_ENABLE_SPEC_TEST=1 )
238
- message (" spec test compatible mode is on" )
239
- endif ()
240
- if (WAMR_BUILD_WASI_TEST EQUAL 1 )
241
- add_definitions (-DWASM_ENABLE_WASI_TEST=1 )
242
- message (" wasi test compatible mode is on" )
243
- endif ()
244
- if (NOT DEFINED WAMR_BUILD_BULK_MEMORY )
245
- # Enable bulk memory by default
246
- set (WAMR_BUILD_BULK_MEMORY 1 )
247
- endif ()
248
306
if (WAMR_BUILD_BULK_MEMORY EQUAL 1 )
249
307
add_definitions (-DWASM_ENABLE_BULK_MEMORY=1 )
250
- message (" Bulk memory feature enabled" )
251
308
else ()
252
309
add_definitions (-DWASM_ENABLE_BULK_MEMORY=0 )
253
- message (" Bulk memory feature disabled" )
254
310
endif ()
255
311
if (WAMR_BUILD_SHARED_MEMORY EQUAL 1 )
256
312
add_definitions (-DWASM_ENABLE_SHARED_MEMORY=1 )
@@ -270,31 +326,11 @@ if (WAMR_BUILD_MEMORY64 EQUAL 1)
270
326
endif ()
271
327
add_definitions (-DWASM_ENABLE_MEMORY64=1 )
272
328
set (WAMR_DISABLE_HW_BOUND_CHECK 1 )
273
- message (" Memory64 memory enabled" )
274
329
endif ()
275
330
if (WAMR_BUILD_MULTI_MEMORY EQUAL 1 )
276
331
add_definitions (-DWASM_ENABLE_MULTI_MEMORY=1 )
277
- message (" Multi memory enabled" )
278
332
set (WAMR_BUILD_DEBUG_INTERP 0 )
279
333
endif ()
280
- if (WAMR_BUILD_THREAD_MGR EQUAL 1 )
281
- message (" Thread manager enabled" )
282
- endif ()
283
- if (WAMR_BUILD_LIB_PTHREAD EQUAL 1 )
284
- message (" Lib pthread enabled" )
285
- endif ()
286
- if (WAMR_BUILD_LIB_PTHREAD_SEMAPHORE EQUAL 1 )
287
- message (" Lib pthread semaphore enabled" )
288
- endif ()
289
- if (WAMR_BUILD_LIB_WASI_THREADS EQUAL 1 )
290
- message (" Lib wasi-threads enabled" )
291
- endif ()
292
- if (WAMR_BUILD_LIBC_EMCC EQUAL 1 )
293
- message (" Libc emcc enabled" )
294
- endif ()
295
- if (WAMR_BUILD_LIB_RATS EQUAL 1 )
296
- message (" Lib rats enabled" )
297
- endif ()
298
334
if (WAMR_BUILD_MINI_LOADER EQUAL 1 )
299
335
add_definitions (-DWASM_ENABLE_MINI_LOADER=1 )
300
336
message (" WASM mini loader enabled" )
@@ -324,7 +360,6 @@ endif ()
324
360
if (WAMR_BUILD_SIMD EQUAL 1 )
325
361
if (NOT WAMR_BUILD_TARGET MATCHES "RISCV64.*" )
326
362
add_definitions (-DWASM_ENABLE_SIMD=1 )
327
- message (" SIMD enabled" )
328
363
else ()
329
364
message (" SIMD disabled due to not supported on target RISCV64" )
330
365
endif ()
@@ -354,16 +389,11 @@ if (WAMR_BUILD_DUMP_CALL_STACK EQUAL 1)
354
389
endif ()
355
390
if (WAMR_BUILD_TAIL_CALL EQUAL 1 )
356
391
add_definitions (-DWASM_ENABLE_TAIL_CALL=1 )
357
- message (" Tail call enabled" )
358
392
endif ()
359
393
if (WAMR_BUILD_REF_TYPES EQUAL 1 )
360
394
add_definitions (-DWASM_ENABLE_REF_TYPES=1 )
361
- message (" Reference types enabled" )
362
- else ()
363
- message (" Reference types disabled" )
364
395
endif ()
365
396
if (WAMR_BUILD_GC EQUAL 1 )
366
- message (" GC enabled" )
367
397
if (WAMR_TEST_GC EQUAL 1 )
368
398
message (" GC testing enabled" )
369
399
endif ()
@@ -375,7 +405,6 @@ else ()
375
405
message (" GC performance profiling disabled" )
376
406
endif ()
377
407
if (WAMR_BUILD_STRINGREF EQUAL 1 )
378
- message (" Stringref enabled" )
379
408
if (NOT DEFINED WAMR_STRINGREF_IMPL_SOURCE )
380
409
message (" Using WAMR builtin implementation for stringref" )
381
410
else ()
@@ -610,4 +639,41 @@ if (WAMR_BUILD_SHRUNK_MEMORY EQUAL 1)
610
639
else ()
611
640
add_definitions (-DWASM_ENABLE_SHRUNK_MEMORY=0 )
612
641
message (" Shrunk memory disabled" )
642
+ endif ()
643
+ if (WAMR_BUILD_AOT_VALIDATOR EQUAL 1 )
644
+ message (" AOT validator enabled" )
645
+ add_definitions (-DWASM_ENABLE_AOT_VALIDATOR=1 )
613
646
endif ()
647
+
648
+ ########################################
649
+ # Show Phase4 Wasm proposals status.
650
+ ########################################
651
+
652
+ message (
653
+ "-- About Wasm Proposals:\n "
654
+ " Always-on:\n "
655
+ " \" Extended Constant Expressions\"\n "
656
+ " \" Multi-value\"\n "
657
+ " \" Non-trapping float-to-int conversions\"\n "
658
+ " \" Sign-extension operators\"\n "
659
+ " \" WebAssembly C and C++ API\"\n "
660
+ " Configurable. 0 is OFF. 1 is ON:\n "
661
+ " \" Bulk Memory Operation\" via WAMR_BUILD_BULK_MEMORY: ${WAMR_BUILD_BULK_MEMORY} \n "
662
+ " \" Fixed-width SIMD\" via WAMR_BUILD_SIMD: ${WAMR_BUILD_SIMD} \n "
663
+ " \" Garbage collection\" via WAMR_BUILD_GC: ${WAMR_BUILD_GC} \n "
664
+ " \" Legacy Exception handling\" via WAMR_BUILD_EXCE_HANDLING: ${WAMR_BUILD_EXCE_HANDLING} \n "
665
+ " \" Memory64\" via WAMR_BUILD_MEMORY64: ${WAMR_BUILD_MEMORY64} \n "
666
+ " \" Multiple memories\" via WAMR_BUILD_MULTI_MEMORY: ${WAMR_BUILD_MULTI_MEMORY} \n "
667
+ " \" Reference Types\" via WAMR_BUILD_REF_TYPES: ${WAMR_BUILD_REF_TYPES} \n "
668
+ " \" Reference-Typed Strings\" via WAMR_BUILD_STRINGREF: ${WAMR_BUILD_STRINGREF} \n "
669
+ " \" Tail call\" via WAMR_BUILD_TAIL_CALL: ${WAMR_BUILD_TAIL_CALL} \n "
670
+ " \" Threads\" via WAMR_BUILD_SHARED_MEMORY: ${WAMR_BUILD_SHARED_MEMORY} \n "
671
+ " \" Typed Function References\" via WAMR_BUILD_GC: ${WAMR_BUILD_GC} \n "
672
+ " Unsupported (>= Phase4):\n "
673
+ " \" Branch Hinting\"\n "
674
+ " \" Custom Annotation Syntax in the Text Format\"\n "
675
+ " \" Exception handling\"\n "
676
+ " \" Import/Export of Mutable Globals\"\n "
677
+ " \" JS String Builtins\"\n "
678
+ " \" Relaxed SIMD\"\n "
679
+ )
0 commit comments