zcc 0.1.8
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
Requirements
- D compiler
- Zig compiler
- dub or redub package manager
Installation
dub add zcc
Usage
library
// Compile C/C++ code
auto b = new Builder();
// Use `zig cc` or `zig c++`
b.file("source.cpp") // Auto-detects C++ mode
.setTargetTriple("aarch64-linux-gnu")
.setCpu("generic")
.addArg("-Wall")
.execute();
// Build library
auto lb = new Builder();
// use `zig build-lib -lc` or `zig build-lib -lc++`
lb.files(["source.cpp", "resource.cc"]) // Auto-detects C++ mode
.setTargetTriple("riscv64-linux-gnu")
.setCpu("baseline")
.addArg("-Wall")
.buildLibrary("libname");
See more in samples.
executable
dub run zcc:cc -- <clang-flags> <source-files>
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
- 0.1.8 released a month ago
- kassane/zcc-d
- MIT
- Authors:
- Sub packages:
- zcc:cc
- Dependencies:
- none
- Versions:
-
0.1.9 2025-May-20 0.1.8 2025-May-20 0.1.7 2025-May-17 0.1.6 2025-May-15 0.1.5 2025-May-14 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
0 downloads total
-
- Score:
- 0.0
- Short URL:
- zcc.dub.pm