Skip to content

Commit

Permalink
Provide emrun in a separate build artifact.
Browse files Browse the repository at this point in the history
The emrun-enabled artifact is useful for testing, but not appropriate for deployment.
  • Loading branch information
rmacnak committed Apr 20, 2024
1 parent 5888220 commit aa94435
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-web-xvfb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash -ex
xvfb-run emrun --browser=firefox --serve_root=out "out/ReleaseEmscriptenWASM/primordialsoup.html?snapshot=../snapshots/TestRunner.vfuel"
xvfb-run emrun --browser=firefox --serve_root=out "out/DebugEmscriptenWASM/primordialsoup-emrun.html?snapshot=../snapshots/TestRunner.vfuel"
xvfb-run emrun --browser=firefox --serve_root=out "out/ReleaseEmscriptenWASM/primordialsoup-emrun.html?snapshot=../snapshots/TestRunner.vfuel"
7 changes: 6 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def BuildVM(cxx, arch, target_os, debug, sanitize):
'-s', 'FILESYSTEM=0',
'-s', 'MALLOC=emmalloc',
'-s', 'TOTAL_STACK=131072',
'--emrun',
'--shell-file', File('meta/shell.html').path,
]
else:
Expand Down Expand Up @@ -256,6 +255,12 @@ def BuildVM(cxx, arch, target_os, debug, sanitize):
if target_os == 'emscripten':
program = env.Program(os.path.join(outdir, 'primordialsoup.html'), objects)
Depends(program, 'meta/shell.html')

emrun_env = env.Clone()
emrun_env['LINKFLAGS'] += ['--emrun']
emrun_path = os.path.join(outdir, 'primordialsoup-emrun.html')
emrun_program = emrun_env.Program(emrun_path, objects)
Depends(emrun_program, 'meta/shell.html')
else:
program = env.Program(os.path.join(outdir, 'primordialsoup'), objects)
return program[0]
Expand Down

0 comments on commit aa94435

Please sign in to comment.