zcc 0.1.0

D library to build C/C++ code using zig


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

zcc-d

A D library for building C/C++ code using Zig as a cross-compilation toolchain, inspired by cc-rs and cargo-zigbuild.

Features

  • Cross-compilation support via Zig's C/C++ compiler
  • Target triple and CPU architecture configuration
  • Automatic C++ mode detection based on file extensions
  • Flag transformation and filtering
  • Build output logging
  • Exception handling for build failures

Usage

// Basic usage
auto b = new Builder();
b.addArgs(["-c", "source.c", "-o", "output.o"]);
b.execute();

// Cross-compilation
b.setTargetTriple("aarch64-linux-gnu");
b.setCpu("generic");

// C++ mode
b.addArg("source.cpp"); // Automatically switches to C++ mode

CI Support

Tested on multiple platforms (Linux, macOS, Windows) using DMD and LDC compilers.

Requirements

Installation

dub add zcc

License

MIT

Authors:
  • Matheus C. França
Sub packages:
zcc:cc
Dependencies:
none
Versions:
0.1.6 2025-May-15
0.1.5 2025-May-14
0.1.4 2025-May-14
0.1.3 2025-May-14
0.1.2 2025-May-14
Show all 7 versions
Download Stats:
  • 1 downloads today

  • 143 downloads this week

  • 143 downloads this month

  • 143 downloads total

Score:
1.7
Short URL:
zcc.dub.pm