| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- index ffdb4da..a397427 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,--export=malloc,--export=free
- +)
- +
- +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)
|