Skip to content

Commit a6906ae

Browse files
authored
make pthreads not on by default for emscripten. add notes in config.make on how to enable. closes #7421 (#7425)
#changelog #emscripten
1 parent f8da29f commit a6906ae

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

libs/openFrameworksCompiled/project/emscripten/config.emscripten.default.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ PLATFORM_REQUIRED_ADDONS = ofxEmscripten
6464
################################################################################
6565

6666
# Code Generation Option Flags (http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html)
67-
PLATFORM_CFLAGS = -pthread
68-
PLATFORM_CXXFLAGS = -Wall -std=c++17 -Wno-warn-absolute-paths -pthread
67+
PLATFORM_CFLAGS =
68+
PLATFORM_CXXFLAGS = -Wall -std=c++17 -Wno-warn-absolute-paths
6969

7070
################################################################################
7171
# PLATFORM LDFLAGS
@@ -93,7 +93,7 @@ ifdef USE_CCACHE
9393
endif
9494
endif
9595

96-
PLATFORM_LDFLAGS = -Wl --gc-sections --preload-file bin/data@data --emrun --bind --profiling-funcs -s USE_FREETYPE=1 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s FULL_ES2 -sFULL_ES3=1 -pthread
96+
PLATFORM_LDFLAGS = -Wl --gc-sections --preload-file bin/data@data --emrun --bind --profiling-funcs -s USE_FREETYPE=1 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s FULL_ES2 -sFULL_ES3=1
9797
PLATFORM_LDFLAGS += --js-library $(OF_ADDONS_PATH)/ofxEmscripten/libs/html5video/lib/emscripten/library_html5video.js
9898
PLATFORM_LDFLAGS += --js-library $(OF_ADDONS_PATH)/ofxEmscripten/libs/html5audio/lib/emscripten/library_html5audio.js
9999

scripts/templates/emscripten/config.make

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
####
2+
# EMSCRIPTEN THREADING NOTE
3+
# To enable threading in your emscripten project uncomment the two PROJECT_LDFLAGS
4+
# and PROJECT_CFLAGS in the lines below ( PROJECT_CFLAGS=-pthread etc )
5+
# You will need to add a .htaccess file to your project directory if hosting online
6+
# With the following lines:
7+
# Header set Cross-Origin-Embedder-Policy "require-corp"
8+
# Header set Cross-Origin-Opener-Policy "same-origin"
9+
110
################################################################################
211
# CONFIGURE PROJECT MAKEFILE (optional)
312
# This file is where we make project specific configurations.
@@ -79,6 +88,9 @@
7988
# TODO: should this be a default setting?
8089
# PROJECT_LDFLAGS=-Wl,-rpath=./libs
8190

91+
# To add threading support uncomment this line:
92+
# PROJECT_LDFLAGS=-pthread
93+
8294
################################################################################
8395
# PROJECT DEFINES
8496
# Create a space-delimited list of DEFINES. The list will be converted into
@@ -105,7 +117,10 @@
105117
#
106118
# Note: Leave a leading space when adding list items with the += operator
107119
################################################################################
108-
# PROJECT_CFLAGS =
120+
# PROJECT_CFLAGS =
121+
122+
# To add threading support uncomment this line:
123+
# PROJECT_CFLAGS=-pthread
109124

110125
################################################################################
111126
# PROJECT OPTIMIZATION CFLAGS

0 commit comments

Comments
 (0)