diff options
author | 2016-05-14 08:22:04 +0000 | |
---|---|---|
committer | 2016-05-14 08:25:57 +0000 | |
commit | 41cb858a3504af72e93cacaeb5cf64bef7bb8746 (patch) | |
tree | 7fc500da373862735650569480fabd6b83e74fbc /scripts/src/main.lua | |
parent | 689c19720ae7854ec50024972ae8ab1232837d15 (diff) |
Emscripten options cleanup (nw)
Diffstat (limited to 'scripts/src/main.lua')
-rw-r--r-- | scripts/src/main.lua | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/scripts/src/main.lua b/scripts/src/main.lua index c10b12b7dee..31b9090d6b1 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -115,21 +115,30 @@ end targetextension ".bc" if os.getenv("EMSCRIPTEN") then local emccopts = "" - emccopts = emccopts .. " -O3" - emccopts = emccopts .. " -s USE_SDL=2" - emccopts = emccopts .. " -s USE_SDL_TTF=2" - emccopts = emccopts .. " --memory-init-file 0" - emccopts = emccopts .. " -s ALLOW_MEMORY_GROWTH=0" - emccopts = emccopts .. " -s TOTAL_MEMORY=268435456" - emccopts = emccopts .. " -s DISABLE_EXCEPTION_CATCHING=2" - emccopts = emccopts .. " -s EXCEPTION_CATCHING_WHITELIST='[\"__ZN15running_machine17start_all_devicesEv\",\"__ZN12cli_frontend7executeEiPPc\"]'" - emccopts = emccopts .. " -s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__Z14js_get_machinev', '__Z9js_get_uiv', '__Z12js_get_soundv', '__ZN15mame_ui_manager12set_show_fpsEb', '__ZNK15mame_ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio', '_SDL_SendKeyboardKey']\"" - emccopts = emccopts .. " --pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js" - emccopts = emccopts .. " --post-js " .. _MAKE.esc(MAME_DIR) .. "scripts/resources/emscripten/emscripten_post.js" - emccopts = emccopts .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/chains@bgfx/chains" - emccopts = emccopts .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/effects@bgfx/effects" - emccopts = emccopts .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/shaders/gles@bgfx/shaders/gles" - emccopts = emccopts .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/slot-mask.png@artwork/slot-mask.png" + .. " -O3" + .. " -s USE_SDL=2" + .. " -s USE_SDL_TTF=2" + .. " --memory-init-file 0" + .. " -s ALLOW_MEMORY_GROWTH=0" + .. " -s TOTAL_MEMORY=268435456" + .. " -s DISABLE_EXCEPTION_CATCHING=2" + .. " -s EXCEPTION_CATCHING_WHITELIST='[\"__ZN15running_machine17start_all_devicesEv\",\"__ZN12cli_frontend7executeEiPPc\"]'" + .. " -s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__Z14js_get_machinev', '__Z9js_get_uiv', '__Z12js_get_soundv', '__ZN15mame_ui_manager12set_show_fpsEb', '__ZNK15mame_ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio', '_SDL_SendKeyboardKey']\"" + .. " --pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js" + .. " --post-js " .. _MAKE.esc(MAME_DIR) .. "scripts/resources/emscripten/emscripten_post.js" + .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/chains@bgfx/chains" + .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/effects@bgfx/effects" + .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/shaders/gles@bgfx/shaders/gles" + .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/slot-mask.png@artwork/slot-mask.png" + + if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then + emccopts = emccopts .. " -g" .. _OPTIONS["SYMLEVEL"] + end + + if _OPTIONS["ARCHOPTS"] then + emccopts = emccopts .. " " .. _OPTIONS["ARCHOPTS"] + end + postbuildcommands { os.getenv("EMSCRIPTEN") .. "/emcc " .. emccopts .. " $(TARGET) -o " .. _MAKE.esc(MAME_DIR) .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".js", } |