From 41dfd645487c08515465ec7cdc6ee37e4f07cbc9 Mon Sep 17 00:00:00 2001 From: bjorn Date: Thu, 21 Apr 2022 17:48:40 -0700 Subject: [PATCH] tup: Don't export webxr_attach/webxr_detach if webxr is disabled; --- Tupfile.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tupfile.lua b/Tupfile.lua index 96692ecd..7e380b74 100644 --- a/Tupfile.lua +++ b/Tupfile.lua @@ -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'