1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

wasm: add a webassembly compiler backend, based on using binaryen (#17368)

This commit is contained in:
l-m
2023-03-01 08:58:53 +11:00
committed by GitHub
parent b9a8a21094
commit 0625caad56
51 changed files with 7981 additions and 8 deletions

View File

@ -3,7 +3,7 @@ module main
import os
import testing
const vroot = @VMODROOT
const vroot = os.dir(os.real_path(os.getenv_opt('VEXE') or { @VEXE }))
// build as a project folder
const efolders = [
@ -12,11 +12,14 @@ const efolders = [
'examples/vweb_fullstack',
]
pub fn normalised_vroot_path(path string) string {
return os.real_path(os.join_path_single(vroot, path)).replace('\\', '/')
}
fn main() {
args_string := os.args[1..].join(' ')
params := args_string.all_before('build-examples')
skip_prefixes := efolders.map(os.real_path(os.join_path_single(vroot, it)).replace('\\',
'/'))
mut skip_prefixes := efolders.map(normalised_vroot_path(it))
res := testing.v_build_failing_skipped(params, 'examples', skip_prefixes, fn (mut session testing.TestSession) {
for x in efolders {
pathsegments := x.split_any('/')