Skip to content

Commit 5239803

Browse files
update readme
1 parent 9815daf commit 5239803

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

readme.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,41 @@ spry examples/jump
5555
spry examples/boxes
5656
```
5757

58+
## Building from source
59+
60+
Requires CMake and one of the following C/C++ compilers depending on the
61+
platform:
62+
63+
- Visual Studio for Windows
64+
- Clang for Linux
65+
- Emscripten for web browsers
66+
67+
Other compilers might work, but they haven't been tested.
68+
69+
In the command line:
70+
71+
```sh
72+
mkdir build
73+
cd build
74+
cmake .. # This command probably looks different
75+
cmake --build .
76+
```
77+
78+
The first `cmake` command might need extra flags depending on the environment.
79+
For example, the command below generates a release build for a Linux machine
80+
that has both `gcc` and `clang` installed, since CMake would likely choose
81+
`gcc` over `clang`:
82+
83+
```sh
84+
cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Release ..
85+
```
86+
87+
This command should be used when building for web browsers:
88+
89+
```sh
90+
emcmake cmake -DCMAKE_BUILD_TYPE=Release ..
91+
```
92+
5893
## Shoutouts
5994

6095
Special thanks to:

0 commit comments

Comments
 (0)