Dependency manager and build system for C/C++ on top of ninja and clang.
Features:
- Supports Windows and macOS.
- Integrates with any editor with support of clangd with
compile_commands.jsonfile. It will be created/updated automatically on build stage. - Clones dependencies recursively with git, svn, https tar.xz archive.
- For tar.xz archive dependencies supports timestamps, so it will not be pulled again if no changes.
- Very fast startup. On Windows when no file has changed, build will run in 80 milliseconds.
- When project links with another project, it automatically pulls public flags, link libraries, include dirs (similar to CMake behavior).
Runtime requirements: ninja, 7z (and vswhere on windows) executables to be in PATH. clang, clang++ should be present also (on Windows it is not required to be in PATH if installed with Visual Studio).
If clang is installed with Visual Studio Installer, then depo should be used under Developer PowerShell for VS. For standalone installation see https://github.com/llvm/llvm-project/releases.
dotnet publish -c Releasecreate depo.bat somewhere in $PATH (I prefer C:\bin) with contents:
@echo off
D:\src\depo\bin\Release\net10.0\win-x64\publish\depo.exe %*dotnet publish -c Release
echo "`realpath $(find bin/Release -type f -perm +111 -name depo | grep publish | head -n1)` \$@" > ~/.local/bin/depo
chmod +x ~/.local/bin/depodotnet publish -c Release
echo "`realpath $(find bin/Release -type f -executable -name depo | grep publish | head -n1)` \$@" > ~/.local/bin/depo
chmod +x ~/.local/bin/depoIn directory create depo.lisp file. See Examples section for more details about its content.
Run:
depo- it will pull deps, clean working directory, build solution.depo build- build solution (default debug config).depo build -r- build solution in release config.depo run- build solution and run first workspace target.depo run -w- build solution and run first workspace target, watch for cpp/hpp changes and run same actions again (build and run target).depo run amogus- build solution and run target namedamogus.depo run amogus -- some arg- build solution and run target namedamoguswith argumentssome arg.depo clean- remove build files.depo vscode- write some vscode settings files.depo pull- initialize/update dependencies to actual versions.
- proto generator
- automation script for installing depo
- recursive deps
DLL library with include folder inc and link to static library project glad:
(project gapi
(kind dll)
(files *.cpp)
(include 'pub inc)
(link 'prj glad)
(flags 'iface -DmGAPIWrapperGLImportInterface)
(flags -DmGAPIWrapperGLExportInterface)
)Pre-built DLL interface library with auto copy DLL to final binary directory:
(project dxtex
(kind iface)
(include 'iface include)
(link 'iface 'win lib/dxtex.lib)
)
(bin 'win lib/dxtex.dll) ;; this file will be auto copied to bin dirAlso note, paths are always relative to current
depo.lispfile.
Top level project definition (executable):
;; these dependencies will be cloned to %workspace%/deps folder
(deps
(git cc git@github.com:VadikPtr/rebus.git)
(archive sdl3 https://some-binary-server.ru/sdl3-{os}.tar.xz)
(archive dxtex https://some-binary-server.ru/dxtex-{os}.tar.xz)
(archive fontbake https://some-binary-server.ru/fontbake-{os}.tar.xz)
(archive nvtt https://some-binary-server.ru/nvtt-{os}.tar.xz)
(archive gns https://some-binary-server.ru/gns-{os}.tar.xz)
(svn lalia-data svn://some-svn-repo.ru/lalia-data)
)
;; similar to add_subdirectory in CMake
(require
deps/cc
deps/clay
deps/dxtex
deps/fontbake
deps/glad
deps/gns
deps/nvtt
deps/sdl3
gapi
)
(project lalia
(kind exe)
(files lalia/*.cpp)
(include lalia)
(link 'prj cc clay dxtex fontbake gns nvtt sdl3 gapi)
)
(targets lalia)