-
Notifications
You must be signed in to change notification settings - Fork 0
Development Environment Setup
Welcome to the Stirling Engine project! Let's get your development environment set up.
We recommend you develop this project with Microsoft's Visual Studio Code, for convenience and consistency, especially when working with other contributors. To that end, we've included some VS Code configuration files to make getting set up as quick and simple as possible; But feel free to use whatever you like best.
Download and install VS Code from https://code.visualstudio.com. You can also install it using a package manager of your choice:
# Winget (built into Windows 11)
winget install Microsoft.VisualStudioCode
# Homebrew (macOS)
brew install --cask visual-studio-code
For Linux, follow Microsoft's installation instructions.
This project is written in C++, so naturally, you're going to need a C++ compiler, debugger, and other tools.
Install the Microsoft Visual Studio Build Tools. You can do this easily with winget:
winget install Microsoft.VisualStudio.2022.BuildTools
Note
The msbuild tools are normally distributed with versions of the Visual Studio IDE, so if you already have the full version of Visual Studio 2022 installed, you may already have them. However, you do not need a full Visual Studio installation! If you'd like to save space, install only the command-line build tools.
Once they're installed, do the following:
- Open the newly installed "Visual Studio Installer" program
- Next to "Visual Studio Build Tools 2022" (or "Visual Studio Community 2022" if you have the full Visual Studio installed), Click "modify"
- Under the "Workloads" tab, make sure "Desktop Development with C++" is checked
- If it wasn't checked, click "modify" to install it
Install the xCode command-line tools, which include a C++ toolchain:
xcode-select --install
Follow the prompts that appear.
You'll also need to install CMake. The best way to do this is via Homebrew:
- Go to https://brew.sh, and install it by copying the installation command into your terminal
- Once it's installed, you can use the
brew
command to install CMake:brew install cmake
In general, you need a C++ compiler, gdb for debugging, and cmake. On Debian / Ubuntu and derivatives you can get these with:
sudo apt install build-essential gdb cmake
On Arch Linux:
sudo pacman -S --needed base-devel gdb cmake
Note
--needed
instructs pacman not to reinstall packages you already have, which can save some time, since you're likely to have everything in the base-devel
group already.
On Redhat derivatives like Fedora:
sudo dnf groupinstall "Development Tools"
sudo dnf install gdb cmake
Caution
I haven't tested this
We document our code with comments compatible with the Doxygen documentation generator, and if CMake finds doxygen on your system, a target will automatically be created to build HTML documentation from these comments.
Install with winget:
winget install DimitriVanHeesch.Doxygen
Install Homebrew as explained above, then run:
brew install doxygen
Doxygen is likely already in your distro's package manager:
# On Debian / Ubuntu / derivatives
sudo apt -install doxygen
# On Arch Linux
sudo pacman -S doxygen
# On Redhat / Fedora
sudo dnf install doxygen
You can either download and extract the project's zip file, or clone it somewhere with this command:
git clone https://github.com/stirling-uscc/stirling-engine
Once it's cloned, open it in VS Code:
cd stirling-engine
code .
When you open the repository in VS Code, a prompt will likely appear suggesting recommended extensions for this project (such as the C++ and CMake Tools extensions). Click Install to add them. Alternatively, you can manually install the extensions from the recommended section of the Extensions sidebar tab.
- Open the CMake sidebar by clicking on the CMake icon on the left.
- In the CMake sidebar, choose the "Select debug target" option
- Choose stirling-engine as your default target. This ensures you’ll build and run the main engine executable by default when you hit Run or Debug.
Press the play button in the status bar, choose "Start Debugging" from the "Run" menu, or press f8. You should see a blank window appear titled "Stirling Engine" if it worked.
And that’s it! You’re ready to start contributing to the Stirling Engine project. If you run into any setup issues, reach out in the project's Discord chat, or open an issue.