$ git clone https://github.com/taglib/taglib $ cd taglib && mkdir build && cd build $ CC=emcc CXX=em++ AR=emar cmake .. $ make -j16
cmake可能会报一个错:
1 2 3 4 5 6
-- Check size of wchar_t -- Check size of wchar_t - done CMake Error at ConfigureChecks.cmake:23 (if): if given arguments: "LESS" "2" Unknown arguments specified
# check_type_size("wchar_t" SIZEOF_WCHAR_T) # if(${SIZEOF_WCHAR_T} LESS 2) # message(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.") # endif()
Uncaught (in promise) RuntimeError: function signature mismatch at _ZNK6TagLib5ID3v212FrameFactory11createFrameERKNS_10ByteVectorEPKNS0_6HeaderE (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[31]:0x26c8d) at _ZNK6TagLib5ID3v212FrameFactory11createFrameERKNS_10ByteVectorEPNS0_6HeaderE (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[2119]:0x886f7) at _ZN6TagLib5ID3v23Tag5parseERKNS_10ByteVectorE (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[217]:0x52182) at _ZN6TagLib5ID3v23Tag4readEv (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[278]:0x57f43) at _ZN6TagLib5ID3v23TagC2EPNS_4FileElPKNS0_12FrameFactoryE (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[592]:0x6b9dc) at _ZN6TagLib4MPEG4File4readEb (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[235]:0x53eba) at _ZN6TagLib4MPEG4FileC2EPNS_8IOStreamEPNS_5ID3v212FrameFactoryEbNS_15AudioProperties9ReadStyleE (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[1053]:0x7aaf0) # demangle后即TagLib::MPEG::File::File(TagLib::IOStream*, TagLib::ID3v2::FrameFactory*, bool, TagLib::AudioProperties::ReadStyle) at add_tag (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[62]:0x356bf) at ncmdump_rs::transform::hcdc5151f7ab9b5f0 (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[11]:0x10f30) at ncmdump_rs::work::h156846be72f8a579 (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[429]:0x6306e)
Uncaught (in promise) RuntimeError: memory access out of bounds at dlmalloc::dlmalloc::Dlmalloc::realloc::h430fa370263f868f (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[127]:0x467d9) at __rdl_realloc (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[984]:0x7a484) at __rust_realloc (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[1959]:0x8924f) at alloc::alloc::realloc::hb47e55c361cc3873 (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[959]:0x799e2) at <alloc::alloc::Global as core::alloc::AllocRef>::grow::h197f5bad8094e7c6 (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[142]:0x490be) at alloc::raw_vec::finish_grow::hf66aa09834bcc688 (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[92]:0x3f3a4) at alloc::raw_vec::RawVec<T,A>::grow_amortized::h11902a88edb24012 (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[106]:0x427c4) at alloc::raw_vec::RawVec<T,A>::try_reserve::ha5b7f89b8444ce9a (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[883]:0x778e6) at alloc::raw_vec::RawVec<T,A>::reserve::hbc956c8a4b8cd696 (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[624]:0x6e4c3) at alloc::vec::Vec<T>::reserve::hbf6dbd4f147dde00 (http://localhost:8080/ncmdump_rs_bg.wasm:wasm-function[1299]:0x8115c)