mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-13 13:11:25 +00:00

Update the build scripts of sample workloads (meshoptimizer/bwa/wasm-av1) to use the wasi-sdk-12.0 firstly to build the workload and discard clang-11, as wasi-sdk-12 supports wasi, simd and pthread better. And update the related documents. Also modify wasm mini loader to sync up with the change of wasm normal loader. Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
49 lines
1.3 KiB
Diff
49 lines
1.3 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index ffdb4da..536a5c8 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -127,3 +127,43 @@ install(FILES
|
|
${CMAKE_CURRENT_BINARY_DIR}/meshoptimizerConfig.cmake
|
|
${CMAKE_CURRENT_BINARY_DIR}/meshoptimizerConfigVersion.cmake
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshoptimizer)
|
|
+
|
|
+##################################################
|
|
+# codecbench
|
|
+##################################################
|
|
+add_executable(codecbench tools/codecbench.cpp ${SOURCES})
|
|
+
|
|
+set_target_properties(codecbench PROPERTIES OUTPUT_NAME codecbench.wasm)
|
|
+
|
|
+target_compile_options(codecbench
|
|
+ PUBLIC
|
|
+ -O3 -msimd128
|
|
+ -std=c++11
|
|
+ -Wno-unused-function
|
|
+ -Wno-unused-variable
|
|
+)
|
|
+
|
|
+target_link_options(codecbench
|
|
+ PUBLIC
|
|
+ LINKER:-allow-undefined,--demangle
|
|
+)
|
|
+
|
|
+find_program(WASM_OPT
|
|
+ NAMES wasm-opt
|
|
+ PATHS /opt/binaryen-version_97/bin /opt/binaryen/bin
|
|
+)
|
|
+
|
|
+if (NOT WASM_OPT)
|
|
+ message(WARNING "can not find wasm-opt and will not optimize any wasm module")
|
|
+endif()
|
|
+
|
|
+add_custom_target(codecbench.opt ALL
|
|
+ COMMAND
|
|
+ ${WASM_OPT} -Oz --enable-simd -o codecbench.opt.wasm codecbench.wasm
|
|
+ BYPRODUCTS
|
|
+ ${CMAKE_CURRENT_BINARY_DIR}/codecbench.opt.wasm
|
|
+ WORKING_DIRECTORY
|
|
+ ${CMAKE_CURRENT_BINARY_DIR}
|
|
+)
|
|
+
|
|
+add_dependencies(codecbench.opt codecbench)
|