A collection of various small libraries, made for personal use. Some of them are intended for game development, some are general-purpose.
Features:
-
Convenient wrappers for SDL2, OpenGL, OpenAL.
-
A simple 2D renderer.
-
A macro-based reflection system for performing automatic [de]serialization, built on top of custom IO streams.
-
Some fancy macros that improve the C++ syntax.
-
Various bits and pieces:
- A math library.
- Metaprogramming utilities.
- Scope guards.
- A Boost.Preprocessor ripoff.
- A tiny JSON parser.
- . . .
Licensed under ZLIB LICENSE.
Currently I'm targeting Clang 15 (with GCC 12's libstdc++; Windows and Linux). GCC 12 should work with minor adjustments. MSVC support would require some code changes, and a new build system.
Install Clang, GCC (for its libstdc++), lld, make, cmake, zip, unzip, tar, zstd, pkg-config, rsync, patchelf, ldd, bc.
Install dependencies for building SDL2. See their manual for the full list. Or, if you're using the current Ubuntu LTS, the necessary packages are also listed in project.mk.
Install the same tools as for native Linux builds.
Install Quasi-MSYS2, and do make install _gcc _gdb _ntldd.
Install MSYS2, and do pacman -S bc diffutils git make mingw-w64-x86_64-clang mingw-w64-x86_64-cmake mingw-w64-x86_64-imagemagick mingw-w64-x86_64-lld mingw-w64-x86_64-ntldd ninja rsync tar unzip wget zip zstd.
After configuring the environment, running make will build and run the app.
Do not add -jN, the number of threads is guessed automatically. Pass JOBS=N to override the number of threads. Pass JOBS= to disable the thread count override; then -jN will work normally.
Settings:
- You can add
MODE=??to override the build mode (release,debug, etc). Seeproject.mkfor a full list, or pass an invalid mode to print the available modes. - You can add
APP=??to choose the application. Seeproject.mkfor a full list, or pass an invalid app to print the available applications. - You can add
ARGS=??to choose the flags for your application.
Usemake remember ...described below to set the defaultMODE/APP/ARGS.
The full list of commands:
- Building and running:
makeormake run-current— build and run. You can use a project name instead ofcurrent, use tab completion for the current list.make run-old-current— run without rebuilding. You might want to runmake sync-libs-and-assetsbefore this to sync the assets.make build-current— build but don't run. You can useallor a project name instead ofcurrent, use tab completion for the current list.
- Misc:
make remember MODE=?? APP=?? ARGS=??— set the currentMODEand generate the debug configuration for VSC for it.make remember APP=??— set the currentAPPand generate the debug configuration for VSC for it.make commands— generatecompile_commands.json. Respects the currentMODEandAPP(the latter is just a hint, which only matters if multiple apps use the same source files).
- Packaging:
make dist— package the binaries.make repeat-build-number— decrement the build number for the nextmake distby one.make dist-deps— package the dependency sources into a single archive, like the one initially used to download them.
- Cleaning:
make clean[-this-os[-this-mode]][-including-libs]— Clean. By default we clean for all OSes and all build modes, use-this-osand-this-modeto constrain that. By default we don't clean built dependencies, use-including-libsto clean them as well.make clean-everything— clean as much as possible (same asmake clean-including-libs, plus more).make prepare-for-storage— prepare the sources for archiving. Same asmake clean-everything, plus archive library sources (likemake dist-deps) and delete the originals.
- Manually building dependencies: (normally not needed)
make libs— build all dependencies.make lib-??— build a dependency (use tab completion for a list).make clean-libs— clean all dependencies.make clean-lib-??— clean a dependency.