tup: Don't export webxr_attach/webxr_detach if webxr is disabled;

This commit is contained in:
bjorn 2022-04-21 17:48:40 -07:00
parent 9a54102387
commit 41dfd64548
1 changed files with 3 additions and 1 deletions

View File

@ -145,11 +145,13 @@ if target == 'wasm' then
cflags += '-std=gnu11'
cflags += '-D_POSIX_C_SOURCE=200809L'
lflags += '-s FORCE_FILESYSTEM'
lflags += ([[-s EXPORTED_FUNCTIONS="['_main','_lovrDestroy','_webxr_attach','_webxr_detach']"]])
exported_functions = { '_main', '_lovrDestroy' }
if config.headsets.webxr then
exported_functions += { '_webxr_attach', '_webxr_detach' }
lflags += '--js-library etc/webxr.js'
end
lflags += '--shell-file etc/lovr.html'
lflags += '-s EXPORTED_FUNCTIONS=' .. table.concat(exported_functions, ',')
extras += { 'bin/lovr.js', 'bin/lovr.wasm' }
if config.modules.thread then
cflags += '-s USE_PTHREADS=1'