Update README.md

This commit is contained in:
apio 2022-07-19 15:33:22 +02:00
parent 5efdc23006
commit 2d1abc5a85

View File

@ -77,7 +77,7 @@ let @main in {
More documentation is available at [Documentation](docs/Documentation.md). More documentation is available at [Documentation](docs/Documentation.md).
## Building ## Building
First, install the required packages. (ninja is required only for the quick build, you can use other build systems (like GNU Make) for the manual build) First, install the required packages. (ninja is optional, you can use any build system you want)
Debian/Ubuntu: Debian/Ubuntu:
`# apt install zlib1g-dev build-essential cmake ninja-build llvm-dev` `# apt install zlib1g-dev build-essential cmake ninja-build llvm-dev`
@ -86,26 +86,28 @@ CentOS/Fedora/RHEL: `# dnf install gcc gcc-c++ zlib-devel libffi-devel cmake nin
Arch: `# pacman -S gcc cmake ninja llvm-libs llvm` Arch: `# pacman -S gcc cmake ninja llvm-libs llvm`
For Ninja users:
On platforms that install ninja to `/usr/bin/ninja` instead of `/usr/bin/ninja-build`, CMake may fail. On platforms that install ninja to `/usr/bin/ninja` instead of `/usr/bin/ninja-build`, CMake may fail.
In that case, symlink ninja-build to ninja (`ln -s /usr/bin/ninja /usr/bin/ninja-build`). In that case, symlink ninja-build to ninja (`ln -s /usr/bin/ninja /usr/bin/ninja-build`).
Then, you can either use the quick-build script or do a manual build. First-time setup:
Quick build: `./build.sh`
Manual build first-time setup:
``` ```
mkdir build ./sapphire.sh generate <build system, such as Ninja or Unix Makefiles> <build type: Debug or Release>
cd build
cmake ..
``` ```
Then, every time you want to build: To change build type/build system, just run `./sapphire.sh clean` followed by the generate command above.
Building:
``` ```
cd build ./sapphire.sh build
cmake --build .
``` ```
Installing (probably will have to be run as administrator/root):
```
./sapphire.sh install <destination, default depends on platform, on linux it's often /usr/local>
```
This will install the compiler at `<destination>/bin/sapphirec`.
## Running ## Running
The compiler is built at `build/sapphirec`. The compiler is built at `build/sapphirec`.