Skip to content

Commit

Permalink
Emscripten ci docker (#6260)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturoc authored Mar 21, 2019
1 parent bfdd7aa commit e6e4ee1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 39 deletions.
19 changes: 12 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: c++
compiler: gcc
sudo: true
cache: ccache
env:
global:
secure: LBTN8d1hS7ocrqDwxLQqU0tfK3FMCXBI8q1yASEjtkp/v5HEyFkbj22H4jXZ20SkpCTlIG2L6i/fU3d6KzJUzTFuxkQEWsnjkj4jAhxGEWRsT1RV6VcUPQDGLHapXwTy+ZYgMNxE7aAdQaBskPHdVzAhjrzlTwVuKp6KjFn+kMU=
Expand All @@ -15,6 +14,7 @@ matrix:
dist: trusty
sudo: required
env: TARGET="linux64"
cache: ccache
addons:
apt:
sources:
Expand Down Expand Up @@ -46,6 +46,7 @@ matrix:
sudo: required
dist: trusty
env: TARGET="linuxarmv6l"
cache: ccache


- os: linux
Expand All @@ -64,32 +65,34 @@ matrix:
sudo: required
dist: trusty
env: TARGET="emscripten"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++6
services:
- docker
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash

- os: osx
osx_image: xcode9.4
compiler: clang
env: TARGET="osx"
cache: ccache

- os: osx
osx_image: xcode9.4
compiler: clang
env: TARGET="osx" OPT="makefiles"
cache: ccache

- os: osx
osx_image: xcode9.4
compiler: clang
env: TARGET="ios"
cache: ccache

- os: osx
osx_image: xcode9.4
compiler: clang
env: TARGET="tvos"
cache: ccache

- os: linux
language: android
Expand Down Expand Up @@ -151,6 +154,8 @@ script:
fi
- if [ "$TARGET" = "osx" ] && [ "$OPT" = "makefiles" ]; then
scripts/ci/$TARGET/run_tests.sh;
elif [ "$TARGET" = "emscripten" ]; then
docker exec -it emscripten sh -c "scripts/ci/$TARGET/build.sh $OPT";
else
scripts/ci/$TARGET/build.sh $OPT;
fi
Expand Down
4 changes: 2 additions & 2 deletions addons/ofxEmscripten/src/ofxEmscriptenURLFileLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ int ofxEmscriptenURLFileLoader::saveAsync(const string & url, const std::filesy
return 0;
}

ofHttpResponse handleRequest(const ofHttpRequest & request){
ofHttpResponse ofxEmscriptenURLFileLoader::handleRequest(const ofHttpRequest & request){
ofLogWarning() << "handleRequest is still not implemented on emscripten";
return ofHttpResponse();
}

int handleRequestAsync(const ofHttpRequest & request){
int ofxEmscriptenURLFileLoader::handleRequestAsync(const ofHttpRequest & request){
ofLogWarning() << "handleRequest is still not implemented on emscripten";
return -1;
}
Expand Down
6 changes: 6 additions & 0 deletions libs/openFrameworks/utils/ofURLFileLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ ofURLFileLoader::ofURLFileLoader()
:impl(new ofURLFileLoaderImpl){}
#endif

#ifdef TARGET_EMSCRIPTEN
#include "ofxEmscriptenURLFileLoader.h"
ofURLFileLoader::ofURLFileLoader()
:impl(new ofxEmscriptenURLFileLoader){}
#endif

ofHttpResponse ofURLFileLoader::get(const string& url){
return impl->get(url);
}
Expand Down
22 changes: 5 additions & 17 deletions scripts/ci/emscripten/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ROOT=${TRAVIS_BUILD_DIR:-"$( cd "$(dirname "$0")/../../.." ; pwd -P )"}
# the "proper" way does not work currently:
#export CXXFLAGS="$(CXXFLAGS) --param ftrack-macro-expansion=0"
#CUSTOMFLAGS="-ftrack-macro-expansion=0"
source ~/emscripten-sdk/emsdk_env.sh
source $ROOT/scripts/ci/ccache.sh
# source ~/emscripten-sdk/emsdk_env.sh
# source $ROOT/scripts/ci/ccache.sh

echo "**** Building OF core ****"
cd $ROOT
Expand All @@ -28,33 +28,21 @@ cp scripts/templates/linux64/config.make examples/templates/allAddonsExample/
cd examples/templates/allAddonsExample/
sed -i s/ofxOsc// addons.make
sed -i s/ofxNetwork// addons.make
#sed -i s/ofxSvg// addons.make
sed -i s/ofxKinect// addons.make
sed -i s/ofxThreadedImageLoader// addons.make
#sed -i s/ofxAssimpModelLoader// addons.make
#sed -i s/ofxGui// addons.make
#sed -i s/ofxXmlSettings// addons.make
#sed -i s/ofxOpenCv// addons.make
sed -i s/ofxPoco// addons.make

sed -i "s/#include \"ofxOsc.h\"//" src/ofApp.h
sed -i "s/#include \"ofxNetwork.h\"//" src/ofApp.h
#sed -i "s/#include \"ofxSvg.h\"//" src/ofApp.h
sed -i "s/#include \"ofxKinect.h\"//" src/ofApp.h
sed -i "s/#include \"ofxThreadedImageLoader.h\"//" src/ofApp.h
#sed -i "s/#include \"ofxAssimpModelLoader.h\"//" src/ofApp.h
#sed -i "s/#include \"ofxGui.h\"//" src/ofApp.h
#sed -i "s/#include \"ofxXmlSettings.h\"//" src/ofApp.h
#sed -i "s/#include \"ofxOpenCv.h\"//" src/ofApp.h
sed -i "s/#include \"ofxXmlPoco.h\"//" src/ofApp.h

sed -i "s/ofxTCPClient client;//" src/ofApp.h
sed -i "s/ofxTCPServer server;//" src/ofApp.h
sed -i "s/ofxOscSender osc_sender;//" src/ofApp.h
#sed -i "s/ofxSVG svg;//" src/ofApp.h
sed -i "s/ofxKinect kinect;//" src/ofApp.h
sed -i "s/ofxThreadedImageLoader .*;//" src/ofApp.h
#sed -i "s/ofxAssimpModelLoader .*;//" src/ofApp.h
#sed -i "s/ofxPanel .*;//" src/ofApp.h
#sed -i "s/ofxXmlSettings .*;//" src/ofApp.h
#sed -i "s/ofxCv.* .*;//" src/ofApp.h
sed -i "s/ofxXmlPoco .*;//" src/ofApp.h

emmake make Debug # USE_CCACHE=1
13 changes: 0 additions & 13 deletions scripts/ci/emscripten/install.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#!/bin/bash
#set -e
#set -o pipefail
# trap any script errors and exit
trap "trapError" ERR

SUDO=

trapError() {
echo
echo " ^ Received error ^"
exit 1
}

cp scripts/ci/emscripten/.emscripten ~/
sed -i "s|%HOME%|${HOME}|g" ~/.emscripten
cd ~/
git clone https://github.com/urho3d/emscripten-sdk
cd emscripten-sdk
# ./emsdk update-tags
# ./emsdk install latest
./emsdk activate latest

0 comments on commit e6e4ee1

Please sign in to comment.