summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2022-08-02 09:59:12 +0200
committerRay <[email protected]>2022-08-02 09:59:12 +0200
commitd68ddda766fb5330619fa1b3ba25eab621f07c0a (patch)
treef4849c1e7ff911ebfd721ef68e9339f692ad8aed
parent24e6bf0565b2e083cdb26aa5e33f58ec3016073f (diff)
downloadraylib-d68ddda766fb5330619fa1b3ba25eab621f07c0a.tar.gz
raylib-d68ddda766fb5330619fa1b3ba25eab621f07c0a.zip
Added note for multi-threading web compilation
-rw-r--r--examples/Makefile.Web2
-rw-r--r--src/Makefile1
2 files changed, 3 insertions, 0 deletions
diff --git a/examples/Makefile.Web b/examples/Makefile.Web
index 86564429..861b3859 100644
--- a/examples/Makefile.Web
+++ b/examples/Makefile.Web
@@ -591,6 +591,8 @@ core/core_vr_simulator: core/core_vr_simulator.c
# NOTE: To use multi-threading raylib must be compiled with multi-theading support (-s USE_PTHREADS=1)
# WARNING: For security reasons multi-threading is not supported on browsers, it requires cross-origin isolation (Oct.2021)
+# WARNING: It requires raylib to be compiled using -pthread, so atomic operations and thread-local data (if any)
+# in its source were transformed to non-atomic operations and non-thread-local data
core/core_loading_thread: core/core_loading_thread.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -s USE_PTHREADS=1
diff --git a/src/Makefile b/src/Makefile
index b19ac2e1..c03278fb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -316,6 +316,7 @@ ifneq ($(RAYLIB_CONFIG_FLAGS), NONE)
endif
ifeq ($(PLATFORM), PLATFORM_WEB)
+ # NOTE: When using multi-threading in the user code, it requires -pthread enabled
CFLAGS += -std=gnu99
else
CFLAGS += -std=c99