This project builds a single shared library for the sokol headers.
Target:
- sokol (combines sokol_gfx, sokol_app, sokol_audio, sokol_time, sokol_args)
Outputs a platform-specific dynamic library: .dll on Windows, .dylib on macOS, .so on Linux.
Headers are vendored under third_party/sokol and used by default. You can override with -DSOKOL_DIR=... if desired.
All platforms (choose your preferred generator):
cmake -S . -B build
cmake --build build --config Release
Artifacts will be in build/Release/ (MSVC multi-config) or build/ for single-config generators.
- This follows guidance from floooh/sokol#160 and https://github.com/afterschoolstudio/sokol-dll-builder, defining
SOKOL_DLLand compiling a single translation unit per header withSOKOL_IMPL. - Backends are selected per platform in the stub sources:
- Windows: D3D11
- macOS: Metal
- Linux/Other: GL 3.3 Core
- You can override backends by adding compile definitions on the CMake targets if needed.
- Internally,
sokol_appis built withSOKOL_NO_ENTRYandSOKOL_NOAPIto avoid a default entry point and graphics dependency.
- In your application, include the headers normally and define
SOKOL_DLL(but do not defineSOKOL_IMPL). - Link against the single import library produced by this project (e.g.,
sokol.libon Windows) and ship the correspondingsokolshared library (sokol.dll/.dylib/.so) alongside your executable.