Installation
Swirl is available on all major platforms. Linux, macOS, and Windows.
Requirements
A C++ compiler is needed for Swirl to compile the programs. Read the guide on how to install a C++ compiler.
Download
Download the latest verson of Swirl from the website or the GitHub release page.
On Linux and macOS, you may need to make the binary executable with chmod +x {binary}
.
Test to see if its working.
- Linux
- macOS
- Windows
./swirl-linux --version
./swirl-macos --version
swirl-windows.exe --version
Source
If you want to compile Swirl from source, follow the steps below.
Requirements
- Linux, macOS, or Windows
- Git (version 2.35 and higher)
- C++ compiler (C++ 14 and higher)
- CMake (version 3.5 and higher)
Read the guide on installing a C++ compiler.
Install the required build dependencies and programs:
Linux
- Ubuntu
- Fedora
- Arch
sudo apt install git cmake
sudo dnf install git cmake
sudo pacman -S git cmake
Windows
choco install git cmake
Clone the repo
git clone https://github.com/SwirlLang/Swirl
It will clone into a folder called Swirl.
Building
Visual Studio Code
cd
into the cloned folder and open it in vscode using code .
install the required extensions:
press ctrl+p and run the following command
ext install ms-vscode.cmake-tools
Setup cmake
create a folder in the project directory named .vscode. Inside it create a file named settings.json and paste the following content
{
"cmake.sourceDirectory": "${workspaceFolder}/Swirl"
}
Now configure the project using the CMake: Configure
from the command pallate.
now click this play button to build and run the binary
the terminal should show this help message. If it did then Swirl has been compiled successfully.
Command line
cd
into the cloned folder and follow the steps below.
Configure CMake
- Linux
- Windows
cmake -B build -DCMAKE_BUILD_TYPE=Debug -S Swirl
cmake -B build -DCMAKE_BUILD_TYPE=Debug -S Swirl -G "MinGW Makefiles"
Build the project
cmake --build build --config Debug
Run the app
- Linux
- Windows
./build/swirl
.\build\swirl.exe
It should show the help message if it did then it has been compiled succesfully.