Skip to content

Zag-Research/llvm-zig

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLVM bindings for Zig

Test commit

The purpose of this repository is to learn about the llvm compiler infrastructure and practice some zig.

Requirement

How to use

Make your project using

zig init

Add this llvm-zig module in build.zig.zon:

zig fetch --save=llvm git+https://github.com/kassane/llvm-zig

in build.zig:

// [...]
    const llvm_dep = b.dependency("llvm", .{ // <== as declared in build.zig.zon
        .target = target, // the same as passing `-Dtarget=<...>` to the library's build.zig script
        .optimize = optimize, // ditto for `-Doptimize=<...>`
    });
    const llvm_mod = llvm_dep.module("llvm"); // <== get llvm bindings module
    // and/or
    const clang_mod = llvm_dep.module("clang"); // <== get clang bindings module
    /// your executable config
    exe.root_module.addImport("llvm", llvm_mod); // <== add llvm module
    exe.root_module.addImport("clang", clang_mod); // <== add llvm module
// [...]

License

This project is licensed under the MIT license.

About

LLVM bindings written in Zig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Zig 100.0%