Menu

Dev_Env_Install

benblan

[Project Guidelines and Rules]

Installing the Development Environment


Requirements

In order to develop code for the game, you will need several elements on your computer :

A git client

Choose what you want.
Don't forget to set your user name and email if you want to commit.

 $ git config user.name="username"
 $ git config user.email="youremail"

A C++ compiler

Freesynd is developed using C++20.
Please consult [Guiding principles and decisions] for the list of supported compilers.

Ninja vs Makefile

You can use one of them but using Ninja is really faster than Makefile

CMake

Look at the [CMake cheatsheet]

Required libraries

The following libraries are needed in their development version :
* SLD 2
* SDL2_Mixer
* SDL2_Image
* Png

Linux

You can install the different libraries using the following commands :

# Install SDL 2
sudo apt-get -y install libsdl2-dev
# Install SDL_Mixer
sudo apt-get -y install libsdl-mixer2-dev
# Install SDL_Image
sudo apt-get -y install libsdl-image2-dev
# Install PNG
sudo apt-get -y install libpng-dev

Windows

You don't need to download anything. All libraries needed for developing and running the game are availing in the source reposition in /extern/.

Mac

For SDL2, you can use Homebrew :

# Install SDL 2
brew install sdl2
# Install SDL_Mixer
brew install sdl2_mixer
# Install SDL_Image
brew install sdl2_image
# Install PNG (but should be installed by SDL_Image
brew install libpng

Dev Environments

Linux

Code::Blocks 20.03

  1. First install Code::Blocks on your system : https://www.codeblocks.org/
  2. Open a shell and run the following command:
cmake -S . --preset <code-blocks-preset>

or you can use only the Cmake generator
For Makefile :

$ cmake -S . -B <build_dir> -G "CodeBlocks - Unix Makefiles"

For Ninja:

$ cmake -S . -B <build_dir> -G "CodeBlocks - Ninja"
  1. Open Code::Block
  2. Open project and navigate to <build_dir> and select Freesynd.cbp

Windows

Visual Studio code

Visual studio code

  1. First install Visual Studio code: choco install vscode
  2. Install the C++ extension and CMake Tools extension
  3. In the freesynd directory, type code .. This will open VS Code.
  4. In VS Code chose the preset ninja-msvc-x86-debug. You may need to scan for compilers first in VS Code if you use VS Build Tools
  5. Then build the application

Mac

Visual studio code

  1. First install Visual Studio code using homebrew
  2. Install the C++ extension and CMake Tools extension
  3. In the freesynd directory, type code .. This will open VS Code.
  4. In VS Code chose the preset ninja-clang-arm64-debug
  5. Then build the application

Related

Wiki: CMake cheatsheet
Wiki: Guiding principles and decisions
Wiki: Project Guidelines and Rules