emscriptenでopenFrameworksをwebassemblyにコンパイル

ubuntu 20.04 LTSでコンパイル

# ubuntu linux 20.04 LTS

cd /usr/bin
sudo ln -s python2 python

sudo apt update
sudo apt install -y git gcc g++ cmake wget unzip

cd ~
mkdir source
cd source

git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
#rm -rf emscripten fastcomp fastcomp-clang node llvm

git pull #./emsdk update
#./emsdk list --old
./emsdk install 1.39.4-fastcomp # https://github.com/constantdupuis/of_docker
./emsdk activate 1.39.4-fastcomp
source "/home/takahiro/source/emsdk/emsdk_env.sh" && emcc --clear-cache

cd ..

rm -rf ./openFrameworks-0.11.0
wget https://github.com/openframeworks/openFrameworks/archive/0.11.0.zip
unzip 0.11.0.zip
cd openFrameworks-0.11.0
scripts/emscripten/./download_libs.sh # https://forum.openframeworks.cc/t/latest-emscripten-doesnt-work-on-examples/30463

cd examples/3d/3DPrimitivesExample
cp ../../../scripts/templates/emscripten/Makefile .
#rm -r ./bin/*
#emmake make clean
emmake make
###emrun --hostname ubuntulinux.local --no_browser bin/3DPrimitivesExample.html
# https://でないとmedia device accessエラー
# if not https://, Its cause a error of media device access.

# file://で開くときはFirefoxでabout:configのsecurity.fileuri.strict_orign_policyをfalseにする
# when open with file://... using Firefox with security.fileuri.strict_orign_policy false in about:config.
# http://testingfreak.com/how-to-fix-cross-origin-request-security-cors-error-in-firefox-chrome-and-ie/

https://www.futuregadget.com/file/openframeworks-webassembly/3DPrimitivesExample.html

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です