vidarnel.se

building_satin
Login

Building Satin

I hope getting the satin game engine to build should be reasonably simple, as it is self contained and has minimal dependencies on other code. Note that the Windows version is the most up to date at the moment.

Dependencies

The only dependency for building satin should be the clang c compiler. It needs to be available on your path so that running clang from the command line invokes it. On windows, I've downloaded LLVM from here: https://github.com/llvm/llvm-project/releases and made sure C:Program FilesLLVMbin was added to my PATH environment variable.

Downloading the source

Building the builder

Satin uses its own build system. We will need to bootstrap the build system using Make on gnu/linux or a bat file on windows. After the first build system executable has been compiled, we can use it to build our projects. * Go to vidarn/apps/builder * On windows, run .build_builder.bat. This should produce vidarn/apps/builder/bin/windows/builder.exe * On gnu/linux, run make. This should produce vidarn/apps/builder/bin/linux/builder

Building a project

The build system is quite flexible, but the way I use it is in the directory vidarn/apps. Here, each directory that contains a file called project.c is considered a different subproject. For instance vidarn/apps/template/, which contains vidarn/apps/template/project.c The project.c file defines the targets for that subproject. The template project sets up two targets, "editor" and "game", for compiling the game with and without the satin editor. To build this project including the editor, invoke it like this ./builder[.exe] -target template/editor This should produce vidarn/apps/template/bin/[windows or linux]/editor[.exe]

There are a number of flags you could pass to the builder. When developing, it's useful to include the -dbg, -run and -reload flags. Like this: ./builder[.exe] -target template/editor -dbg -run -reload. The -run and -reload flags will make the builder compile the project as a dynamic library and run it directly. It will then watch the source files for changes and rebuild (and reload) the code whenever it detects a change to them.

Graphical build system:

The builder is itself a subproject in vidarn/apps. It defines two targets in vidarn/apps/builder/project.c, command_line and gui. Let's try the GUI version. Build it like this: ./builder[.exe] -target builder/command_line. This should produce vidarn/apps/builder/bin/[windows or linux]/builder_gui[.exe] Running the executable should present you with a window that lists all the subprojects and allows you to build them.