Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/manual-web-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Docker Step
run: docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:3.1.50 bash
run: docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:6.0.6 bash
- name: Download libs
run: ./scripts/dev/download_libs.sh -p emscripten
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/of.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Docker Step
run: "docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:5.0.7 bash"
run: "docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:6.0.6 bash"
# - name: Determine Release
# id: vars
# shell: bash
Expand Down
7 changes: 5 additions & 2 deletions libs/openFrameworksCompiled/project/emscripten/CMakeList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ ifdef USE_CCACHE
endif

#PLATFORM_LDFLAGS += -s EMBIND_AOT=1
PLATFORM_LDFLAGS = --preload-file bin/data@data --emrun --bind --profiling-funcs
PLATFORM_LDFLAGS += -s MAX_WEBGL_VERSION=2 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s FULL_ES2
PLATFORM_LDFLAGS = --emrun --bind --profiling-funcs
ifneq ($(strip $(wildcard bin/data/*)),)
PLATFORM_LDFLAGS += --preload-file bin/data@data
endif
PLATFORM_LDFLAGS += -s MAX_WEBGL_VERSION=2 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s FULL_ES3
PLATFORM_LDFLAGS += -s AUTO_NATIVE_LIBRARIES=1
PLATFORM_LDFLAGS += -s AUTO_JS_LIBRARIES=1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ ifdef USE_CCACHE
endif

#PLATFORM_LDFLAGS += -s EMBIND_AOT=1
PLATFORM_LDFLAGS = --preload-file bin/data@data --emrun --bind --profiling-funcs
PLATFORM_LDFLAGS = --emrun --bind --profiling-funcs
ifneq ($(strip $(wildcard bin/data/*)),)
PLATFORM_LDFLAGS += --preload-file bin/data@data
endif
PLATFORM_LDFLAGS += --use-port=emdawnwebgpu
PLATFORM_LDFLAGS += -s MAX_WEBGL_VERSION=2 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s FULL_ES2
PLATFORM_LDFLAGS += -s MAX_WEBGL_VERSION=2 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s FULL_ES3
PLATFORM_LDFLAGS += -s AUTO_NATIVE_LIBRARIES=1
PLATFORM_LDFLAGS += -s AUTO_JS_LIBRARIES=1

Expand Down
19 changes: 8 additions & 11 deletions scripts/emscripten/install_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $SCRIPT_DIR

VERSION=5.0.7
VERSION=6.0.6

CHECKOUT=$1

Expand All @@ -17,22 +17,21 @@ install_emscripten_source() {

echo "if any issues with python - make sure to add python paths to bash environment Variables:"
python -m pip install --upgrade pip setuptools virtualenv
./emsdk install latest
./emsdk activate latest --permanent
./emsdk_env.sh
# ./emsdk install ${VERSION}
./emsdk install "${VERSION}"
./emsdk activate "${VERSION}" --permanent
source ./emsdk_env.sh

else
echo "Emscripten SDK found at $EMSDK"
source "$EMSDK/emsdk_env"
source "$EMSDK/emsdk_env.sh"
fi
}

install_emscripten_package() {
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
echo "Detected macOS. Checking for Emscripten..."
if ! command_exists emcc; then
if ! command -v emcc >/dev/null 2>&1; then
echo "Emscripten not found. Installing via Homebrew..."
brew install emscripten
else
Expand All @@ -45,7 +44,7 @@ install_emscripten_package() {
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
echo "Detected Linux. Checking for Emscripten..."
if ! command_exists emcc; then
if ! command -v emcc >/dev/null 2>&1; then
echo "Emscripten not found. Installing via apt..."
sudo apt update
sudo apt install -y emscripten
Expand All @@ -56,7 +55,7 @@ install_emscripten_package() {
elif [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
# Windows (assuming Git Bash or similar)
echo "Detected Windows. Checking for Emscripten..."
if ! command_exists emcc; then
if ! command -v emcc >/dev/null 2>&1; then
echo "Emscripten not found. Installing via winget..."
winget install -e --id emscripten.emsdk
else
Expand All @@ -75,5 +74,3 @@ else
echo "Installing Emscripten from Source"
install_emscripten_source
fi


8 changes: 7 additions & 1 deletion scripts/templates/emscripten/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
//========================================================================
int main( ){

#if defined(__EMSCRIPTEN_MAJOR__)
printf("emscripten:v%d.%d.%d\n", __EMSCRIPTEN_MAJOR__, __EMSCRIPTEN_MINOR__, __EMSCRIPTEN_TINY__);
#elif defined(__EMSCRIPTEN_major__)
printf("emscripten:v%d.%d.%d\n", __EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__);
#else
printf("emscripten:unknown version\n");
#endif

//Use ofGLFWWindowSettings for more options like multi-monitor fullscreen
ofGLWindowSettings settings;
tofGLWindowSettings settings;
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

Expand Down
Loading