2020-11-05 10:15:15 +00:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2021-01-28 08:16:02 +00:00
|
|
|
index ffdb4da..a397427 100644
|
2020-11-05 10:15:15 +00:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2020-12-29 06:41:09 +00:00
|
|
|
@@ -127,3 +127,43 @@ install(FILES
|
2020-11-05 10:15:15 +00:00
|
|
|
${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
|
2020-12-29 06:41:09 +00:00
|
|
|
+ -O3 -msimd128
|
2020-11-05 10:15:15 +00:00
|
|
|
+ -std=c++11
|
|
|
|
+ -Wno-unused-function
|
|
|
|
+ -Wno-unused-variable
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+target_link_options(codecbench
|
|
|
|
+ PUBLIC
|
2021-01-28 08:16:02 +00:00
|
|
|
+ LINKER:-allow-undefined,--demangle,--export=malloc,--export=free
|
2020-11-05 10:15:15 +00:00
|
|
|
+)
|
|
|
|
+
|
|
|
|
+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)
|