Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md « wasm « sdks - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 911dea16273282d62c5d5cf58fdea074b633c73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Contents
- bcl Directory. Core libraries to be used with the runtime.
- driver.c, libmonosgen-2.0.a, library_mono.js: Source / Binaries for custom building the runtime. See compilation instructions down.
- mono.js, mono.wasm: Pre-compiler runtime using the above driver.
- sample.html / sample.cs: Sample code, see sample details down there.


# Compiling mono

Mono requires the latest emscripten installed and built[1]. The pre-built binaries are compiled using the following command line:

```
	emcc -g4 -Os -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s BINARYEN=1 -s "BINARYEN_TRAP_MODE='clamp'" -s TOTAL_MEMORY=134217728 -s ALIASING_FUNCTION_POINTERS=0 -s ASSERTIONS=2 --js-library library_mono.js driver.o $(TOP)/sdks/out/wasm-interp/lib/libmonosgen-2.0.a -o mono.js -s NO_EXIT_RUNTIME=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'FS_createPath', 'FS_createDataFile', 'cwrap', 'setValue', 'getValue', 'UTF8ToString']"
```

# Sample

To setup the sample, you need to compile & setup a directory to serve binaries:

```
mkdir managed
cp bcl/mscorlib.dll managed/
csc /nostdlib /target:library /r:managed/mscorlib.dll /out:managed/sample.dll sample.cs 
```

Once that's done, Start a web server from the SDK directory (where sample.html is):

```
python -m SimpleHTTPServer
```

Go to `locahost:8000/sample.html` and it should work.

[1] https://github.com/kripken/emscripten