forked from Mirrors/wasm3
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.0 KiB
Markdown
95 lines
2.0 KiB
Markdown
5 years ago
|
# Wasm3 development notes
|
||
5 years ago
|
|
||
5 years ago
|
This project uses CMake.
|
||
5 years ago
|
General build steps look like:
|
||
|
```sh
|
||
|
mkdir -p build
|
||
|
cd build
|
||
|
cmake ..
|
||
|
make -j8
|
||
|
```
|
||
|
|
||
5 years ago
|
Wasm3 is continuously tested with Clang, GCC, MSVC compilers, and on multiple platforms.
|
||
|
It can be easily integarted into any build system, as shown in `platforms`.
|
||
5 years ago
|
|
||
5 years ago
|
## Build on Linux, OS X
|
||
5 years ago
|
|
||
5 years ago
|
### Clang
|
||
5 years ago
|
|
||
|
```sh
|
||
5 years ago
|
mkdir build
|
||
5 years ago
|
cd build
|
||
5 years ago
|
cmake -GNinja -DCLANG_SUFFIX="-9" ..
|
||
|
ninja
|
||
|
```
|
||
|
|
||
|
### GCC
|
||
|
|
||
|
```sh
|
||
5 years ago
|
mkdir build
|
||
|
cd build
|
||
5 years ago
|
cmake -GNinja ..
|
||
|
ninja
|
||
|
```
|
||
|
|
||
|
## Build on Windows
|
||
|
|
||
5 years ago
|
Prerequisites:
|
||
5 years ago
|
- [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019)
|
||
5 years ago
|
- [CMake](https://cmake.org/download/)
|
||
5 years ago
|
- [Ninja](https://github.com/ninja-build/ninja/releases)
|
||
|
- [Clang 9](https://releases.llvm.org/download.html#9.0.0)
|
||
|
|
||
5 years ago
|
Recommended tools:
|
||
|
- [Cmder](https://cmder.net/)
|
||
|
- [Python3](https://www.python.org/downloads/)
|
||
|
- [ptime](http://www.pc-tools.net/win32/ptime/)
|
||
|
|
||
5 years ago
|
```sh
|
||
|
# Prepare environment (if needed):
|
||
5 years ago
|
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
|
||
|
set PATH=C:\Program Files\CMake\bin;%PATH%
|
||
|
set PATH=C:\Program Files\LLVM\bin;%PATH%
|
||
|
set PATH=C:\Python36-32\;C:\Python36-32\Scripts\;%PATH%
|
||
|
```
|
||
|
|
||
5 years ago
|
### Build with MSBuild
|
||
5 years ago
|
|
||
5 years ago
|
```sh
|
||
|
# Create a build directory as usual, then build a specific configuration
|
||
5 years ago
|
mkdir build
|
||
|
cd build
|
||
5 years ago
|
|
||
5 years ago
|
# Clang, x64
|
||
5 years ago
|
cmake -G"Visual Studio 16 2019" -A x64 -T ClangCL ..
|
||
5 years ago
|
cmake --build . --config Release
|
||
5 years ago
|
|
||
5 years ago
|
# Clang, x86
|
||
|
cmake -G"Visual Studio 16 2019" -A Win32 -T ClangCL ..
|
||
|
cmake --build . --config Release
|
||
5 years ago
|
|
||
5 years ago
|
# MSVC, x64
|
||
5 years ago
|
cmake -G"Visual Studio 16 2019" -A x64 ..
|
||
5 years ago
|
cmake --build . --config Release
|
||
|
|
||
|
# MSVC, x86
|
||
|
cmake -G"Visual Studio 16 2019" -A Win32 ..
|
||
|
cmake --build . --config Release
|
||
5 years ago
|
```
|
||
|
|
||
5 years ago
|
### Build with Ninja
|
||
5 years ago
|
|
||
5 years ago
|
```sh
|
||
|
# Clang
|
||
|
cmake -GNinja -DCLANG_CL=1 ..
|
||
|
ninja
|
||
|
|
||
|
# MSVC
|
||
5 years ago
|
cmake -GNinja ..
|
||
|
ninja
|
||
|
```
|
||
5 years ago
|
|
||
5 years ago
|
## Build for microcontrollers
|
||
|
|
||
5 years ago
|
In `./platforms/` folder you can find projects for different targets. Some of them are using Platformio, so you can follow the regular pio build process. Others have custom instructions in respective `README.md` files.
|