JustEnoughMod
Loading...
Searching...
No Matches
Getting Started

Generating pre-commit hooks

In JustEnoughMod (JEM) pre-commit hooks are getting generated by a nix dev shell. Simply install nix via your package manager and run in the JEM directory following command (you might need too enable nix-command and flake feature in nix):

nix develop .#precommit -c true

Building project without nix

This is simpler than using nix, however you do not get the reproducibility and dependency management benefits.

Dependency installation

Warning
You will need to search for the package matching your distro.

Following programs are required for JEM:

  • Compiler supporting c++23 (>=gcc-14, >=clang-17), it is recommended to use the latest compiler available
  • clang format (>= llvm 17)
  • cppchecks
  • meson with ninja

Following programs are required for documentation generation:

  • doxygen 1.9.1 - 1.9.4 or 1.9.6 - 1.10.0 (see doxygen-awesome-css)
  • graphviz

Following dependencies ar required for compiling:

  • GLFW3 (optional)
  • spdlog (optional)
  • vulkan header
  • vulkan loader
  • vulkan validation layer (optional, only for debugging)
  • wayland libraries
Note
Optional libraries are recommended to speed up compile speed.

Build commands

Before building JEM you need to initialize meson first.

./init.sh
Note
If you get error you probably missed some dependencies see Dependency installation.

For building you now just need to run:

./build.sh

After that you can just type:

./run.sh

or run the executable directly.

Another handy script is:

./tidy.sh

This will run clang-tidy and check your code for possible improvements.

For generating documentation you just need to call:

./docs.sh

Building with nix

For setting up the project using nix not other dependency than nix itself is needed. You might need to enable "nix-commands" and "flakes" as experimental features (see nix documentation).

Following command will setup pre-commit and all needed dependencies (recommended for development):

nix develop .#default

If you want to setup only pre-commit without any other dependency you can run following command (not recommended for development):

nix develop .#precommit
Note
With only precommit you will be able to check the code. However you wont be able to use any development scripts! Use carefully since you might be able to build the project incorrectly/unclean with system/nix dependency mix (DO NOT DO THIS).

Now you can just proceed with Build commands.

You can also build the project automatically into the result directory using

nix build .#default

Another option is to directly run the directly after compile without the creation of the result directory:

nix run .#default
Note
nix build and nix run will recompile the project after every change without any cache. It is not recommend to use this for development, however it is recommend to use this for production.