@@ -131,6 +131,9 @@ else ()
131131 unset (LLVM_AVAILABLE_LIBS)
132132endif ()
133133
134+ # Version
135+ include (${WAMR_ROOT_DIR} /build-scripts/version.cmake )
136+
134137# Sanitizers
135138
136139if (NOT DEFINED WAMR_BUILD_SANITIZER)
@@ -167,16 +170,61 @@ if (NOT DEFINED WAMR_BUILD_SHRUNK_MEMORY)
167170 set (WAMR_BUILD_SHRUNK_MEMORY 1)
168171endif ()
169172
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
170210########################################
171211
172212message ("-- Build Configurations:" )
173213message (" Build as target ${WAMR_BUILD_TARGET} " )
174214message (" CMAKE_BUILD_TYPE " ${CMAKE_BUILD_TYPE} )
215+ ################## running mode ##################
175216if (WAMR_BUILD_INTERP EQUAL 1)
176217 message (" WAMR Interpreter enabled" )
177218else ()
178219 message (" WAMR Interpreter disabled" )
179220endif ()
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 ()
180228if (WAMR_BUILD_AOT EQUAL 1)
181229 message (" WAMR AOT enabled" )
182230else ()
@@ -207,6 +255,16 @@ if (WAMR_BUILD_FAST_JIT EQUAL 1 AND WAMR_BUILD_JIT EQUAL 1
207255 AND WAMR_BUILD_LAZY_JIT EQUAL 1)
208256 message (" Multi-tier JIT enabled" )
209257endif ()
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 ##################
210268if (WAMR_BUILD_LIBC_BUILTIN EQUAL 1)
211269 message (" Libc builtin enabled" )
212270else ()
@@ -219,38 +277,36 @@ elseif (WAMR_BUILD_LIBC_WASI EQUAL 1)
219277else ()
220278 message (" Libc WASI disabled" )
221279endif ()
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" )
228285endif ()
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 ##################
229299if (WAMR_BUILD_MULTI_MODULE EQUAL 1)
230300 add_definitions (-DWASM_ENABLE_MULTI_MODULE=1 )
231301 message (" Multiple modules enabled" )
232302else ()
233303 add_definitions (-DWASM_ENABLE_MULTI_MODULE=0 )
234304 message (" Multiple modules disabled" )
235305endif ()
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 ()
248306if (WAMR_BUILD_BULK_MEMORY EQUAL 1)
249307 add_definitions (-DWASM_ENABLE_BULK_MEMORY=1 )
250- message (" Bulk memory feature enabled" )
251308else ()
252309 add_definitions (-DWASM_ENABLE_BULK_MEMORY=0 )
253- message (" Bulk memory feature disabled" )
254310endif ()
255311if (WAMR_BUILD_SHARED_MEMORY EQUAL 1)
256312 add_definitions (-DWASM_ENABLE_SHARED_MEMORY=1 )
@@ -270,31 +326,11 @@ if (WAMR_BUILD_MEMORY64 EQUAL 1)
270326 endif ()
271327 add_definitions (-DWASM_ENABLE_MEMORY64=1 )
272328 set (WAMR_DISABLE_HW_BOUND_CHECK 1)
273- message (" Memory64 memory enabled" )
274329endif ()
275330if (WAMR_BUILD_MULTI_MEMORY EQUAL 1)
276331 add_definitions (-DWASM_ENABLE_MULTI_MEMORY=1 )
277- message (" Multi memory enabled" )
278332 set (WAMR_BUILD_DEBUG_INTERP 0)
279333endif ()
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 ()
298334if (WAMR_BUILD_MINI_LOADER EQUAL 1)
299335 add_definitions (-DWASM_ENABLE_MINI_LOADER=1 )
300336 message (" WASM mini loader enabled" )
@@ -324,7 +360,6 @@ endif ()
324360if (WAMR_BUILD_SIMD EQUAL 1)
325361 if (NOT WAMR_BUILD_TARGET MATCHES "RISCV64.*" )
326362 add_definitions (-DWASM_ENABLE_SIMD=1 )
327- message (" SIMD enabled" )
328363 else ()
329364 message (" SIMD disabled due to not supported on target RISCV64" )
330365 endif ()
@@ -354,16 +389,11 @@ if (WAMR_BUILD_DUMP_CALL_STACK EQUAL 1)
354389endif ()
355390if (WAMR_BUILD_TAIL_CALL EQUAL 1)
356391 add_definitions (-DWASM_ENABLE_TAIL_CALL=1 )
357- message (" Tail call enabled" )
358392endif ()
359393if (WAMR_BUILD_REF_TYPES EQUAL 1)
360394 add_definitions (-DWASM_ENABLE_REF_TYPES=1 )
361- message (" Reference types enabled" )
362- else ()
363- message (" Reference types disabled" )
364395endif ()
365396if (WAMR_BUILD_GC EQUAL 1)
366- message (" GC enabled" )
367397 if (WAMR_TEST_GC EQUAL 1)
368398 message (" GC testing enabled" )
369399 endif ()
@@ -375,7 +405,6 @@ else ()
375405 message (" GC performance profiling disabled" )
376406endif ()
377407if (WAMR_BUILD_STRINGREF EQUAL 1)
378- message (" Stringref enabled" )
379408 if (NOT DEFINED WAMR_STRINGREF_IMPL_SOURCE)
380409 message (" Using WAMR builtin implementation for stringref" )
381410 else ()
@@ -610,4 +639,41 @@ if (WAMR_BUILD_SHRUNK_MEMORY EQUAL 1)
610639else ()
611640 add_definitions (-DWASM_ENABLE_SHRUNK_MEMORY=0 )
612641 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 )
613646endif ()
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