使用Skia库编译cpp wasm模块遇到错误

时间:2019-05-22 09:12:02

标签: c++ skia wasm

我正在尝试在WASM解决方案中使用SKIA lib。首先,我使用波纹管配置将Skia编译为wasm位代码:

/bin/gn gen ./out/Build-wasm-Release/Release --args="cc=\"emcc\" extra_cflags_cc=[\"-frtti\",\"-s\",\"USE_FREETYPE=1\"] cxx=\"em++\" extra_cflags=[\"-Wno-unknown-warning-option\",\"-s\",\"USE_FREETYPE=1\",\"-s\",\"USE_LIBPNG=1\"] \
is_debug=false \
is_official_build=true \
is_component_build=false \
target_cpu=\"wasm\" \
\
skia_use_egl=false \
skia_use_vulkan=false \
skia_use_libwebp=false \
skia_use_libpng=true \
skia_use_lua=false \
skia_use_dng_sdk=false \
skia_use_fontconfig=false \
skia_use_libjpeg_turbo=false \
skia_use_libheif=false \
skia_use_expat=false \
skia_use_vulkan=false \
skia_use_freetype=false \
skia_use_icu=false \
skia_use_expat=false \
skia_use_piex=false \
skia_use_zlib=true \
skia_enable_gpu=true \
skia_enable_pdf=false"

当我尝试使用以下命令编译自己的代码时,它已成功编译:

em++ multiply.cpp -o multiply.js -s EXPORTED_FUNCTIONS="['_float_multiply','_float_multiply_array','_sample_array_rtn','_sample_array_float_rtn','_msd_main']"-s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]'  -s ALLOW_MEMORY_GROWTH=1 -s USE_WEBGL2=1 -s NO_EXIT_RUNTIME=1 -s USE_LIBPNG=1 -s WASM=1 -s MODULARIZE=1 -s FORCE_FILESYSTEM=0 -I$SKIAPATH/include/ -I$SKIAPATH/include/gpu -I$SKIAPATH/include/core -I$SKIAPATH/include/config -I$SKIAPATH/include/c -L$SKIAPATH/out/Build-wasm-Release/Release -I$SKIAPATH -lskia

我收到以下错误消息:

LLVM ERROR: Invalid SIMD cast between items of different bit sizes!

0 个答案:

没有答案