Difference between revisions of "WebAssembly/Compiler"

From Lazarus wiki
(Created page with "== Instructions == === Compiling the compiler === Get the sources: git clone https://github.com/skalogryz/freepascal fpc-wasm switch to correct branch: cd fpc-wasm g...")
 
m (Compiling the compiler)
Line 13: Line 13:
 
   cd compiler
 
   cd compiler
 
    
 
    
Using lazarus:
+
====Using Lazarus====
 
   open ppcwasm.lpi
 
   open ppcwasm.lpi
 
hit the "compile" button.
 
hit the "compile" button.
  
On the command-line:
+
=====Using command-line=====
 
   fpc -dnoopt -dwasm -Fiwasm -Fuwasm -Fusystems -S2 pp.pas  
 
   fpc -dnoopt -dwasm -Fiwasm -Fuwasm -Fusystems -S2 pp.pas  
  

Revision as of 18:12, 21 September 2019

Instructions

Compiling the compiler

Get the sources:

 git clone https://github.com/skalogryz/freepascal fpc-wasm

switch to correct branch:

 cd fpc-wasm
 git checkout webasm

compile:

 cd compiler
 

Using Lazarus

 open ppcwasm.lpi

hit the "compile" button.

Using command-line
 fpc -dnoopt -dwasm -Fiwasm -Fuwasm -Fusystems -S2 pp.pas 

the compiler can be renamed

 mv pp ppwasm

or, on windows:

 mv pp.exe ppwasm.exe

Using the compiler

You need a system.pas unit. It can be found here:

wasm-demo

You'll also need the wasm tools:

wasm tools

Extract the binaries and put them somewhere in your path.