GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - allyourcodebase/fmt: {fmt} C++ library uses build.zig

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.zig
build.zig
 
 
build.zig.zon
build.zig.zon
 
 

Repository files navigation

fmt-zig

Using build.zig integration for the {fmt} library - a modern formatting library providing a fast and safe alternative to C stdio and C++ iostreams.

Key features of {fmt}:

  • Fast and efficient formatting with type-safe format strings
  • Implements C++20 std::format
  • Supports user-defined types
  • Extensive formatting options and positional arguments
  • Modern clean API design
  • Header-only and compiled versions available

Requirements

  • zig v0.14.0 or master

How to build

Make directory and init

$ zig init
## add in 'build.zig.zon' fmt-zig package
$ zig fetch --save=fmt git+https://github.com/allyourcodebase/fmt-zig

Add in build.zig

const std = @import("std");

pub fn build(b: *std.Build) !void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});

    const fmt_dep = b.dependency("fmt", .{
        .target = target,
        .optimize = optimize,
    });
    const fmt_artifact = fmt_dep.artifact("fmt");

    for(fmt_artifact.root_module.include_dirs.items) |include_dir| {
        try exe.root_module.include_dirs.append(b.allocator, include_dir);
    }
    exe.linkLibrary(fmt_artifact);
}

About

{fmt} C++ library uses build.zig

Topics

cppcpp-librarycross-platformfmtfmtlibformatunicodezig-package

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.