summaryrefslogtreecommitdiffstatshomepage
path: root/scripts
diff options
context:
space:
mode:
author Justin Kerk <dopefishjustin@gmail.com>2025-07-05 18:18:11 -0700
committer Justin Kerk <dopefishjustin@gmail.com>2025-07-05 18:18:11 -0700
commit8f37851517ed367531af982215bb696c4f08d7be (patch)
tree998415f1303f2723cf1d71c98bde14ad5be23cf5 /scripts
parent867ae9a635dc810861ec9700a741a918e47dd15d (diff)
Emscripten build: Prevent excessive link times with the default optimization level
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genie.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 40368c11802..4b3025b5ec8 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -1106,7 +1106,6 @@ configuration { "asmjs" }
}
linkoptions {
"-Wl,--start-group",
- "-O" .. _OPTIONS["OPTIMIZE"],
"-s USE_SDL=2",
"-s USE_SDL_TTF=2",
"-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=\"['\\$$ERRNO_CODES']\"",
@@ -1124,6 +1123,19 @@ configuration { "asmjs" }
"--embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/lut-default.png@artwork/lut-default.png",
"--embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/slot-mask.png@artwork/slot-mask.png",
}
+ if _OPTIONS["OPTIMIZE"]~=nil then
+ if _OPTIONS["OPTIMIZE"]=="3" then
+ -- emcc's link-time -O3 is very slow, max out at -O2 for now
+ -- we should still be getting the benefit of -O3 on the individual object files
+ linkoptions {
+ "-O2",
+ }
+ else
+ linkoptions {
+ "-O" .. _OPTIONS["OPTIMIZE"],
+ }
+ end
+ end
if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then
linkoptions {
"-g" .. _OPTIONS["SYMLEVEL"],