spdlog built with the zig build system. Original: https://github.com/jessechounard/spdlog
|
|
||
|---|---|---|
| .github/workflows | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| LICENSE | ||
| README.md | ||
spdlog
This is spdlog, packaged for Zig. (Intended for C++ projects using Zig as a build tool.)
Usage
First, update your build.zig.zon:
zig fetch --save git+https://github.com/jessechounard/spdlog
Next, in your build.zig, you can access the library as a dependency:
const spdlog_dep = b.dependency("spdlog", .{
.target = target,
.optimize = optimize,
});
const spdlog_lib = spdlog_dep.artifact("spdlog");
exe.root_module.linkLibrary(spdlog_lib);
Finally, in your C++ file, you can use the library:
#include <spdlog/spdlog.h>
int main() {
spdlog::info("Hello, world (from spdlog)!");
return 0;
}