File tree 3 files changed +20
-4
lines changed
3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,10 @@ android.debug.arm64 = "res://bin/libgdexample.android.template_debug.arm64.so"
29
29
android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so"
30
30
ios.debug = "res://bin/libgdexample.ios.template_debug.xcframework"
31
31
ios.release = "res://bin/libgdexample.ios.template_release.xcframework"
32
- web.debug.wasm32 = "res://bin/libgdexample.web.template_debug.wasm32.wasm"
33
- web.release.wasm32 = "res://bin/libgdexample.web.template_release.wasm32.wasm"
32
+ web.debug.threads.wasm32 = "res://bin/libgdexample.web.template_debug.wasm32.wasm"
33
+ web.release.threads.wasm32 = "res://bin/libgdexample.web.template_release.wasm32.wasm"
34
+ web.debug.wasm32 = "res://bin/libgdexample.web.template_debug.wasm32.nothreads.wasm"
35
+ web.release.wasm32 = "res://bin/libgdexample.web.template_release.wasm32.nothreads.wasm"
34
36
35
37
[dependencies]
36
38
ios.debug = {
Original file line number Diff line number Diff line change @@ -266,6 +266,14 @@ def options(opts, env):
266
266
)
267
267
)
268
268
269
+ opts .Add (
270
+ BoolVariable (
271
+ key = "threads" ,
272
+ help = "Enable threading support" ,
273
+ default = env .get ("threads" , True )
274
+ )
275
+ )
276
+
269
277
# compiledb
270
278
opts .Add (
271
279
BoolVariable (
@@ -393,6 +401,9 @@ def generate(env):
393
401
394
402
tool .generate (env )
395
403
404
+ if env ["threads" ]:
405
+ env .Append (CPPDEFINES = ["THREADS_ENABLED" ])
406
+
396
407
if env .use_hot_reload :
397
408
env .Append (CPPDEFINES = ["HOT_RELOAD_ENABLED" ])
398
409
@@ -436,6 +447,8 @@ def generate(env):
436
447
suffix += "." + env ["arch" ]
437
448
if env ["ios_simulator" ]:
438
449
suffix += ".simulator"
450
+ if not env ["threads" ]:
451
+ suffix += ".nothreads"
439
452
440
453
env ["suffix" ] = suffix # Exposed when included from another project
441
454
env ["OBJSUFFIX" ] = suffix + env ["OBJSUFFIX" ]
Original file line number Diff line number Diff line change @@ -35,8 +35,9 @@ def generate(env):
35
35
env ["SHLIBSUFFIX" ] = ".wasm"
36
36
37
37
# Thread support (via SharedArrayBuffer).
38
- env .Append (CCFLAGS = ["-s" , "USE_PTHREADS=1" ])
39
- env .Append (LINKFLAGS = ["-s" , "USE_PTHREADS=1" ])
38
+ if env ["threads" ]:
39
+ env .Append (CCFLAGS = ["-s" , "USE_PTHREADS=1" ])
40
+ env .Append (LINKFLAGS = ["-s" , "USE_PTHREADS=1" ])
40
41
41
42
# Build as side module (shared library).
42
43
env .Append (CPPFLAGS = ["-s" , "SIDE_MODULE=1" ])
You can’t perform that action at this time.
0 commit comments