Spaces:
Sleeping
Sleeping
Download examples/bench.wasm/CMakeLists.txt from Xenobd/whisper.cpp: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/Xenobd/whisper.cpp/resolve/4674264ed1a91d908da4e5f59c2ae640525adc45/examples/bench.wasm/CMakeLists.txt
- Command line
-
hf download hf://spaces/Xenobd/whisper.cpp@4674264ed1a91d908da4e5f59c2ae640525adc45/examples/bench.wasm/CMakeLists.txt
-
curl -L -o CMakeLists.txt https://huggingface.co/spaces/Xenobd/whisper.cpp/resolve/4674264ed1a91d908da4e5f59c2ae640525adc45/examples/bench.wasm/CMakeLists.txt
1.16 kB
| # | |
| # libbench | |
| # | |
| set(TARGET libbench) | |
| add_executable(${TARGET} | |
| emscripten.cpp | |
| ) | |
| include(DefaultTargetOptions) | |
| target_link_libraries(${TARGET} PRIVATE | |
| whisper | |
| ) | |
| unset(EXTRA_FLAGS) | |
| if (WHISPER_WASM_SINGLE_FILE) | |
| set(EXTRA_FLAGS "-s SINGLE_FILE=1") | |
| message(STATUS "Embedding WASM inside bench.js") | |
| add_custom_command( | |
| TARGET ${TARGET} POST_BUILD | |
| COMMAND ${CMAKE_COMMAND} -E copy | |
| ${CMAKE_BINARY_DIR}/bin/libbench.js | |
| ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bench.wasm/bench.js | |
| ) | |
| endif() | |
| set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \ | |
| --bind \ | |
| -s USE_PTHREADS=1 \ | |
| -s PTHREAD_POOL_SIZE_STRICT=0 \ | |
| -s INITIAL_MEMORY=2000MB \ | |
| -s TOTAL_MEMORY=2000MB \ | |
| -s FORCE_FILESYSTEM=1 \ | |
| -s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap']\" \ | |
| ${EXTRA_FLAGS} \ | |
| ") | |
| # | |
| # bench.wasm | |
| # | |
| set(TARGET bench.wasm) | |
| configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index-tmpl.html ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}/index.html @ONLY) | |
| configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../helpers.js ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}/helpers.js @ONLY) | |